Skip to content

LSP: Support Workspace folders #89

@dhruvmanila

Description

@dhruvmanila

astral-sh/ruff#13041 restricts the red knot server to only work when there's only one workspace opened in the editor. We should add support for multi-root workspaces.

The challenge here is that which workspace should the untitled / non-workspace files belong to.

Currently, we've made an assumption that any untitled files or non-workspace files are part of the only available workspace. When multi-root workspaces are supported, we need to make sure the user experience is still good and find a way to provide intellisense for non-workspace / untitled files when there are multiple workspaces.

One solution is to implement an ad-hoc database where these files would go but this limits the user experience because we won't be able to resolve the virtual environment for a workspace thus not able to provide any intellisense features for third-party libraries.

The implementation should also consider the fact that workspaces can be added / removed while the server is active. This is supported currently in the Ruff native server and is done via the didChangeWorkspaceFolders notification.

Metadata

Metadata

Assignees

Labels

serverRelated to the LSP server

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions