Skip to content

Commit 75f2b25

Browse files
authored
Merge pull request #172 from krassowski/krassowski-pyls-settings
Update README.md
2 parents f279d48 + 0fbda1e commit 75f2b25

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

README.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,31 @@ extension name, like this:
156156
jupyter labextension install @krassowski/[email protected]
157157
```
158158

159-
### Troubleshooting
159+
### Configuring the servers
160160

161-
#### Rename fails with `IndexError`
161+
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 in [LANGUAGESERVERS.md](./LANGUAGESERVERS.md) for links).
162162

163-
Question: using rename feature for Python does not work, the statusbar displays `Rename failed: Error: IndexError: list index out of range`
163+
#### I want to hide specific diagnostics/inspections/warnings
164164

165-
Answer: this is a pyls-specific error which happens when there is a syntax error and rope (the package used by pyls to perform edits) cannot parse the Python file.
165+
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 ther documentation which refers to the providers of specific features, including `pycodestyle` for inspections/diagnostics.
166166

167-
Solution: Fix (or comment out) the fragments with syntax errors as indicated by diagnostics feature first, and try again.
167+
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:
168+
169+
```cfg
170+
[pycodestyle]
171+
ignore = E402, E703
172+
max-line-length = 120
173+
```
174+
175+
In the example above:
176+
177+
- ignoring E402 allows imports which are not on the very top of the file,
178+
- ignoring E703 allows terminating semicolon (useful for matplotlib plots),
179+
- the maximal allowed line length is increased to 120.
180+
181+
After changing the configuration you may need to restart the JupyterLab, and please be advised that the errors in configuration may prevent the servers from functioning properly.
182+
183+
Again, please do check the pycodestyle documentation for specific error codes, and check the configuration of other feature providers and language servers as needed.
168184

169185
## Acknowledgements
170186

0 commit comments

Comments
 (0)