Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

language server roots don't search from cwd #264

Closed
nrdxp opened this issue Jun 14, 2021 · 1 comment
Closed

language server roots don't search from cwd #264

nrdxp opened this issue Jun 14, 2021 · 1 comment
Labels
C-bug Category: This is a bug R-duplicate Duplicated issue: please refer to the linked issue

Comments

@nrdxp
Copy link
Contributor

nrdxp commented Jun 14, 2021

I have noticed that the language server doesn't seem to search for the roots defined in the languages.toml file from the cwd of the shell. I've tried with rls and rust-analyzer, and both fail with the same issue. (log is from rust-analyzer attempt).

Reproduction steps

~/.config/helix/languages.toml:

[[language]]
name = "rust"
scope = "source.rust"
injection-regex = "rust"
file-types = ["rs"]
roots = ["Cargo.toml"]

language-server = { command = "rust-analyzer" }
indent = { tab-width = 4, unit = "    " }

I have an embedded rust program in an ops repo for work. If you cd into the pkgs/syncstat directory, enter the nix-shell and try to open a rust file with helix, the lsp fails to load, and the attached log specifies that it isn't searching for the Cargo.toml from the current directory, but from the git repositories root directory (two levels up).

For reference, the same workflow works fine with kakoune and kak-lsp

Environment

  • Platform: NixOS
  • Helix version: built from 1bda454 (latest at time of writing)
~/.cache/helix/helix.log
2021-06-14T12:32:21.958 helix_lsp::transport [ERROR] err <- [ERROR rust_analyzer] failed to find any projects in [AbsPathBuf("/home/nrd/git/github/input-output-hk/mantis-ops")]
@nrdxp nrdxp added the C-bug Category: This is a bug label Jun 14, 2021
@nrdxp
Copy link
Contributor Author

nrdxp commented Jun 14, 2021

duplicate of #256. Apologies

@nrdxp nrdxp closed this as completed Jun 14, 2021
@pickfire pickfire added the R-duplicate Duplicated issue: please refer to the linked issue label Jun 15, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-bug Category: This is a bug R-duplicate Duplicated issue: please refer to the linked issue
Projects
None yet
Development

No branches or pull requests

2 participants