You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- move docs on settings into language server readme and add some explanatory comments about how to set them for non-VS Code users
- trim README of VS Code accordingly
- harmonize configuration structure of initialize/update in a backwards-compatible way
Copy file name to clipboardExpand all lines: packages/language-server/README.md
+247Lines changed: 247 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,253 @@ Install a plugin for your editor:
50
50
51
51
-[VS Code](../svelte-vscode)
52
52
53
+
## Settings
54
+
55
+
The language server has quite a few settings to toggle features. They are listed below. When using the VS Code extension, you can set these through the settings UI or in the `settings.json` using the keys mentioned below.
56
+
57
+
When using the language server directly, put the settings as JSON inside `initializationOptions.configuration` for the [initialize command](https://microsoft.github.io/language-server-protocol/specification#initialize). When using the [didChangeConfiguration command](https://microsoft.github.io/language-server-protocol/specification#workspace_didChangeConfiguration), pass the JSON directly. The language server also accepts configuration for Emmet (key: `emmet`), Prettier (key: `prettier`) and TypeScript (keys: `javascript` and `typescript` for JS/TS config).
Enable semantic tokens (semantic highlight) for TypeScript. Doesn't apply to JavaScript. _Default_: `true`
149
+
150
+
##### `svelte.plugin.css.enable`
151
+
152
+
Enable the CSS plugin. _Default_: `true`
153
+
154
+
##### `svelte.plugin.css.globals`
155
+
156
+
Which css files should be checked for global variables (`--global-var: value;`). These variables are added to the css completions. String of comma-separated file paths or globs relative to workspace root.
157
+
158
+
##### `svelte.plugin.css.diagnostics.enable`
159
+
160
+
Enable diagnostic messages for CSS. _Default_: `true`
161
+
162
+
##### `svelte.plugin.css.hover.enable`
163
+
164
+
Enable hover info for CSS. _Default_: `true`
165
+
166
+
##### `svelte.plugin.css.completions.enable`
167
+
168
+
Enable auto completions for CSS. _Default_: `true`
169
+
170
+
##### `svelte.plugin.css.completions.emmet`
171
+
172
+
Enable emmet auto completions for CSS. _Default_: `true`
173
+
If you want to disable emmet completely everywhere (not just Svelte), you can also set `"emmet.showExpandedAbbreviation": "never"` in your settings.
Enable document symbols for CSS. _Default_: `true`
186
+
187
+
##### `svelte.plugin.css.selectionRange.enable`
188
+
189
+
Enable selection range for CSS. _Default_: `true`
190
+
191
+
##### `svelte.plugin.html.enable`
192
+
193
+
Enable the HTML plugin. _Default_: `true`
194
+
195
+
##### `svelte.plugin.html.hover.enable`
196
+
197
+
Enable hover info for HTML. _Default_: `true`
198
+
199
+
##### `svelte.plugin.html.completions.enable`
200
+
201
+
Enable auto completions for HTML. _Default_: `true`
202
+
203
+
##### `svelte.plugin.html.completions.emmet`
204
+
205
+
Enable emmet auto completions for HTML. _Default_: `true`
206
+
If you want to disable emmet completely everywhere (not just Svelte), you can also set `"emmet.showExpandedAbbreviation": "never"` in your settings.
207
+
208
+
##### `svelte.plugin.html.tagComplete.enable`
209
+
210
+
Enable HTML tag auto closing. _Default_: `true`
211
+
212
+
##### `svelte.plugin.html.documentSymbols.enable`
213
+
214
+
Enable document symbols for HTML. _Default_: `true`
215
+
216
+
##### `svelte.plugin.html.linkedEditing.enable`
217
+
218
+
Enable Linked Editing for HTML. _Default_: `true`
219
+
220
+
##### `svelte.plugin.html.renameTags.enable`
221
+
222
+
Enable rename tags for the opening/closing tag pairs in HTML. _Default_: `true`
223
+
224
+
##### `svelte.plugin.svelte.enable`
225
+
226
+
Enable the Svelte plugin. _Default_: `true`
227
+
228
+
##### `svelte.plugin.svelte.diagnostics.enable`
229
+
230
+
Enable diagnostic messages for Svelte. _Default_: `true`
231
+
232
+
##### `svelte.plugin.svelte.compilerWarnings`
233
+
234
+
Svelte compiler warning codes to ignore or to treat as errors. Example: { 'css-unused-selector': 'ignore', 'unused-export-let': 'error'}
235
+
236
+
##### `svelte.plugin.svelte.format.enable`
237
+
238
+
Enable formatting for Svelte (includes css & js) using [prettier-plugin-svelte](https://github.com/sveltejs/prettier-plugin-svelte). _Default_: `true`
239
+
240
+
You can set some formatting options through this extension. They will be ignored if there's any kind of configuration file, for example a `.prettierrc` file. Read more about Prettier's configuration file [here](https://prettier.io/docs/en/configuration.html).
Maximum line width after which code is tried to be broken up. This is a Prettier core option. If you have the Prettier extension installed, this option is ignored and the corresponding option of that extension is used instead. This option is also ignored if there's any kind of configuration file, for example a `.prettierrc` file. _Default_: `80`
Use single quotes instead of double quotes, where possible. This is a Prettier core option. If you have the Prettier extension installed, this option is ignored and the corresponding option of that extension is used instead. This option is also ignored if there's any kind of configuration file, for example a `.prettierrc` file. _Default_: `false`
279
+
280
+
##### `svelte.plugin.svelte.hover.enable`
281
+
282
+
Enable hover info for Svelte (for tags like #if/#each). _Default_: `true`
283
+
284
+
##### `svelte.plugin.svelte.completions.enable`
285
+
286
+
Enable autocompletion for Svelte (for tags like #if/#each). _Default_: `true`
0 commit comments