rust-analyzer icon indicating copy to clipboard operation
rust-analyzer copied to clipboard

Extend `TargetSpec` functionality to rust-project.json

Open davidbarsky opened this issue 1 year ago • 5 comments

Resolves https://github.com/rust-lang/rust-analyzer/issues/15892.

This PR, as structured, adds runnable support to rust-project.json-based workspaces, and that works pretty nicely. It's not as polished as I'd like it to be (namely: interpolation of test_id feels a bit janky and undocumented, the), but I'm opening this PR as a draft for general direction/feedback.

I think that this approach can also make https://github.com/rust-lang/rust-analyzer/pull/15476 unnecessary by adding a flycheck_command to rust-project.json while also extending similar functionality to Cargo only build the impacted crate.

davidbarsky avatar Dec 15 '23 23:12 davidbarsky

:umbrella: The latest upstream changes (presumably #16066) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar Dec 20 '23 14:12 bors

Overall implementation wise it looks good to me, al though I am still a bit on the fence wrt to having flycheck be in here. I am personally still of the opinion that flycheck should not be a direct part of r-a (but a separate extension altogether). Adding it to this file makes that less clear of a separation.

I guess whether the format has that or not makes little difference, the command itself is heavily tied into the rest of the specification here whether it is supported by a separate extension or r-a.

Veykril avatar Jan 12 '24 09:01 Veykril

Overall implementation wise it looks good to me, al though I am still a bit on the fence wrt to having flycheck be in here. I am personally still of the opinion that flycheck should not be a direct part of r-a (but a separate extension altogether). Adding it to this file makes that less clear of a separation.

I guess whether the format has that or not makes little difference, the command itself is heavily tied into the rest of the specification here whether it is supported by a separate extension or r-a.

While I agree with you that flycheck is a hack, I've found myself of the opinion that rust-analyzer (and specifically, its users who are not interested/aware of the need to install a build system-specific extension) can likely get a ridiculous amount of mileage through a templates commands and a promise from build systems to place rustc diagnostics in a deterministic location (like, say, stdout).

And yeah, I think the command's specification is largely immaterial to where it runs, or at the very least, it's not a binding commitment in one direction or another.

davidbarsky avatar Jan 12 '24 20:01 davidbarsky

:umbrella: The latest upstream changes (presumably #16398) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar Jan 19 '24 09:01 bors

:umbrella: The latest upstream changes (presumably #16612) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar Feb 20 '24 10:02 bors

:umbrella: The latest upstream changes (presumably #16845) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar Mar 15 '24 13:03 bors

:umbrella: The latest upstream changes (presumably #16971) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar Mar 29 '24 02:03 bors

:umbrella: The latest upstream changes (presumably #16970) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar Apr 01 '24 10:04 bors