Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure lsp #6

Open
dholth opened this issue Jul 28, 2022 · 7 comments
Open

configure lsp #6

dholth opened this issue Jul 28, 2022 · 7 comments

Comments

@dholth
Copy link
Collaborator

dholth commented Jul 28, 2022

# Options passed to the LSP server
"pylsp.plugins.autopep8.enabled" = false
"pylsp.plugins.yapf.enabled" = false
"pylsp.plugins.mccabe_lint.enabled" = false

Passes expected structures into the pylsp initialization, but unclear how / if pylsp is interpreting those values (or if it requires a configuration change message), from reading through pylsp's -vv double-verbose logs... issue raised with pylsp.

FYI python-lsp-black adds that formatter to pylsp, which was the initial thing I wanted to configure. Disabling format-on-save in the normal lapce settings is another way to avoid undesired formatters.

@superlou
Copy link
Owner

.. issue raised with pylsp.

I'm not sure I follow, sorry. Is the behavior an issue with pylsp or with the plugin/lapce?

@dholth
Copy link
Collaborator Author

dholth commented Jul 29, 2022

Was hoping you'd figured out how to configure pylsp through this plugin's configuration file.

@dholth
Copy link
Collaborator Author

dholth commented Jul 29, 2022

It's something like this in lapce-python/plugin.toml. The dotted names in toml expand to expected nested structures on init. Hard to tell if the parameters are having an effect.

[configuration.options.settings]
pylsp.plugins.autopep.enabled = false

The language server probably expects a workspace/didChangeConfiguration message instead of (only) the initializationOptions message supported by lapce.

Sending notification 'workspace/didChangeConfiguration'.
Params: {
    "settings": {
        "python": {
            "autoComplete": {
                "extraPaths": []
            },
            "envFile": "${workspaceFolder}/.env",
...

@NicolasTriquenaux
Copy link

NicolasTriquenaux commented Nov 19, 2022

Seems indeed that no lsp parameters specified in the plugin toml under [configuration.options] has an effect. I disabled all linting capabilities and i still have linting warning displayed.

extract from the the plugin volt.toml (i hope it was that file to edit, otherwise my bad, and i would very much know were to add these informations)

[configuration.options]
pylsp.plugins.autopep8.enabled=false
pylsp.plugins.flake8.enabled=false
pylsp.plugins.yapf.enabled=false
pylsp.plugins.black.enabled=false
pylsp.plugins.pylint.enabled=false
pylsp.plugins.pyflakes.enabled=false
pylsp.plugins.pycodestyle.enabled=false
pylsp.plugins.mccabe.enabled=false
pylsp.plugins.jedi_hover.enabled=false
pylsp.plugins.jedi_references.enabled=false
pylsp.plugins.jedi_signature_help.enabled=false

Here the list of lsp params i have set and none was taken into account.

@superlou
Copy link
Owner

Unfortunately I think that came out when moving to the Volt plugin API. It might be a bit until I get a chance to look into it, but I'm open to PRs.

@NicolasTriquenaux
Copy link

should it not be solved when the PSP branch is merged ?

@debajyoti1990
Copy link

debajyoti1990 commented Mar 4, 2023

With lapce 0.2.6 only autocompletion suggestion is working. There are no docstring popup, no warning etc although I have all installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants