Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rust analyzer not highlighting conditional complication branches if cfg is given by build.rs #16244

Closed
publicqi opened this issue Jan 4, 2024 · 2 comments
Labels
A-cargo cargo related issues C-bug Category: bug

Comments

@publicqi
Copy link

publicqi commented Jan 4, 2024

rust-analyzer version: 0.3.1791-standalone (9db5155 2024-01-01)

rustc version: rustc 1.76.0-nightly (87e1447aa 2023-11-30)

relevant settings: N/A

image

As shown in the screenshot, build.rs will output cargo:rustc-cfg=feature="foo", which will set the feature of foo. Therefore, line 2 and 3 should be highlighted.

@publicqi publicqi added the C-bug Category: bug label Jan 4, 2024
@Veykril
Copy link
Member

Veykril commented Jan 4, 2024

You need to restart the server currently or issue a proc-macro rebuild for changes in the build script to take effect. It works for me then.

@Veykril Veykril added the A-cargo cargo related issues label Jan 4, 2024
@Veykril
Copy link
Member

Veykril commented Jan 4, 2024

#16247 should help out here, this case shouldnt need server restarting afterwards

@Veykril Veykril closed this as completed Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cargo cargo related issues C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants