From af6436c20c1c4bb2d3d18663efc2e3417223bedb Mon Sep 17 00:00:00 2001
From: Karthik Prakash <116057817+skoriop@users.noreply.github.com>
Date: Thu, 25 Jan 2024 00:26:25 +0530
Subject: [PATCH] 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
---
utils/textmate/Syntaxes/Carbon.plist | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/utils/textmate/Syntaxes/Carbon.plist b/utils/textmate/Syntaxes/Carbon.plist
index 5788ed893709..b532b89574c6 100644
--- a/utils/textmate/Syntaxes/Carbon.plist
+++ b/utils/textmate/Syntaxes/Carbon.plist
@@ -82,10 +82,17 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
name
string.quoted.triple.carbon
begin
- '''
+ '''([^\s'#]*\n)?
end
'''
-
+ beginCaptures
+
+ 1
+
+ name
+ constant.character.escape.carbon
+
+
patterns