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

Broken syntax highlighting after any local macro #6794

Closed
grunweg opened this issue Dec 10, 2020 · 4 comments
Closed

Broken syntax highlighting after any local macro #6794

grunweg opened this issue Dec 10, 2020 · 4 comments

Comments

@grunweg
Copy link

grunweg commented Dec 10, 2020

Follow-up to #6793. This is probably a duplicate of #1559; feel free to close in that case.
(Filing this also so I can reference this bug with the itertools crate.)

After any occurrence of the itertools::iproduct! macro, there is no more syntax highlighting for remainder of the file.
Tested with the 2020-12-07 release, but probably happens on any version after be50908.

Example code

// add itertools="0.9.0" to the Cargo.toml file
// main.rs has this
use itertools::iproduct;
fn main() {
    let t = ["toast", "bread"];
    for (a, b) in itertools::iproduct!(t.iter(), t.iter()) {
        println!("{}, {}", a, b);
    }
}

Expected
Syntax highlighting works normally for the whole file.

Actual
No syntax highlighting after line 3.

Thanks for your time!

@grunweg grunweg changed the title Broken syntax highlighting after any macro Broken syntax highlighting after any local macro Dec 10, 2020
@grunweg
Copy link
Author

grunweg commented Dec 10, 2020

Never mind; I figured out how to resolve this myself: replacing the call to itertools::iproduct! by iproduct! restores syntax highlighting.

@grunweg grunweg closed this as completed Dec 10, 2020
@lnicola
Copy link
Member

lnicola commented Dec 10, 2020

I can't reproduce this on master:

image

Do you have any errors in Atom LSP logs? Does Atom even support semantic highlighting? If not, it's probably an Atom issue.

@grunweg
Copy link
Author

grunweg commented Dec 10, 2020

How do I enable Atom LSP logs?

@lnicola
Copy link
Member

lnicola commented Dec 10, 2020

No idea, I couldn't find much on Google. VS Code has a panel called Output. Does it still happen if you disable rust-analyzer?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants