Add support for developing with rust-analyzer#343
Merged
Conversation
Signed-off-by: Nick Spinale <nick@nickspinale.com>
Signed-off-by: Nick Spinale <nick@nickspinale.com>
Signed-off-by: Nick Spinale <nick@nickspinale.com>
Signed-off-by: Nick Spinale <nick@nickspinale.com>
Signed-off-by: Nick Spinale <nick@nickspinale.com>
Signed-off-by: Nick Spinale <nick@nickspinale.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before this PR, this project only supported developing with rust-analyzer in the
./hackingworkspace, which only contains development tools. This PR adds the configuration, tools, and scripts necessary to enable leveraging rust-analyzer for development on the rest of the crates in this project.This PR just adds support for rust-analyzer via VSCode, but the approach taken could be retargeted to other editor environments.
The challenge has always been that some of the crates in this project target the development system and require
libstd, whereas others target seL4 userspace and require an active seL4 configuration. The solution in this PR is to add a script that wraps rust-analyzer, supplying it with some Cargo configuration (e.g. pointing to an active seL4 configuration) and limiting it to a subset of the crates in the project..vscode/settings.jsonpoints VSCode to this wrapper.When opening this project in VSCode, a default configuration is chosen, without any additional Cargo configuration, and limited to the subset of crates that can be compiled without a seL4 configuration.
The
create-vscode-workspacetool can be used to generate a*.code-workspacefile that, when opened in VSCode, will run rust-analyzer with the given config and crate subset. For example:Future PRs with stabilize, improve usability, add docs, and check in some workspace files.