Skip to content

Commit 8461fcb

Browse files
authored
Update builtin-library.md (#252)
1 parent 7f098d8 commit 8461fcb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,14 @@ export function activate(context: vscode.ExtensionContext) {
163163

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.
166+
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 `'*'`.
168+
169+
```ts
170+
// Options to control the language client
171+
clientOptions: LanguageClientOptions = {
172+
documentSelector: [{ language: 'mydsl' }],
173+
// Alternatively:
174+
documentSelector: [{ scheme: '*', language: 'mydsl' }],
175+
}
176+
```

0 commit comments

Comments
 (0)