Configuration examples #176
Replies: 11 comments 7 replies
-
As I said several times before, this is not something we can help users with here. It depends on your editor or IDE, i.e. Neovim, Emacs, Sublime, Jupyterlab-LSP, etc. Most of them allow to set options in json format, so they are sent to the server when it starts. But how to do that, where to put those options and in what format is editor/IDE specific. And most of us here don't use any of the options I mentioned above, so we have no clue about all that. So the appropriate place to ask for help is in your editor/IDE issue tracker or forum. |
Beta Was this translation helpful? Give feedback.
-
The current docs say:
This sounds like 3 config sources:
You are talking about number 2 here I think. I'm asking about 1 and 3. Doesn't this text mean that you can put something in the workspace to affect configuration - a e.g. a |
Beta Was this translation helpful? Give feedback.
-
Nop, you're asking about 2 as well because neither pycodestyle, flake8 nor any other plugin can be enabled/disabled from user config files. And this applies to issue #162 too.
Sure, if the plugin is enabled. After that, you can configure it as you would in a regular project. |
Beta Was this translation helpful? Give feedback.
-
@ccordoba12 Are you able to point to any examples of adjusting the configuration in a real-project? I appreciate that all editors do it differently, but the language server protocol a constant, and so we should be able to extrapolate. At the moment I (and it looks like others) am struggling to get any of the 3rd Party Plugins (under the python-lsp org) listed in the README to register...
I'm guessing that's my issue, but I can't get it working, and I can't find a single example to start working from. Thanks! 🎁 |
Beta Was this translation helpful? Give feedback.
-
Thanks so much for your reply @ccordoba12 I think I'm getting there, but I'm still quite confused. If I understand rightly (which I'm not at all confident of), I would rewrite the Configuration section like this:
This is an attempt to make sense of this, I'm still quite fuzzy on some details, perhaps it's an improvement? |
Beta Was this translation helpful? Give feedback.
-
See this comment for JupyterLab-LSP, although I think the
Yes, it is! Thanks for your suggestions @spookylukey! Could you submit a pull request with them? Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hello, Thanks for opening this issue on this subject, I have been facing the same issue about configuring the language server. In my case, I'm using the client (monaco-languageclient). I understand that the problem might be on the client-side, but looking into the websocket event, I can't find the workspace/didChangeConfiguration being called or even set by default in the capabilities of the server (I tried to manually do that but it's not working either). Client capabilities are set correctly too, with the didChangeConfiguration dynamicRegistration set to true. So my question is the following, is the responsibility of the language server to ask for the configuration to the client, or is it the opposite, the client is in charge of sending it during the initialization? Another question to make it clearer for the documentation what should be the format of the configuration JSON (client side)?
Or
|
Beta Was this translation helpful? Give feedback.
-
I'm going to move this to our newly opened Discussions because it's not really a bug but a petition for help. I'll post further comments there. |
Beta Was this translation helpful? Give feedback.
-
That request needs to be sent from the client to the server. Our response is handled here: python-lsp-server/pylsp/python_lsp.py Lines 386 to 392 in 581da5d
No
This is the case. The client needs to send that request to the server. In Spyder that's the second request we send after we receive a response for the
I think your first option is the right one, but I'm not really sure. Please experiment with that and let us know which one works for you. |
Beta Was this translation helpful? Give feedback.
-
I was trying to configure with https://github.com/superlou/lapce-python's plugin.toml
These are included as part of the initialization |
Beta Was this translation helpful? Give feedback.
-
Could you expand on the configuration section with the help of examples?
For example:
"pylsp.plugins.pydocstyle.enabled": true
- on a per workspace basis, or globally?Other people are also struggling with configuration e.g. #162
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions