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

Macro import with same name as private module uses module syntax highlighting #19421

Open
SyntaxHighlightingFiend opened this issue Mar 22, 2025 · 0 comments
Labels
A-highlighting (semantic) token highlighting C-bug Category: bug

Comments

@SyntaxHighlightingFiend

Concrete case: When importing the ensure macro from anyhow, the syntax highlighting of the ensure token at the use declaration will be that of a module instead of a macro.

A module ensure does exist in anyhow, but it's private and cannot be imported, so this should be unambiguous.

rust-analyzer version: 0.3.2345-standalone (b0632f7 2025-03-16)

rustc version: rustc 1.85.0 (4d91de4e4 2025-02-17)

editor or extension: VSCode, extension version 0.3.2345

code snippet to reproduce:

use anyhow::ensure;

fn main() -> anyhow::Result<()> {
    ensure!(1 > 0, "oops");
    Ok(())
}
@SyntaxHighlightingFiend SyntaxHighlightingFiend added the C-bug Category: bug label Mar 22, 2025
@ShoyuVanilla ShoyuVanilla added the A-highlighting (semantic) token highlighting label Mar 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-highlighting (semantic) token highlighting C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants