question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[jade] Incorrect highlighting in strings with inline tags

See original GitHub issue

From @mrmlnc on January 4, 2016 12:54

VS Code version: 0.10.6

Code:

p #[code samp] — Regular text. #[samp This is sample text] more text.

Description: If you try to write a dot in a inline tag (tag Interpolation), text highlighting changes.

Gif: 2016-01-04_15-44-32

Copied from original issue: Microsoft/vscode#1765

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
msftrncscommented, Feb 8, 2019

This is an old issue, but PR #86 would fix this. The error occurs at:

@@scanNext: | Two text.\n|
  scanning for
   - -1: (\])
   - 63: (?<!\\)(#\[)
   - 35: ((?:mixin\s+)|\+)([\w-]+)
   - 68: (?<!\])(?=[\w.#])|(:\s*)
   - 33: (-|(([a-zA-Z0-9_]+)\s+=))
   - 59: (!?\=)\s*
   - 70: \[
   - 72: \[
   - 63: (?<!\\)(#\[)
   - 73: (?=<[^>]*>)
   - 75: (&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)
   - 76: [<>&]
   - 21: (?<!\\)[#!]\{(?=.*?\})
   - 23: (?<!\\)[#!]\{(?=[^}]*$)
  token: | |
      * text.jade
      * inline.jade
  pushing BeginEndRule#68 @ Jade.json:556 - (?<!\])(?=[\w.#])|(:\s*)

See how items 70 and 72 are the same? That is happening because a rule is getting skipped because its begin value is “” (empty), Item 72 is the first of its inner patterns, but because its blank begin rule is ignored, the other rules are not pushed away, and so the tag rule just keeps consuming the text (matching rule 68), until the end rule for the closing bracket is met.

The detail of two identical rules is what tipped me to look at the grammar closer, to catch the empty begin.

1reaction
mrmlnccommented, Nov 9, 2016

Hello, @alexandrudima and @aeschli,

I think we can close this issue? I tried to work with TextMate2 and there’s this grammar is working properly.

2016-11-09_13-18-03

I see that you started updating some grammar (https://github.com/Microsoft/vscode/commit/f1672e4de75b09f15e456ec126dc669c25ba5043, https://github.com/Microsoft/vscode/commit/fbdf234775f9af8a9f99f4af571364676b1d9770 and etc.).

Well, I think I’ll be contribute to one of the implementations of Jade grammar and try to solve all my problems. Later I’ll create the issue in VS Code repository with request to update Jade grammar.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[jade] Incorrect highlighting in strings with inline tags · Issue #22 ...
@aeschli, as I understand, this issue is related to the bug (feature) in vscode-textmate? I ask this because I can fix Jade tmLanguage...
Read more >
VS Code's Jade syntax highlighting is bad - pug - Stack Overflow
The syntax highlighting is bad with the comments due to this issue with the language grammar in VS Code. include , block ,...
Read more >
- Projects - Bountysource
Issues ; 1 likes. Wrong custom-elements highlighting paid out closed ; 0 likes. String-interpolation inside tag-interpolation fails to exit the tag-formatting ...
Read more >
Jade Template Syntax Documentation by Example
This interactive documentation illustrates the most important features of the Jade templating language. You can play around with the examples and watch the...
Read more >
Wrong syntax highlighting in TS/JS file with template strings in ...
The following construction is correctly starting the string, but not terminating it, and all the text after is written in red:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found