Browse Source

C# syntax highlighting: support string interpolation syntax

pull/765/head
Daniel Grunwald 9 years ago
parent
commit
f75c8398e9
  1. 13
      src/AddIns/BackendBindings/CSharpBinding/Project/Resources/CSharp-Semantic.xshd
  2. 2
      src/Libraries/AvalonEdit

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

@ -7,6 +7,7 @@ @@ -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 @@ @@ -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 @@ @@ -1 +1 @@
Subproject commit 19611add5ac9fea77a41a145fc85211c6c32f921
Subproject commit 697ff0d38c95c9e5a536fbc05ae2307ec9ef2a63
Loading…
Cancel
Save