Skip to content

Support multi-root workspaces in Red Knot server #13052

Open
@dhruvmanila

Description

#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

Assignees

No one assigned

    Labels

    red-knotMulti-file analysis & type inferenceserverRelated to the LSP server

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions