-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
VSCode setting to specify path to Cargo.toml #2649
Comments
If I understand correctly, there is still no way to do that: see #2533 |
Yeah, there's no such setting (yet), it should be not that hard to add. |
@matklad do you know if this is on the roadmap? I can try to implement it if not (and if it happens to be simple). Sadly this is what keeps our team from using rust-analyzer! |
Sure, a PR would be welcome! Here's the current code for determining the set of projects to analyze: |
Fixed in today's release: {
"rust-analyzer.linkedProjects": [
"/home/matklad/tmp/hello/Cargo.toml"
]
} (you can link more than one project) |
How to achieve the same thing in Emacs? Other than using |
@azzamsa tbh, I don't know how to pass settings to lang servers via lsp mode. I guess it should be documented somewhere here: https://emacs-lsp.github.io/lsp-mode/. A PR to rust-analyzer's manual clarifying this would help! |
There are specific emacs defcustoms for most settings. Probably not for |
Is this problem solved? I don't know how to specify the root of a non-standard cargo project in emacs. |
You should be able to use |
I tested the lsp-rust-analyzer-linked-projects config in my emacs config file, and it works. But it seems that I only can set a fixed path in the emacs config file. So if I open another rust project I need to change the emacs config file, which is strange. Is there any way to automate set the path of the cargo.toml? |
That's why you should set it in |
Thanks @flodiebold . I'll try it. |
How to specify this in emacs? The above comments mentioned |
Sometimes
Cargo.toml
is not in the workspace root, instead, inside some sub-directory.Since the project contains non-rust code, it is not good idea to always create
Cargo.toml
workspace file in the root.Is there any way to specify the directory or path to
Cargo.toml
processed by rust-analyzer?The text was updated successfully, but these errors were encountered: