1

I am currently creating a language extension. When adding comments (starts with $$), I ran into a hurdle.

"comments":{
    "patterns": [{
        "name": "comment.line.sahutorepol",
        "match": "\\$\\$.*$\\n?"
    }]
},

Despite the regex matching and being escaped properly, there is no highlighting and the inspect tool confirms that its not properly detected.

image

I have tried placing the match key outside the patterns array, to no change.

Minek Po1
  • 142
  • 1
  • 9
  • The newline may not need to be double-escaped. And do you want to include it anyway? – Mark Jan 09 '22 at 19:34
  • Yes the newline is most likely not needed, but I added it (and the second backslash) just to be safe. – Minek Po1 Jan 10 '22 at 21:09
  • The second backslash may be incorrect and cause the regex to look for a literal `\` followed by a `n` which obviously is not what you want. Did you try it with just `\n` or no newline at all? – Mark Jan 10 '22 at 21:16
  • for some reason taking it out of the main include did the trick. – Minek Po1 Jan 13 '22 at 20:02
  • it was because of a difrenet tag being too greedy – Minek Po1 Jan 13 '22 at 20:09

0 Answers0