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

Workspace root and LSP root should be handled differently #3993

Closed
TotalKrill opened this issue Sep 27, 2022 · 3 comments · Fixed by #5748
Closed

Workspace root and LSP root should be handled differently #3993

TotalKrill opened this issue Sep 27, 2022 · 3 comments · Fixed by #5748
Labels
A-core Area: Helix core improvements A-language-server Area: Language server client C-enhancement Category: Improvements E-easy Call for participation: Experience needed to fix: Easy / not much E-good-first-issue Call for participation: Issues suitable for new contributors

Comments

@TotalKrill
Copy link
Contributor

In many larger projects, there are multiple languages working together, usually with some nice folder structure going on. Sometimes these are in separate git folders, and sometimes they are large monorepositories. Before #3929 this was achievable with a marker folder .helix/languages.toml that could specifiy a small projects Language Server (LS) on a directory basis. While the Helix root was specified as the correct path.

After the change, now the root for the helix editor and the LS are the same, creating issues with folder structure like this:

- workspace root 
   - native rust-project
      - Cargo.toml
   - wasm rust project
      - Cargo.toml
   - dockerfile-project
   - .git folder

In these cases if opening helix in one of the rust projects folders, the root will be workspace root, initiating the LSP where there are no Cargo.toml file and thus the LS will fail. Creating a Cargo.toml workspace could have been a solution, but in that case, the different targets like wasm/native can start to mess things up, and cargo workspaces does not handle this.

Enabling the LSP to define where it is started by a marker folder as before would help.

related isses that probably would be solved by allowing this:

@TotalKrill TotalKrill added the C-enhancement Category: Improvements label Sep 27, 2022
@TotalKrill TotalKrill changed the title Workspace root and LSP root should be separate entities. Workspace root and LSP root should be handled separatly Sep 27, 2022
@TotalKrill TotalKrill changed the title Workspace root and LSP root should be handled separatly Workspace root and LSP root should be handled different Sep 27, 2022
@TotalKrill TotalKrill changed the title Workspace root and LSP root should be handled different Workspace root and LSP root should be handled differently Sep 27, 2022
@kirawi kirawi added A-core Area: Helix core improvements A-language-server Area: Language server client labels Sep 27, 2022
@kirawi
Copy link
Member

kirawi commented Sep 29, 2022

As mentioned in Matrix, adding a root-override field to the languages.toml could be a solution.

@kirawi kirawi added E-easy Call for participation: Experience needed to fix: Easy / not much E-good-first-issue Call for participation: Issues suitable for new contributors labels Sep 29, 2022
@ath3
Copy link
Contributor

ath3 commented Oct 1, 2022

If understand the problem correctly, pr #3553 should fix this issue.

@the-mikedavis
Copy link
Member

Cases where this wasn't already fixed by #3553 should be fixed by #4439

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-core Area: Helix core improvements A-language-server Area: Language server client C-enhancement Category: Improvements E-easy Call for participation: Experience needed to fix: Easy / not much E-good-first-issue Call for participation: Issues suitable for new contributors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants