python-lsp / pylsp-mypy

Mypy plugin for the Python LSP Server.
MIT License
127 stars 35 forks source link

Configuration key out of sync #7

Closed rchl closed 3 years ago

rchl commented 3 years ago

It looks like to enable/disable mypy_ls plugin one needs to use this option:

pylsp.plugins.mypy_ls.enabled

while to toggle mypy_ls options one needs to use those:

pylsp.plugins.mypy-ls.live_mode
pylsp.plugins.mypy-ls.strict

Notice how the former uses underscore in mypy_ls while latter uses a dash.

This should be unified. Ideally to use underscore everywhere.

dmitrig commented 3 years ago

pylsp.plugins.mypy-ls.live_mode isn't even working for me. I'm seeing:

INFO - pylsp.config.config - Updated settings to {'plugins': {'mypy-ls': {'enabled': True, 'live_mode': None}, ...
...
DEBUG - pylsp.config.config - With configuration: { ... 'plugins': {'mypy-ls': {'enabled': True}, ...

and then live mode is stil on. Switching to the underscored key (in both plugin.py and my config) seems to do the right thing.

rchl commented 3 years ago

You've set live_mode to None so it would fall-back to default True then.

Try with "live_mode": false.

Also, maybe first try to verify whether "mypy-ls.enabled" or "mypy_ls.enabled" works for you. The effects of that are easier to see. The one with the underscore should be the only one working, from my testing.

Richardk2n commented 3 years ago

Could you tell me how you are running that, in order for me to test that properly.

Changing the naming might break config files? but, I'll look into it.

I am not too sure how the pls works (still haven't figured out where configs are supposed to be placed), but the it's probably due to the fact that the enabled is handled by pls while the other options are handled by my code. If this is correct I could unify this.

rchl commented 3 years ago

I'm running the Python Language Server in Sublime Text through the https://packagecontrol.io/packages/LSP-pylsp package.

The settings object here is what is passed to the pylsp: https://github.com/sublimelsp/LSP-pylsp/blob/master/LSP-pylsp.sublime-settings