python-lsp / pylsp-mypy

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

Fix wrong configuration being used with multiple workspace folders #13

Closed rchl closed 3 years ago

rchl commented 3 years ago

When a workspace has multiple folders then the approach of using one global variable to store the config breaks down as each workspace folder can have separate configuration and the last one that gets initialized overwrites the previous one.

Store configuration in a map looked up by workspace folder path.

Richardk2n commented 3 years ago

Just to make sure I understand this correctly: There is a config file per workspace (as in pylsp workspace or project folder) Now if you would want to lint in multiple workspaces at the same time using one instance of mypy-ls this would not work correctly? In what usecase does this happen?

rchl commented 3 years ago

When you have multiple root folders in the editor then, as long as the client (editor) supports the workspaceFolders capability, those are handled as separate workspaces within a single pylsp instance.

The use case is: