Skip to content

newlines in impl definition break syntax highlighting #493

Open
@fpdotmonkey

Description

@fpdotmonkey

Sublime Text Version

Build 4126

Rust Enhanced Version

v2.25.0

Operating system

OS Name Microsoft Windows 10 Home
Version 21H2 build 19044.1826

Expected behavior

For the following snippet, the trait name should be colored like normal text and the for keyword should colored like a keyword

impl ThisTraitHasAVeryLongNameWhichCausesTheEndOfTheStatementToGoToTheNextLineWithWrongHighlight
    for MyType
{
}

This may occur in cases where you implement e.g. TryFrom<U> where U is very templated or deep in some module structure.

Actual behavior

The trait name is highlighted like it's the type name and for is not highlighted like a keyword.

image

Steps to reproduce

  1. Copy the snippet into Sublime
  2. Observe errant highlighting

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