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

Incomplete syntax highlighting for the union keyword. #399

Open
tomasz-rozanski opened this issue Jul 25, 2019 · 0 comments
Open

Incomplete syntax highlighting for the union keyword. #399

tomasz-rozanski opened this issue Jul 25, 2019 · 0 comments
Labels
A-syntax Area: Syntax highlighting

Comments

@tomasz-rozanski
Copy link

tomasz-rozanski commented Jul 25, 2019

Everything is working as intended, when using union as a struct, but as soon as you start to use it as variable name, or call a union() function on a set, the highlighting for the rest of the code, starts to go crazy.

Examples:

    // This is fine
    #[repr(C)]
    union MyUnion {
        f1: u32,
        f2: f32,
    }
    // If you create a variable called `union`, things starts to break down:
    let union: Vec<i32> = vec![1, 2, 3];
    assert_eq!(union, (1..=3).collect::<Vec<i32>>());
    use std::collections::HashSet;

    let mut a: HashSet<i32> = (0..4).collect();
    let mut b: HashSet<i32> = (4..8).collect();

    // But when you combine `union()` function with a print macro,
    // the results are more than weird ...
    for x in a.union(&b) {
        print!("{} ", x);
    }
    // ... and the rest of the code is highlighted like one big string literal.

Here's a screenshot to better illustrate the problem:

union_highlighting
Color theme is Cobalt

Sublime Text Version

Sublime Text 3.2.1 (Build 3207)

Rust Enhanced Version

2.20.00

Operating system

OS: Windows 10 Pro
Version: 10.0.18362 build 18362

@ehuss ehuss added the A-syntax Area: Syntax highlighting label Aug 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-syntax Area: Syntax highlighting
Projects
None yet
Development

No branches or pull requests

2 participants