Skip to content

Commit

Permalink
Change query expression keyword scope
Browse files Browse the repository at this point in the history
  • Loading branch information
wise0704 committed Aug 25, 2023
1 parent 264b9c7 commit abb9ff0
Show file tree
Hide file tree
Showing 6 changed files with 199 additions and 207 deletions.
55 changes: 25 additions & 30 deletions grammars/csharp.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -514,12 +514,12 @@
<key>1</key>
<dict>
<key>name</key>
<string>keyword.directive.extern.cs</string>
<string>keyword.other.directive.extern.cs</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>keyword.directive.alias.cs</string>
<string>keyword.other.directive.alias.cs</string>
</dict>
<key>3</key>
<dict>
Expand All @@ -542,17 +542,17 @@
<key>2</key>
<dict>
<key>name</key>
<string>keyword.directive.global.cs</string>
<string>keyword.other.directive.global.cs</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>keyword.directive.using.cs</string>
<string>keyword.other.directive.using.cs</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>keyword.directive.static.cs</string>
<string>keyword.other.directive.static.cs</string>
</dict>
<key>6</key>
<dict>
Expand All @@ -578,12 +578,12 @@
<key>2</key>
<dict>
<key>name</key>
<string>keyword.directive.global.cs</string>
<string>keyword.other.directive.global.cs</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>keyword.directive.using.cs</string>
<string>keyword.other.directive.using.cs</string>
</dict>
<key>5</key>
<dict>
Expand Down Expand Up @@ -622,12 +622,12 @@
<key>2</key>
<dict>
<key>name</key>
<string>keyword.directive.global.cs</string>
<string>keyword.other.directive.global.cs</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>keyword.directive.using.cs</string>
<string>keyword.other.directive.using.cs</string>
</dict>
</dict>
<key>end</key>
Expand Down Expand Up @@ -7298,7 +7298,7 @@
<key>1</key>
<dict>
<key>name</key>
<string>keyword.query.from.cs</string>
<string>keyword.operator.expression.query.from.cs</string>
</dict>
<key>2</key>
<dict>
Expand All @@ -7318,7 +7318,7 @@
<key>8</key>
<dict>
<key>name</key>
<string>keyword.query.in.cs</string>
<string>keyword.operator.expression.query.in.cs</string>
</dict>
</dict>
<key>end</key>
Expand Down Expand Up @@ -7377,7 +7377,7 @@
<key>1</key>
<dict>
<key>name</key>
<string>keyword.query.let.cs</string>
<string>keyword.operator.expression.query.let.cs</string>
</dict>
<key>2</key>
<dict>
Expand Down Expand Up @@ -7414,7 +7414,7 @@
<key>1</key>
<dict>
<key>name</key>
<string>keyword.query.where.cs</string>
<string>keyword.operator.expression.query.where.cs</string>
</dict>
</dict>
<key>end</key>
Expand Down Expand Up @@ -7465,7 +7465,7 @@
<key>1</key>
<dict>
<key>name</key>
<string>keyword.query.join.cs</string>
<string>keyword.operator.expression.query.join.cs</string>
</dict>
<key>2</key>
<dict>
Expand All @@ -7485,7 +7485,7 @@
<key>8</key>
<dict>
<key>name</key>
<string>keyword.query.in.cs</string>
<string>keyword.operator.expression.query.in.cs</string>
</dict>
</dict>
<key>end</key>
Expand Down Expand Up @@ -7523,7 +7523,7 @@
<key>1</key>
<dict>
<key>name</key>
<string>keyword.query.on.cs</string>
<string>keyword.operator.expression.query.on.cs</string>
</dict>
</dict>
</dict>
Expand All @@ -7536,7 +7536,7 @@
<key>1</key>
<dict>
<key>name</key>
<string>keyword.query.equals.cs</string>
<string>keyword.operator.expression.query.equals.cs</string>
</dict>
</dict>
</dict>
Expand All @@ -7551,7 +7551,7 @@
<key>1</key>
<dict>
<key>name</key>
<string>keyword.query.into.cs</string>
<string>keyword.operator.expression.query.into.cs</string>
</dict>
<key>2</key>
<dict>
Expand All @@ -7569,7 +7569,7 @@
<key>1</key>
<dict>
<key>name</key>
<string>keyword.query.orderby.cs</string>
<string>keyword.operator.expression.query.orderby.cs</string>
</dict>
</dict>
<key>end</key>
Expand Down Expand Up @@ -7597,18 +7597,13 @@
<key>ordering-direction</key>
<dict>
<key>match</key>
<string>\b(?:(ascending)|(descending))\b</string>
<string>\b(ascending|descending)\b</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.query.ascending.cs</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>keyword.query.descending.cs</string>
<string>keyword.operator.expression.query.$1.cs</string>
</dict>
</dict>
</dict>
Expand All @@ -7621,7 +7616,7 @@
<key>1</key>
<dict>
<key>name</key>
<string>keyword.query.select.cs</string>
<string>keyword.operator.expression.query.select.cs</string>
</dict>
</dict>
<key>end</key>
Expand All @@ -7647,7 +7642,7 @@
<key>1</key>
<dict>
<key>name</key>
<string>keyword.query.group.cs</string>
<string>keyword.operator.expression.query.group.cs</string>
</dict>
</dict>
<key>end</key>
Expand Down Expand Up @@ -7681,7 +7676,7 @@
<key>1</key>
<dict>
<key>name</key>
<string>keyword.query.by.cs</string>
<string>keyword.operator.expression.query.by.cs</string>
</dict>
</dict>
</dict>
Expand All @@ -7696,7 +7691,7 @@
<key>1</key>
<dict>
<key>name</key>
<string>keyword.query.into.cs</string>
<string>keyword.operator.expression.query.into.cs</string>
</dict>
<key>2</key>
<dict>
Expand Down
52 changes: 25 additions & 27 deletions grammars/csharp.tmLanguage.cson
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,9 @@ repository:
begin: "\\s*(extern)\\b\\s*(alias)\\b\\s*(@?[_[:alpha:]][_[:alnum:]]*)"
beginCaptures:
"1":
name: "keyword.directive.extern.cs"
name: "keyword.other.directive.extern.cs"
"2":
name: "keyword.directive.alias.cs"
name: "keyword.other.directive.alias.cs"
"3":
name: "variable.other.alias.cs"
end: "(?=;)"
Expand All @@ -377,11 +377,11 @@ repository:
begin: "(\\b(global)\\b\\s+)?\\b(using)\\b\\s+(static)\\b\\s+(\\b(unsafe)\\b\\s+)?"
beginCaptures:
"2":
name: "keyword.directive.global.cs"
name: "keyword.other.directive.global.cs"
"3":
name: "keyword.directive.using.cs"
name: "keyword.other.directive.using.cs"
"4":
name: "keyword.directive.static.cs"
name: "keyword.other.directive.static.cs"
"6":
name: "storage.modifier.unsafe.cs"
end: "(?=;)"
Expand All @@ -395,9 +395,9 @@ repository:
begin: "(\\b(global)\\b\\s+)?\\b(using)\\b\\s+(\\b(unsafe)\\b\\s+)?(?=(@?[_[:alpha:]][_[:alnum:]]*)\\s*=)"
beginCaptures:
"2":
name: "keyword.directive.global.cs"
name: "keyword.other.directive.global.cs"
"3":
name: "keyword.directive.using.cs"
name: "keyword.other.directive.using.cs"
"5":
name: "storage.modifier.unsafe.cs"
"6":
Expand All @@ -419,9 +419,9 @@ repository:
begin: "(\\b(global)\\b\\s+)?\\b(using)\\s*(?!\\(|\\s|var)"
beginCaptures:
"2":
name: "keyword.directive.global.cs"
name: "keyword.other.directive.global.cs"
"3":
name: "keyword.directive.using.cs"
name: "keyword.other.directive.using.cs"
end: "(?=;)"
patterns: [
{
Expand Down Expand Up @@ -4404,7 +4404,7 @@ repository:
'''
beginCaptures:
"1":
name: "keyword.query.from.cs"
name: "keyword.operator.expression.query.from.cs"
"2":
patterns: [
{
Expand All @@ -4414,7 +4414,7 @@ repository:
"7":
name: "entity.name.variable.range-variable.cs"
"8":
name: "keyword.query.in.cs"
name: "keyword.operator.expression.query.in.cs"
end: "(?=;|\\))"
patterns: [
{
Expand Down Expand Up @@ -4454,7 +4454,7 @@ repository:
'''
beginCaptures:
"1":
name: "keyword.query.let.cs"
name: "keyword.operator.expression.query.let.cs"
"2":
name: "entity.name.variable.range-variable.cs"
"3":
Expand All @@ -4475,7 +4475,7 @@ repository:
'''
beginCaptures:
"1":
name: "keyword.query.where.cs"
name: "keyword.operator.expression.query.where.cs"
end: "(?=;|\\))"
patterns: [
{
Expand Down Expand Up @@ -4516,7 +4516,7 @@ repository:
'''
beginCaptures:
"1":
name: "keyword.query.join.cs"
name: "keyword.operator.expression.query.join.cs"
"2":
patterns: [
{
Expand All @@ -4526,7 +4526,7 @@ repository:
"7":
name: "entity.name.variable.range-variable.cs"
"8":
name: "keyword.query.in.cs"
name: "keyword.operator.expression.query.in.cs"
end: "(?=;|\\))"
patterns: [
{
Expand All @@ -4549,12 +4549,12 @@ repository:
match: "\\b(on)\\b\\s*"
captures:
"1":
name: "keyword.query.on.cs"
name: "keyword.operator.expression.query.on.cs"
"join-equals":
match: "\\b(equals)\\b\\s*"
captures:
"1":
name: "keyword.query.equals.cs"
name: "keyword.operator.expression.query.equals.cs"
"join-into":
match: '''
(?x)
Expand All @@ -4563,14 +4563,14 @@ repository:
'''
captures:
"1":
name: "keyword.query.into.cs"
name: "keyword.operator.expression.query.into.cs"
"2":
name: "entity.name.variable.range-variable.cs"
"orderby-clause":
begin: "\\b(orderby)\\b\\s*"
beginCaptures:
"1":
name: "keyword.query.orderby.cs"
name: "keyword.operator.expression.query.orderby.cs"
end: "(?=;|\\))"
patterns: [
{
Expand All @@ -4587,17 +4587,15 @@ repository:
}
]
"ordering-direction":
match: "\\b(?:(ascending)|(descending))\\b"
match: "\\b(ascending|descending)\\b"
captures:
"1":
name: "keyword.query.ascending.cs"
"2":
name: "keyword.query.descending.cs"
name: "keyword.operator.expression.query.$1.cs"
"select-clause":
begin: "\\b(select)\\b\\s*"
beginCaptures:
"1":
name: "keyword.query.select.cs"
name: "keyword.operator.expression.query.select.cs"
end: "(?=;|\\))"
patterns: [
{
Expand All @@ -4611,7 +4609,7 @@ repository:
begin: "\\b(group)\\b\\s*"
beginCaptures:
"1":
name: "keyword.query.group.cs"
name: "keyword.operator.expression.query.group.cs"
end: "(?=;|\\))"
patterns: [
{
Expand All @@ -4631,7 +4629,7 @@ repository:
match: "\\b(by)\\b\\s*"
captures:
"1":
name: "keyword.query.by.cs"
name: "keyword.operator.expression.query.by.cs"
"group-into":
match: '''
(?x)
Expand All @@ -4640,7 +4638,7 @@ repository:
'''
captures:
"1":
name: "keyword.query.into.cs"
name: "keyword.operator.expression.query.into.cs"
"2":
name: "entity.name.variable.range-variable.cs"
"anonymous-method-expression":
Expand Down
Loading

0 comments on commit abb9ff0

Please sign in to comment.