Windows-rs: VSCode

Created on 24 Jan 2021  ·  2Comments  ·  Source: microsoft/windows-rs

i don't know if it's the good repo to report this but windows-rs is unusable on vscode with rust-analyzer extension, at least auto-completion isn't available, and

mod bindings {
    ::windows::include_bindings!();
}

throw "could not resolve macro self::include"
and if you use the rust extension, the whole Cargo.html become red while it say that it fail to run build command

question

Most helpful comment

I'm pretty sure you need to do the following to get it to work:
1.) You need to have a "bindings" sub-crate. (examples: https://github.com/kennykerr/samples-rs)
2.) You need to enable “Cargo: Load Out Dirs From Check” in the rust-analyzer settings.

All 2 comments

I'm pretty sure you need to do the following to get it to work:
1.) You need to have a "bindings" sub-crate. (examples: https://github.com/kennykerr/samples-rs)
2.) You need to enable “Cargo: Load Out Dirs From Check” in the rust-analyzer settings.

Yes, rust-analyzer is your best bet even as it has a few limitations and struggles with the sheer volume of code. We are investing in rust-analyzer so I am hopeful that it will improve in time. Give @Josh015's suggestions a try, but any feedback about rust-analyzer should probably go here: https://github.com/rust-analyzer/rust-analyzer/issues

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Zymlex picture Zymlex  ·  3Comments

bdbai picture bdbai  ·  3Comments

joverwey picture joverwey  ·  3Comments

rylev picture rylev  ·  4Comments

kennykerr picture kennykerr  ·  5Comments