Skip to content

Commit

Permalink
fix: revert c# grammar to work around #219 for now
Browse files Browse the repository at this point in the history
  • Loading branch information
octref committed Sep 16, 2021
1 parent 20de770 commit 49edb78
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
8 changes: 4 additions & 4 deletions packages/shiki/languages/csharp.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
"version": "https://github.com/dotnet/csharp-tmLanguage/commit/5f62efed7a0319dc41ee2ed227577633b52312a2",
"version": "https://github.com/dotnet/csharp-tmLanguage/commit/53344c05ec5dd09e1dbc4a77a1aacd482403715a",
"name": "csharp",
"scopeName": "source.cs",
"patterns": [
Expand Down Expand Up @@ -1795,7 +1795,7 @@
]
},
"switch-expression": {
"begin": "(?x) (?<!\\.)\\b(switch)",
"begin": "(?x) (?<!\\.)\\b(switch)\\b",
"beginCaptures": {
"1": {
"name": "keyword.control.switch.cs"
Expand Down Expand Up @@ -3170,7 +3170,7 @@
]
},
"conditional-operator": {
"begin": "(?<!\\?)\\?(?!\\?|\\.|\\[)",
"begin": "(?<!\\?\\s*)\\?(?!\\?|\\.|\\[)",
"beginCaptures": {
"0": {
"name": "keyword.operator.conditional.question-mark.cs"
Expand Down Expand Up @@ -3238,7 +3238,7 @@
"match": "@?[_[:alpha:]][_[:alnum:]]*"
},
"cast-expression": {
"match": "(?x)\n(\\()\\s*\n(?<type_name>\n (?:\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* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)\\s*\n(\\))(?=\\s*@?[_[:alnum:]\\(])",
"match": "(?x)\n(\\()\\s*\n(?<type_name>\n (?:\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* # array suffix?\n \\[\n (?:\\s*,\\s*)* # commata for multi-dimensional arrays\n \\]\n \\s*\n (?:\\?)? # arrays can be nullable reference types\n \\s*\n )*\n )\n)\\s*\n(\\))(?=\\s*-*!*@?[_[:alnum:]\\(])",
"captures": {
"1": {
"name": "punctuation.parenthesis.open.cs"
Expand Down
7 changes: 6 additions & 1 deletion scripts/grammarSources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,12 @@ export const githubGrammarSources: (string | [string, string])[] = [
'https://github.com/StoneCypher/sublime-jssm/blob/master/jssm.tmLanguage',
'https://github.com/gbasood/vscode-atomic-dreams/blob/master/syntaxes/dm.tmLanguage.json',
'https://github.com/bmalehorn/vscode-fish/blob/master/syntaxes/fish.tmLanguage.json',
'https://github.com/snowpackjs/astro/blob/main/tools/vscode/syntaxes/astro.tmLanguage.json'
'https://github.com/snowpackjs/astro/blob/main/tools/vscode/syntaxes/astro.tmLanguage.json',
// Temporary fix for https://github.com/shikijs/shiki/issues/219#issuecomment-921245374
[
'csharp',
'https://github.com/microsoft/vscode/blob/bd2493499dab8aafe8d216dfa4de7dafd04b4c94/extensions/csharp/syntaxes/csharp.tmLanguage.json'
]
]

/**
Expand Down

0 comments on commit 49edb78

Please sign in to comment.