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.

Raw string coloring buggy

See original GitHub issue

Hi, the way how the syntax coloring of raw strings work is not correct. If you look at the reference you will see that there is a flexible amount of # delimiters that can be used. E.g. let foo = r##" "# "##; is a valid raw string. To correct the current Textmate grammar, you can replace the current rust_raw_string rule with this one:

<key>rust_raw_string</key>
<dict>
    <key>begin</key>
    <string>r(#*)"</string>
    <key>end</key>
    <string>"(\1)</string>
    <key>name</key>
    <string>string.quoted.other.raw.rust</string>
</dict>

It seems the rule also has to be move above the rust_string rule to have higher precedence. I don’t know where you got the grammar from and if you want yours to diverge from the original. If not this issue maybe should be opened for the originating project. EDIT: The rust_raw_string rule already is above rust_string, I guess I played around too much with the grammar, before landing on a version that worked.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
Boereckcommented, Aug 26, 2018

Yep, I can prepare a PR this evening.

1reaction
Boereckcommented, Aug 24, 2018

Sure I could start a PR, for now. I know in VS Code the grammar seems to do the right thing with regard to raw strings. I think they have their grammar from another Repo as well. I can investigate where their grammar is originally from. If this grammar has more recent updates this could be a better overall alternative. I’ll let you know.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What exactly is a "raw string regex" and how can you use it?
The solution is to use Python's raw string notation for regular expression patterns; backslashes are not handled in any special way in a...
Read more >
C++ Weekly - Ep 183 - Start Using Raw String Literals
Important conference, book and swag info in description ☟☟T-SHIRTS AVAILABLE!▻ The best C++ T-Shirts anywhere!
Read more >
C++11 Feature Proposal: Raw string literals - Google Groups
Raw string literals should continue to be disallowed for now because of buggy support in VC++ 2013. I have tried using them and...
Read more >
Raw string literals - Regex Tester/Debugger
^abc$, start / end of the string. \b, word boundary. Escaped characters. \. \* \\, escaped special characters. \t \n \r, tab, linefeed,...
Read more >
After implementing xcolor, simple table becomes buggy - TeX
When I am making a table with colored first raw using xcolor for my thesis, vertical line in first raw behaves differently in...
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