Skip to content

Commit 2553082

Browse files
committed
Update README
1 parent 51f4487 commit 2553082

File tree

1 file changed

+54
-3
lines changed

1 file changed

+54
-3
lines changed

README.md

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,62 @@ jupyter labextension install @krassowski/[email protected]
194194

195195
### Configuring the servers
196196

197-
We plan to provide a configuration GUI at some time ([#25](https://github.com/krassowski/jupyterlab-lsp/issues/25)), but in the meantime, you can use the instructions for the specific servers as described on their websites (see the [table of language servers][language-servers] for links).
197+
Server configurations can be edited using the Advanced Settings editor in JupyterLab (_Settings > Advanced Settings Editor_). For settings specific to each server, please see the [table of language servers][language-servers]. Example settings might include:
198+
199+
```json
200+
{
201+
"language_servers": {
202+
"pyls": {
203+
"serverSettings": {
204+
"pyls.plugins.pydocstyle.enabled": true,
205+
"pyls.plugins.pyflakes.enabled": false,
206+
"pyls.plugins.flake8.enabled": true
207+
}
208+
},
209+
"r-languageserver": {
210+
"serverSettings": {
211+
"r.lsp.debug": false,
212+
"r.lsp.diagnostics": false
213+
}
214+
},
215+
"yaml-language-server": {
216+
"serverSettings": {
217+
"yaml.schemas": {
218+
"http://json.schemastore.org/composer": "/*"
219+
}
220+
}
221+
}
222+
},
223+
}
224+
```
225+
The `serverSettings` key specifies the configurations sent to the language servers. These can be written using stringified dot accessors like above (in the VSCode style), or as nested JSON objects, e.g.:
226+
```json
227+
{
228+
"language_servers": {
229+
"pyls": {
230+
"serverSettings": {
231+
"pyls": {
232+
"plugins": {
233+
"pydocstyle": {
234+
"enabled": true
235+
},
236+
"pyflakes": {
237+
"enabled": false
238+
},
239+
"flake8": {
240+
"enabled": true
241+
}
242+
}
243+
}
244+
}
245+
}
246+
}
247+
}
248+
```
198249

199-
#### I want to hide specific diagnostics/inspections/warnings
250+
#### Other configuration methods
200251

201-
For example, the Python server that we support by default ([pyls](https://github.com/palantir/python-language-server)) has a [configuration section](https://github.com/palantir/python-language-server#configuration) in their documentation which refers to the providers of specific features, including `pycodestyle` for inspections/diagnostics.
252+
Some language servers, such as `pyls`, provide other configuration methods _in addition_ to language-server configuration messages (accessed using the Advanced Settings Editor). For example, `pyls` allows users to configure the server using a local configuration file. You can change the inspection/diagnostics for server plugins like `pycodestyle` there.
202253

203254
The exact configuration details will vary between operating systems (please see the [configuration section of pycodestyle documentation](https://pycodestyle.readthedocs.io/en/latest/intro.html#configuration)), but as an example, on Linux you would simply need to create a file called `~/.config/pycodestyle`, which may look like that:
204255

0 commit comments

Comments
 (0)