Skip to content

Syntax highlighting bug - inside attributes, using macros and then brackets in strings breaks the highlighting #511

Description

@NeoGalaxy

Sublime Text Version

Sublime Text 4 (Build 4143)

Rust Enhanced Version

v2.25

Operating system

A good example is:
Os Name: Ubuntu 20.04.6 LTS
Gnome Version: 3.36.8

Expected behavior

In item attributes, syntax highlighting highlights strings correctly.

Actual behavior

In item attributes, if there's a macro call and then a string containing brackets, the string isn't highlighted as such and the rest of the code is highlighted as a string. Removing the macro call resolves everything and removing the brackets makes the rest of the code highlight normally (except the string in the attribute, which is not a big deal for me)

Steps to reproduce

Write the following function in your code, and look it in sublime text:

#[ensures(matches!(ret, None), "[]")]
pub fn foo(&mut self) -> Result<u32, u32> {
    todo!()
}

This occurred while using the crate contracts.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-syntaxArea: Syntax highlighting

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions