Open ayesaac opened 4 years ago
I have had this problem many times, it has been around for a while now. In my experience rust-analyzer does not have this problem and that seems to be the language server that is being actively developed. If you're using RLS with this extension try switching to rust-analyzer, either as this extension's back-end or by using its own VS Code extension. I think rust-analyzer is eventually going to be RLS 2.0 but it is already the easier-to-use and, frankly, just plain better IDE experience.
I only use this because I use an alternative grammar (dustypomerleau.rust-syntax) that requires this extension. Using this extension with rust-analyzer required manually installing a binary, which is another problem that has persisted for months. That's why I recommend using the other extension. Despite this and RLS being the de jure defaults rust-analyzer seems to have eclipsed them.
@JKAnderson409 note that the dustypomerleau.rust-syntax
syntax was merged into rust-analyzer
recently.
@JKAnderson409 note that the
dustypomerleau.rust-syntax
syntax was merged intorust-analyzer
recently.
Yeah that was good news. I actually asked dustypomerleau to try to have it merged on the same day that I made that other comment. It's made it easier to use the nightly releases of rust-analyzer because I don't need to overwrite the grammar every day. The rust-analyzer extension is now my only Rust extension.
I'm grateful that @dustypomerleau put in the effort to go through the review process so that the rust-analyzer extension can ship with a great TextMate grammar.
I'm new to Rust, so it's entirely possible I'm missing something obvious here, but I've run into a weird scenario where the VS Code extension (I've disabled every other extension) is reporting problems which don't exist.
I've written a macro that allows me to annotate types with an identifier, and build an enum containing variants for each of those types, as well as a 'type enumeration' enum which is identical, but without any associated data on the variants. It builds A-OK with no complaints—
cargo build
works.However, the Rust extension in VS Code reports four errors (E0428):
The actual code in question is:
cargo expand
outputs:Given the expansion is correct (and the crate builds and produces the expected outputs when wrapping & unwrapping messages), I'm not sure whether the macro code has much relevance, but just incase, here it is. Be forewarned, it's quick, dirty, unfinished, and my first attempt at writing a macro (without having done enough reading beforehand, frankly).
VS Code is up to date, the Rust extension is up to date, and my Win 10 installation is up to date. As I can build, it's not the end of the world, but it would be nice to not have those errors in the problem panel; if it's a problem with my code, and not the extension, my apologies.