|
194 | 194 |
|
195 | 195 | ### Configuring the servers
|
196 | 196 |
|
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 | +``` |
198 | 249 |
|
199 |
| -#### I want to hide specific diagnostics/inspections/warnings |
| 250 | +#### Other configuration methods |
200 | 251 |
|
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. |
202 | 253 |
|
203 | 254 | 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:
|
204 | 255 |
|
|
0 commit comments