- Notifications
You must be signed in to change notification settings - Fork220
Configuration examples#176
-
Could you expand on theconfiguration section with the help of examples? For example:
Other people are also struggling with configuration e.g.#162 Thanks! |
BetaWas this translation helpful?Give feedback.
All reactions
👍 6
Replies: 11 comments 7 replies
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
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. |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Thecurrent 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 |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
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. |
BetaWas this translation helpful?Give feedback.
All reactions
-
@ccordoba12 Are you able to point toany 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 ofthe 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! 🎁 |
BetaWas this translation helpful?Give feedback.
All reactions
-
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? |
BetaWas this translation helpful?Give feedback.
All reactions
-
Seethis 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! |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
-
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 thedidChangeConfiguration 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
|
BetaWas this translation helpful?Give feedback.
All reactions
-
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. |
BetaWas this translation helpful?Give feedback.
All reactions
-
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 in581da5d
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. |
BetaWas this translation helpful?Give feedback.
All reactions
-
I was trying to configure withhttps://github.com/superlou/lapce-python's plugin.toml
These are included as part of the initialization |
BetaWas this translation helpful?Give feedback.
All reactions
-
python-lsp-server/pylsp/python_lsp.py Line 287 ina9d503c
Config() Maybe could print |
BetaWas this translation helpful?Give feedback.
All reactions
-
In that case the issue is likely with the configuration object being un-expanded ( |
BetaWas this translation helpful?Give feedback.
All reactions
-
In vscode (not supported by python-lsp-server) I set
for settings including
Those options should all start with "pylsp." instead of "python." to be sent to python-lsp-server; it only sends the language server's own configuration and not other keys from The editor I'm using has a toml config file, and the toml format expands dotted keys into nested objects in the same way.
|
BetaWas this translation helpful?Give feedback.
All reactions
-
Options passed to this server should be nested and not include dots. Like: {"settings":{"pylsp":{"configurationSources":["pycodestyle"],"plugins":{"autopep8":{"enabled":false},},"rope":{"extensionModules":null,"ropeFolder":null}}}}
Does it...? In#176 (comment) you seem to be saying that it doesn't. |
BetaWas this translation helpful?Give feedback.
All reactions
❤️ 1
-
You have to leave the dotted toml keys un-quoted. If you quote them, then a literal "." appears in the key. If they are unquoted, it makes a nested object. |
BetaWas this translation helpful?Give feedback.
All reactions
-
BetaWas this translation helpful?Give feedback.
All reactions
This discussion was converted from issue #172 on March 19, 2022 20:04.