Skip to content

Problem with end rules matching on end line #17

Closed

Description

With Jade there's a problem with empty lines. See microsoft/vscode#4287.

Problem is the following example:

.ssdsd

    // asdsdas

The comment is not correctly highlighted.

It looks like the engine enters the following rule for empty lines, but doesn't exit
{
"begin": "^\s*",
"comment": "All constructs that generally span a single line starting with any number of white-spaces.",
"end": "$",
"patterns": [
....
}

===========================================
TOKENIZING LINE 1
.ssdsd

  LINE CONTAINS 1 TOKENS:
    => TOKEN (0-7): 
      .ssdsd
      * text.jade

  LINE END RULE STACK CONTAINS 1 RULES:
      * [1,1] IncludeOnlyRule "text.jade", entered @-1


===========================================
TOKENIZING LINE 2


  LINE CONTAINS 1 TOKENS:
    => TOKEN (0-1): 

      * text.jade

  LINE END RULE STACK CONTAINS 2 RULES:
      * [100,2] BeginEndRule "null", entered @0
      * [1,1] IncludeOnlyRule "text.jade", entered @-1


===========================================
TOKENIZING LINE 3
    // asdsdas

  LINE CONTAINS 2 TOKENS:
    => TOKEN (0-7): 
          // 
      * text.jade
    => TOKEN (7-14): 
      asdsdas
      * text.jade
      * meta.tag.other entity.name.tag.jade

  LINE END RULE STACK CONTAINS 1 RULES:
      * [1,1] IncludeOnlyRule "text.jade", entered @-1

Activity

  1. added
    bug
    on Aug 9, 2016
  2. added a commit that references this issue on Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions