Skip to content

Commit f4baac0

Browse files
authored
Adjust builtin scheme (#255)
1 parent 6d6be1d commit f4baac0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

hugo/content/docs/recipes/builtin-library.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,15 @@ export function activate(context: vscode.ExtensionContext) {
164164
This registers an in-memory file system for vscode to use for the `builtin` file schema.
165165
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.
166166

167-
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 `'*'`.
167+
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.
168168

169169
```ts
170170
// Options to control the language client
171171
clientOptions: LanguageClientOptions = {
172-
documentSelector: [{ language: 'mydsl' }],
173-
// Alternatively:
174-
documentSelector: [{ scheme: '*', language: 'mydsl' }],
172+
documentSelector: [
173+
{ scheme: 'file', language: 'mydsl' },
174+
{ scheme: 'builtin', language: 'mydsl' }
175+
],
175176
}
176177
```
178+
**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.

0 commit comments

Comments
 (0)