mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Add filetype highlighting to block string literals (#3642)
This PR adds filetype highlighting support to block string literals in the TextMate grammar. After adding the regex in the `begin` of the block string literal, `beginCaptures` is used to access the first capturing group of the regex (which captures the filetype) and apply the `constant.character.escape` rule.  Closes #3641
This commit is contained in:
@@ -82,10 +82,17 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
<key>name</key>
|
||||
<string>string.quoted.triple.carbon</string>
|
||||
<key>begin</key>
|
||||
<string>'''</string>
|
||||
<string>'''([^\s'#]*\n)?</string>
|
||||
<key>end</key>
|
||||
<string>'''</string>
|
||||
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>constant.character.escape.carbon</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
|
||||
Reference in New Issue
Block a user