Skip to content

Workspace gets overwritten if workspaceFolders returns non-empty, breaking 'find by' features #166

@Ruin0x11

Description

@Ruin0x11

I'm using Emacs as an LSP client. It happens to report both a root URI on initialize and a non-empty list of workspace folders.

What ends up happening is the workspace that's created in the server by the initialize callback is overwritten by the one created in the workspaceFolders callback. When commands like find definition are used, the wrong workspace gets used and nothing will be found.

Here is the first assignment:

https://github.com/sumneko/lua-language-server/blob/da43d801df94ed8dce217499afb83aedb1ed24d5/script/method/initialize.lua#L18-L25

And here is where it gets overwritten:

https://github.com/sumneko/lua-language-server/blob/da43d801df94ed8dce217499afb83aedb1ed24d5/script/method/initialized.lua#L4-L9

Based on the code it seems like there's only support for a single global workspace. Is this intentional, or will there be support for redirecting the LSP commands to multiple workspaces based on the current document?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions