Skip to content

Associated methods removed by conditional compilation are not dimmed #12394

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

Closed
rodrigocfd opened this issue May 26, 2022 · 3 comments · Fixed by #12965
Closed

Associated methods removed by conditional compilation are not dimmed #12394

rodrigocfd opened this issue May 26, 2022 · 3 comments · Fixed by #12965
Labels
A-diagnostics diagnostics / error reporting C-bug Category: bug E-easy

Comments

@rodrigocfd
Copy link

rust-analyzer version: 7e95c14 2022-05-17 stable

rustc version: 1.61.0 (fe5b13d68 2022-05-18)

relevant settings: Windows 10 x64, VSCode 1.67.2

Screenshot:

dimmed

@flodiebold flodiebold added E-easy C-bug Category: bug A-highlighting (semantic) token highlighting A-diagnostics diagnostics / error reporting and removed A-highlighting (semantic) token highlighting labels Jun 17, 2022
@kartva
Copy link
Contributor

kartva commented Aug 7, 2022

This seems to be a FIXME.

fn inactive_assoc_item() {
// FIXME these currently don't work, hence the *
check(
r#"
struct Foo;
impl Foo {
#[cfg(any())] pub fn f() {}
//*************************** weak: code is inactive due to #[cfg] directives
}
trait Bar {
#[cfg(any())] pub fn f() {}
//*************************** weak: code is inactive due to #[cfg] directives
}
"#,
);
}

@kartva
Copy link
Contributor

kartva commented Aug 7, 2022

List of cases where dimming doesn't work (i.e. basically everything that's not considered to be an "item" on its own)

image

@flodiebold
Copy link
Member

Yes, in general the problem here is passing through diagnostics from the collection step for these things. It's not really complicated, but it needs some plumbing.

@bors bors closed this as completed in dea1639 Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics diagnostics / error reporting C-bug Category: bug E-easy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants