From cb2209a2f49dad51462288ea372946c785c7b312 Mon Sep 17 00:00:00 2001 From: Yannick Daveluy Date: Thu, 19 Sep 2024 20:48:31 +0200 Subject: [PATCH 1/3] Update builtin-library.md --- hugo/content/docs/recipes/builtin-library.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hugo/content/docs/recipes/builtin-library.md b/hugo/content/docs/recipes/builtin-library.md index fcb3e902..96fb0f92 100644 --- a/hugo/content/docs/recipes/builtin-library.md +++ b/hugo/content/docs/recipes/builtin-library.md @@ -164,13 +164,12 @@ 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 `'*'`. +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 (`src/extension/main.ts`). The document selector used for your language should handle the `builtin` scheme. ```ts // Options to control the language client clientOptions: LanguageClientOptions = { - documentSelector: [{ language: 'mydsl' }], - // Alternatively: - documentSelector: [{ scheme: '*', language: 'mydsl' }], + documentSelector: [{ scheme: 'file', language: 'mydsl' }, { scheme: 'builtin', language: 'mydsl' }], } ``` + **Warning:** It is discouraged to set `scheme` to `'*'`, as we do not want to build a Git revision when performing a Git diff. From fce0fd852dc5c06d56b03f4bd716f96038baef03 Mon Sep 17 00:00:00 2001 From: Yannick Daveluy Date: Thu, 19 Sep 2024 20:50:34 +0200 Subject: [PATCH 2/3] Update builtin-library.md --- hugo/content/docs/recipes/builtin-library.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hugo/content/docs/recipes/builtin-library.md b/hugo/content/docs/recipes/builtin-library.md index 96fb0f92..05b8cd5a 100644 --- a/hugo/content/docs/recipes/builtin-library.md +++ b/hugo/content/docs/recipes/builtin-library.md @@ -172,4 +172,4 @@ clientOptions: LanguageClientOptions = { documentSelector: [{ scheme: 'file', language: 'mydsl' }, { scheme: 'builtin', language: 'mydsl' }], } ``` - **Warning:** It is discouraged to set `scheme` to `'*'`, as we do not want to build a Git revision when performing a Git diff. + **Warning:** It is discouraged to set `scheme` to `'*'`, as, for example, we do not want to build a Git revision when performing a Git diff. From 1eb573861c8bedb68dd0789fcb78c19961976662 Mon Sep 17 00:00:00 2001 From: Mark Sujew Date: Tue, 8 Oct 2024 13:14:27 +0000 Subject: [PATCH 3/3] Adjust formatting --- hugo/content/docs/recipes/builtin-library.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hugo/content/docs/recipes/builtin-library.md b/hugo/content/docs/recipes/builtin-library.md index 05b8cd5a..c2c26726 100644 --- a/hugo/content/docs/recipes/builtin-library.md +++ b/hugo/content/docs/recipes/builtin-library.md @@ -169,7 +169,10 @@ To ensure that LSP services (such as hover, outline, go to definition, etc.) wor ```ts // Options to control the language client clientOptions: LanguageClientOptions = { - documentSelector: [{ scheme: 'file', language: 'mydsl' }, { scheme: 'builtin', language: 'mydsl' }], + documentSelector: [ + { scheme: 'file', language: 'mydsl' }, + { scheme: 'builtin', language: 'mydsl' } + ], } ``` **Warning:** It is discouraged to set `scheme` to `'*'`, as, for example, we do not want to build a Git revision when performing a Git diff.