Skip to content

Commit 0e86902

Browse files
Update C# TextMate grammar with important bug fix
This grammar update fixes an issue with comments after property declarations solved by dotnet/csharp-tmLanguage#117.
1 parent 302cbc1 commit 0e86902

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

extensions/csharp/syntaxes/csharp.tmLanguage.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
55
"Once accepted there, we are happy to receive an update request."
66
],
7-
"version": "https://github.com/dotnet/csharp-tmLanguage/commit/542a4e220e58813ea67cdd91b3a454e6e4491aab",
7+
"version": "https://github.com/dotnet/csharp-tmLanguage/commit/925295380addea5b27f419a423c708f421347c5c",
88
"name": "C#",
99
"scopeName": "source.cs",
1010
"patterns": [
@@ -116,13 +116,13 @@
116116
"include": "#type-declarations"
117117
},
118118
{
119-
"include": "#field-declaration"
119+
"include": "#property-declaration"
120120
},
121121
{
122-
"include": "#event-declaration"
122+
"include": "#field-declaration"
123123
},
124124
{
125-
"include": "#property-declaration"
125+
"include": "#event-declaration"
126126
},
127127
{
128128
"include": "#indexer-declaration"
@@ -162,10 +162,10 @@
162162
"include": "#comment"
163163
},
164164
{
165-
"include": "#event-declaration"
165+
"include": "#property-declaration"
166166
},
167167
{
168-
"include": "#property-declaration"
168+
"include": "#event-declaration"
169169
},
170170
{
171171
"include": "#indexer-declaration"
@@ -1001,7 +1001,7 @@
10011001
]
10021002
},
10031003
"property-declaration": {
1004-
"begin": "(?x)\n(?!.*\\b(?:class|interface|struct|enum|event)\\b)\\s*\n(?<return-type>\n (?<type-name>\n (?:\n (?:ref\\s+(?:readonly\\s+)?)? # ref return\n (?:\n (?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name-and-type-args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type-args>\\s*<(?:[^<>]|\\g<type-args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name-and-type-args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\\s+\n)\n(?<interface-name>\\g<type-name>\\s*\\.\\s*)?\n(?<property-name>\\g<identifier>)\\s*\n(?=\\{|=>|$)",
1004+
"begin": "(?x)\n\n# The negative lookahead below ensures that we don't match nested types\n# or other declarations as properties.\n(?![[:word:][:space:]]*\\b(?:class|interface|struct|enum|event)\\b)\n\n(?<return-type>\n (?<type-name>\n (?:\n (?:ref\\s+(?:readonly\\s+)?)? # ref return\n (?:\n (?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (?<name-and-type-args> # identifier + type arguments (if any)\n \\g<identifier>\\s*\n (?<type-args>\\s*<(?:[^<>]|\\g<type-args>)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g<name-and-type-args>)* | # Are there any more names being dotted into?\n (?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\\s+\n)\n(?<interface-name>\\g<type-name>\\s*\\.\\s*)?\n(?<property-name>\\g<identifier>)\\s*\n(?=\\{|=>|$)",
10051005
"beginCaptures": {
10061006
"1": {
10071007
"patterns": [

0 commit comments

Comments
 (0)