Skip to content

Commit

Permalink
Highlight body of C# 6 expression bodied members properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanz committed Aug 18, 2016
1 parent fe328c0 commit d614c68
Showing 1 changed file with 66 additions and 1 deletion.
67 changes: 66 additions & 1 deletion syntaxes/csharp.json
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,21 @@
}
]
},
{
"begin": "=>",
"beginCaptures": {
"0": {
"name": "punctuation.section.method.begin.cs"
}
},
"end": "(?=;)",
"name": "meta.method.body.cs",
"patterns": [
{
"include": "#code"
}
]
},
{
"begin": "{",
"beginCaptures": {
Expand All @@ -423,7 +438,57 @@
]
},
{
"begin": "(?!new)(?=[\\w<].*\\s+)(?=[^=]+\\{)",
"begin": "(?!new)(?=[\\w<].*\\s+)(?=[^\\(]+=>)",
"end": ";",
"endCaptures": {
"0": {
"name": "punctuation.section.property.end.cs"
}
},
"name": "meta.property.cs",
"patterns": [
{
"include": "#storage-modifiers"
},
{
"begin": "(?=([\\w.]+)\\s*=>)",
"captures": {
"1": {
"name": "entity.name.function.cs"
}
},
"end": "(?==>)",
"name": "meta.method.identifier.cs"
},
{
"begin": "(?=\\w.*\\s+[\\w.]+\\s*=>)",
"end": "(?=[\\w.]+\\s*=>)",
"name": "meta.method.return-type.cs",
"patterns": [
{
"include": "#builtinTypes"
}
]
},
{
"begin": "=>",
"beginCaptures": {
"0": {
"name": "punctuation.section.property.begin.cs"
}
},
"end": "(?=;)",
"name": "meta.method.body.cs",
"patterns": [
{
"include": "#code"
}
]
}
]
},
{
"begin": "(?!new)(?=[\\w<].*\\s+)(?=[^=\\(]+\\{)",
"end": "}",
"endCaptures": {
"0": {
Expand Down

0 comments on commit d614c68

Please sign in to comment.