Skip to content

Commit efc1698

Browse files
committed
Do not crash the LSP at boot when prelude has an error
We fall back to builtins only if prelude fails to document.
1 parent 9f53fd0 commit efc1698

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/buck2_server/src/lsp.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@ impl DocsCacheManager {
138138
.iter()
139139
.flat_map(|(_, d)| d.members.keys().map(|s| s.as_str()))
140140
.collect();
141-
if let Some((import_path, docs)) = get_prelude_docs(dice_ctx, &builtin_names).await? {
141+
142+
// Do not ? the error here. It's prelude. It's allowed to have type errors.
143+
if let Ok(Some((import_path, docs))) = get_prelude_docs(dice_ctx, &builtin_names).await {
142144
builtin_docs.push((Some(import_path), docs));
143145
}
144146
let equality_token = dice_ctx.equality_token();

0 commit comments

Comments
 (0)