Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit f75c839

Browse files
committed
C# syntax highlighting: support string interpolation syntax
1 parent 8a1a71c commit f75c839

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/AddIns/BackendBindings/CSharpBinding/Project/Resources/CSharp-Semantic.xshd

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<!-- The named colors 'Comment' and 'String' are used in SharpDevelop to detect if a line is inside a multiline string/comment -->
88
<Color name="Comment" foreground="Green" exampleText="// comment" />
99
<Color name="String" foreground="Blue" exampleText="string text = &quot;Hello, World!&quot;"/>
10+
<Color name="StringInterpolation" foreground="Black" exampleText="string text = $&quot;Hello, {name}!&quot;"/>
1011
<Color name="Char" foreground="Magenta" exampleText="char linefeed = '\n';"/>
1112
<Color name="Preprocessor" foreground="Green" exampleText="#region Title" />
1213
<Color name="Punctuation" exampleText="a(b.c);" />
@@ -122,6 +123,18 @@
122123
</RuleSet>
123124
</Span>
124125

126+
<Span color="String">
127+
<Begin>\$"</Begin>
128+
<End>"</End>
129+
<RuleSet>
130+
<!-- span for escape sequences -->
131+
<Span begin="\\" end="."/>
132+
<Span begin="\{\{" end=""/>
133+
<!-- string interpolation -->
134+
<Span begin="{" end="}" color="StringInterpolation" ruleSet=""/>
135+
</RuleSet>
136+
</Span>
137+
125138
<!-- don't highlight "@int" as keyword -->
126139
<Rule>
127140
@[\w\d_]+

0 commit comments

Comments
 (0)