-
Notifications
You must be signed in to change notification settings - Fork 123
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
Accommodate VSCode users with the rust-analyzer extension #846
Conversation
Do we need to do anything else for releases? |
What if we use the cargo workspace function instead of a symlink? There is a discussion here: rust-lang/rust-analyzer#6007 (comment) |
I think that with the workspace that José suggested, we would need to create a symlink for the BTW, I tested the workspace config with the following: [workspace]
resolver = "2"
members = [
"native/*"
]
[patch.crates-io]
jsonpath_lib = { version = "0.3", git = "https://github.com/ritchie46/jsonpath", branch = "improve_compiled" } |
@josevalim @philss I tried the EDIT at the top of the Jose's linked comment and it just worked lol. (I swear I looked for such a setting but couldn't find one 😅) The workspace thing may not be necessary if the |
@billylanchantin nice! I prefer this way! :D PS: maybe you need to change your editor config to add newlines at the end of the JSON files. Our .editorconfig file is configured to add new lines. Not sure why your VS Code is not reading that (maybe it needs an extension?). |
@philss Yep, that was it! I added an extension and VSCode started adding newlines correctly. To cement that, I've added an |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
I am not the biggest fan of adding editor specific configuration files. Isn't there a general configuration we could use that would work for many editors, such further modifications to editor config? |
@josevalim yeah I feel ya. If you have N editors on your team, suddenly you've got N config files floating around. I see two things we can do:
I can do the Then I/we can take another stab at the workspace approach. That would possibly obviate the need for |
This works for me:
Do we want that instead? |
We may be able to configure the build directory and skip the symlinks: https://stackoverflow.com/questions/50364390/how-can-i-specify-a-custom-cargo-output-directory But perhaps we could move both Cargo.toml and Cargo.lock to the root directory and just keep the source directly inside "native" or inside "src". |
Add support for VSCode developers with this extension:
It's the primary LSP implementation for Rust (so far as I can tell). It gives me hover hits, etc. This PR makes it work without having to change directories: