Skip to content
Browse files

C# syntax highlighting: support string interpolation syntax

  • Loading branch information...
1 parent 8a1a71c commit f75c8398e9011777981dc97c5da05f9f531b97b0 @dgrunwald dgrunwald committed Jun 19, 2016
View
13 src/AddIns/BackendBindings/CSharpBinding/Project/Resources/CSharp-Semantic.xshd
@@ -7,6 +7,7 @@
<!-- The named colors 'Comment' and 'String' are used in SharpDevelop to detect if a line is inside a multiline string/comment -->
<Color name="Comment" foreground="Green" exampleText="// comment" />
<Color name="String" foreground="Blue" exampleText="string text = &quot;Hello, World!&quot;"/>
+ <Color name="StringInterpolation" foreground="Black" exampleText="string text = $&quot;Hello, {name}!&quot;"/>
<Color name="Char" foreground="Magenta" exampleText="char linefeed = '\n';"/>
<Color name="Preprocessor" foreground="Green" exampleText="#region Title" />
<Color name="Punctuation" exampleText="a(b.c);" />
@@ -122,6 +123,18 @@
</RuleSet>
</Span>
+ <Span color="String">
+ <Begin>\$"</Begin>
+ <End>"</End>
+ <RuleSet>
+ <!-- span for escape sequences -->
+ <Span begin="\\" end="."/>
+ <Span begin="\{\{" end=""/>
+ <!-- string interpolation -->
+ <Span begin="{" end="}" color="StringInterpolation" ruleSet=""/>
+ </RuleSet>
+ </Span>
+
<!-- don't highlight "@int" as keyword -->
<Rule>
@[\w\d_]+
2 src/Libraries/AvalonEdit
@@ -1 +1 @@
-Subproject commit 19611add5ac9fea77a41a145fc85211c6c32f921
+Subproject commit 697ff0d38c95c9e5a536fbc05ae2307ec9ef2a63

0 comments on commit f75c839

Please sign in to comment.
Something went wrong with that request. Please try again.