Skip to content

Pyls settings.json #448

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

Closed
DerWeh opened this issue May 25, 2018 · 7 comments
Closed

Pyls settings.json #448

DerWeh opened this issue May 25, 2018 · 7 comments

Comments

@DerWeh
Copy link

DerWeh commented May 25, 2018

I am no sure weather to ask the question here or at Python-language-server.

I am trying to configure the language server, so I made a folder .vim and but a file settings.json with the content:

"pyls": {
  "plugins": {
    "pydocstyle": {
      "enabled": true
    }
  }
}

This seems not to work. The only reference i have is for vscode.

The question is now, how I have to write the json file, that pyls accepts it. Is there a way to check, if the client detected the file properly?

@RobertBuhren
Copy link

I have the same problem with the rust language server. There seems to be large delay before rls detects a code change, so I wanted to change the "wait_to_build" value. The issue is that I can't verify whether rls actually accepted my settings.josn file.

@languitar
Copy link

languitar commented May 28, 2018

@DerWeh your json file is syntactically broken. It needs opening and closing curly braces. This is what I use:

{
    "pyls": {
        "plugins": {
            "pyflakes": {
                "enabled": true
            },
            "pydocstyle": {
                "enabled": true
            }
        }
    }
}

If you configure pyls to start with -vv you can observe whether it accepts the settings in the debug output sent to /tmp/LanguageServer.log.

@autozimu
Copy link
Owner

I believe @languitar's comment should have answered the original question.

In VSCode, the settings are using condensed structure. When those settings are passed to language servers, they're expanded by splitting with ..

And this is an example of send settings to rust language server, https://github.com/autozimu/LanguageClient-neovim/blob/next/.vim/settings.json

@languitar
Copy link

languitar commented May 30, 2018

@autozimu btw, do you think it is wise to have a single default settings file configured in .vim? I have to change the language server configuration from project to project by settings something like let g:LanguageClient_settingsPath = 'ls-settings.json' (so relative to the project root).

@autozimu
Copy link
Owner

Are you talking about the same thing as in #431?

@languitar
Copy link

Ah yes. Thanks. I'll follow that issue.

@gdraps
Copy link

gdraps commented May 10, 2019

Not sure whether pyls has changed since previous comments, but here's the .vim/settings.json format that work for configuring with pyls.__version__ '0.26.1' and LanguageClient-neovim git hash 6ee4c89.

{
    "pyls.plugins.pyflakes.enabled": false,
    "pyls.plugins.pydocstyle.enabled": false,
    "pyls.plugins.rope.enabled": true,
    "pyls.plugins.pycodestyle.enabled": false,
    "pyls.plugins.mccabe.enabled": false,
    "pyls.plugins.autopep8.enabled": false,
    "pyls.plugins.papf.enabled": false
}

To verify, started pyls with:

let g:LanguageClient_serverCommands = {
    \ 'python': ['pyls', '-vv', '--log-file', '~/pyls.log'],
    \ }

And grep log:

> grep "Updated sett" pyls.log
2019-05-10 06:39:23,337 UTC - INFO - pyls.config.config - Updated settings to {'plugins': {'autopep8': {'enabled': False},...

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

5 participants