lapce-python icon indicating copy to clipboard operation
lapce-python copied to clipboard

configure lsp

Open dholth opened this issue 3 years ago • 7 comments

# 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.

dholth avatar Jul 28 '22 17:07 dholth

.. issue raised with pylsp.

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

superlou avatar Jul 29 '22 00:07 superlou

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

dholth avatar Jul 29 '22 00:07 dholth

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",
...

dholth avatar Jul 29 '22 21:07 dholth

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.

NicolasTriquenaux avatar Nov 19 '22 22:11 NicolasTriquenaux

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.

superlou avatar Nov 19 '22 22:11 superlou

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

NicolasTriquenaux avatar Nov 19 '22 22:11 NicolasTriquenaux

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

debajyoti1990 avatar Mar 04 '23 05:03 debajyoti1990