Skip to content
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

Support for Wrokspace Folders + embedded projects #178

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

kkrime
Copy link

@kkrime kkrime commented Jan 7, 2025

No description provided.

mrcjkb and others added 2 commits January 2, 2025 07:53
Some LSP clients can have more than one workspace folder, which
can be added via
[`workspace/didChangeWorkspaceFolders`](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_didChangeWorkspaceFolders).

This is especially useful for resource-hungry clients, like
rust-analyzer or haskell-language-server, in order to avoid spawning
multiple clients.

Using `lsp.Client.config.root_dir` as the source of truth results
in this plugin detecting the wrong project root in this scenario.

This PR fixes that, by first searching through the
`lsp.Client.workspace_folder`s,
and then falling back to the `config.root_dir` if no matching
workspace folder is found.
describe('M._get_buf_root()):', function()
it("testing M._get_buf_root() returns correct buf_root for embedded projects", function()
local outter_project = "/Users/kkrime/outter_project"
local inner_project = "/Users/kkrime/outter_project/inner_project"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unsure if it really matters, but it seems some more universal paths like /tmp/outer_project could work better

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It really doesn't make any difference, you can change it you feel strongly about it, no problem with me

@kkrime kkrime force-pushed the corner_case_embedded_projects branch from 72c6c5b to c11869a Compare January 8, 2025 01:18
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.

3 participants