From 8461fcbd3cc6bba651c4bfdc1b09073b5232ac1e Mon Sep 17 00:00:00 2001 From: Yannick Daveluy Date: Thu, 5 Sep 2024 11:55:00 +0200 Subject: [PATCH] Update builtin-library.md (#252) --- hugo/content/docs/recipes/builtin-library.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hugo/content/docs/recipes/builtin-library.md b/hugo/content/docs/recipes/builtin-library.md index 8401d61e..fcb3e902 100644 --- a/hugo/content/docs/recipes/builtin-library.md +++ b/hugo/content/docs/recipes/builtin-library.md @@ -163,3 +163,14 @@ export function activate(context: vscode.ExtensionContext) { This registers an in-memory file system for vscode to use for the `builtin` file schema. Every time vscode is supposed to open a file with this schema, it will invoke the `stat` and `readFile` methods of the registered file system provider. + +To ensure that LSP services (such as hover, outline, go to definition, etc.) work properly inside a built-in file, make sure that LanguageClientOptions is correctly configured. The document selector used for your language should handle the `builtin` scheme. It is recommended to support all schemes, either by removing the scheme option or by setting the scheme option to `'*'`. + +```ts +// Options to control the language client +clientOptions: LanguageClientOptions = { + documentSelector: [{ language: 'mydsl' }], + // Alternatively: + documentSelector: [{ scheme: '*', language: 'mydsl' }], +} +```