Skip to content

Fix wrong configuration being used with multiple workspace folders #13

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

Merged
merged 2 commits into from
Jul 3, 2021

Conversation

rchl
Copy link

@rchl rchl commented Jul 1, 2021

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.

When a workspace has multiple folders then the approach of using
one global variable to store the config breaks down as each workspace
folders 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.
@rchl rchl force-pushed the fix/workspace-configs branch from 3d747fe to 66d9b90 Compare July 2, 2021 21:12
@Richardk2n
Copy link
Member

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
Copy link
Author

rchl commented Jul 3, 2021

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:

  • multiple root folders (workspaces) in the editor
  • each folder having its own mypy.ini configuration file
  • linting files within each folder should use respective mypy configuration file

@Richardk2n Richardk2n merged commit 7d9714e into python-lsp:master Jul 3, 2021
@rchl rchl deleted the fix/workspace-configs branch July 3, 2021 11:47
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

Successfully merging this pull request may close these issues.

2 participants