Add cargo xtask rust-analyzer#2524
Conversation
ab273d9 to
b937c30
Compare
| !.vscode/launch.json | ||
| !.vscode/tasks.json | ||
| !.vscode/extensions.json | ||
| .nvim.lua |
There was a problem hiding this comment.
| .nvim.lua | |
| .nvim.lua | |
| .zed/settings.json |
|
This definitely works better for me in Zed, there are still some hiccups, I'll try to enumerate them a bit better once I've gotten a better chance to take this for a spin. Looking at the logs, I see some weirdness: https://gist.github.com/jamesmunns/59c51489e6e62676bef118514a3fddbf Some of this is attempting to build crates that aren't relevant for cosmo+control_plane_agent, e.g. task-attest. There are some recurring errors that seem odd to me, like: And also: That all being said, I am able to use rust-analyzer in the For context, this is my current // Folder-specific settings
//
// For a full list of overridable settings, and general information on folder-specific settings,
// see the documentation: https://zed.dev/docs/configuring-zed#settings-files
{
"lsp": {
// Specify the LSP name as a key here.
"rust-analyzer": {
// // A special flag for rust-analyzer integration, to use server-provided tasks
// enable_lsp_tasks": true,
"binary": {
"path": "cargo",
"arguments": [
"run",
"-pxtask",
"--",
"rust-analyzer",
"--log",
"./target/xtask-ra.log",
"./app/cosmo/rev-b-dev.toml:control_plane_agent",
],
},
// These initialization options are merged into Zed's defaults
"initialization_options": {
"check": {
"command": "clippy", // rust-analyzer.check.command (default: "check")
},
"cargo": {
"targetDir": "target",
},
},
},
},
} |
jamesmunns
left a comment
There was a problem hiding this comment.
Happy to do a follow-on PR to document setting up Zed as well.
|
I pushed a fix to set |
This PR adds
cargo xtask rust-analyzer, which pointsrust-analyzerat a particular(manifest, task)tuple (set by a CLI argument). It can be used as a drop-in replacement in your editor, to get LSP goodness within the Hubris build system.