Skip to content

Commit 94928ee

Browse files
committed
feat: update language pack grammars
1 parent 1783f50 commit 94928ee

29 files changed

+2867
-1371
lines changed

org.eclipse.tm4e.language_pack/README.md

Lines changed: 60 additions & 60 deletions
Large diffs are not rendered by default.

org.eclipse.tm4e.language_pack/about.html

Lines changed: 63 additions & 63 deletions
Large diffs are not rendered by default.

org.eclipse.tm4e.language_pack/plugin.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@
652652
<!-- ======================================== -->
653653
<extension point="org.eclipse.core.contenttype.contentTypes">
654654
<content-type id="org.eclipse.tm4e.language_pack.jsonc" name="JSON with Comments" base-type="org.eclipse.tm4e.language_pack.basetype" priority="low"
655-
file-extensions="babelrc,eslintrc,hintrc,jsfmtrc,jshintrc,jsonc,swcrc" file-names=".babelrc.json,.ember-cli,babel.config.json,bun.lock,typedoc.json" file-patterns="*.eslintrc.json" />
655+
file-extensions="babelrc,eslintrc,hintrc,jsfmtrc,jshintrc,jsonc,swcrc" file-names=".babelrc.json,.ember-cli,babel.config.json,bun.lock,typedoc.json" file-patterns="*.eslintrc.json,*.toolset.jsonc" />
656656
</extension>
657657
<extension point="org.eclipse.tm4e.registry.grammars">
658658
<grammar scopeName="source.json.comments" path="syntaxes/json/jsonc.tmLanguage.json" />
@@ -692,7 +692,7 @@
692692
<!-- ======================================== -->
693693
<extension point="org.eclipse.core.contenttype.contentTypes">
694694
<content-type id="org.eclipse.tm4e.language_pack.snippets" name="Code Snippets" base-type="org.eclipse.tm4e.language_pack.basetype" priority="low"
695-
file-extensions="code-snippets" file-patterns="**/User/profiles/*/snippets/*.json,**/User/snippets/*.json" />
695+
file-extensions="code-snippets" file-patterns="**/User/profiles/*/snippets/*.json,**/User/snippets/*.json,**/snippets*.json" />
696696
</extension>
697697
<extension point="org.eclipse.tm4e.registry.grammars">
698698
<grammar scopeName="source.json.comments.snippets" path="syntaxes/json/snippets.tmLanguage.json" />
@@ -1402,7 +1402,7 @@
14021402
<!-- ======================================== -->
14031403
<extension point="org.eclipse.core.contenttype.contentTypes">
14041404
<content-type id="org.eclipse.tm4e.language_pack.xml" name="XML" base-type="org.eclipse.tm4e.language_pack.basetype" priority="low"
1405-
file-extensions="ascx,atom,axaml,axml,bpmn,cpt,csl,csproj,dita,ditamap,dtd,dtml,ent,fsproj,fxml,iml,isml,jmx,launch,menu,mod,mxml,nuspec,opml,owl,proj,props,pt,publishsettings,pubxml,rbxlx,rbxmx,rdf,rng,rss,shproj,storyboard,svg,targets,tld,tmx,vbproj,vcxproj,wsdl,wxi,wxl,wxs,xaml,xbl,xib,xlf,xliff,xml,xoml,xpdl,xsd,xul" file-patterns="*.csproj.user,*.pubxml.user,*.vbproj.user,*.vcxproj.filters" />
1405+
file-extensions="ascx,atom,axaml,axml,bpmn,cpt,csl,csproj,dita,ditamap,dtd,dtml,ent,fsproj,fxml,iml,isml,jmx,launch,menu,mod,mxml,nuspec,opml,owl,proj,props,pt,publishsettings,pubxml,rbxlx,rbxmx,rdf,rng,rss,shproj,slnx,storyboard,svg,targets,tld,tmx,vbproj,vcxproj,wsdl,wxi,wxl,wxs,xaml,xbl,xib,xlf,xliff,xml,xoml,xpdl,xsd,xul" file-patterns="*.csproj.user,*.pubxml.user,*.vbproj.user,*.vcxproj.filters" />
14061406
</extension>
14071407
<extension point="org.eclipse.tm4e.registry.grammars">
14081408
<grammar scopeName="text.xml" path="syntaxes/xml/xml.tmLanguage.json" />

org.eclipse.tm4e.language_pack/syntaxes/csharp/csharp.language-configuration.json

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,24 @@
7676
"\""
7777
]
7878
],
79+
"colorizedBracketPairs": [
80+
[
81+
"{",
82+
"}"
83+
],
84+
[
85+
"[",
86+
"]"
87+
],
88+
[
89+
"(",
90+
")"
91+
],
92+
[
93+
"<",
94+
">"
95+
]
96+
],
7997
"folding": {
8098
"markers": {
8199
"start": "^\\s*#region\\b",
@@ -84,9 +102,10 @@
84102
},
85103
"onEnterRules": [
86104
// Add // when pressing enter from inside line comment
105+
// We do not want to match /// (a documentation comment)
87106
{
88107
"beforeText": {
89-
"pattern": "\/\/.*"
108+
"pattern": "[^\/]\/\/[^\/].*"
90109
},
91110
"afterText": {
92111
"pattern": "^(?!\\s*$).+"
@@ -96,5 +115,16 @@
96115
"appendText": "// "
97116
}
98117
},
118+
// Add /// when pressing enter from anywhere inside a documentation comment.
119+
// Documentation comments are not valid after non-whitespace.
120+
{
121+
"beforeText": {
122+
"pattern": "^\\s*\/\/\/"
123+
},
124+
"action": {
125+
"indent": "none",
126+
"appendText": "/// "
127+
}
128+
},
99129
]
100130
}

org.eclipse.tm4e.language_pack/syntaxes/csharp/csharp.tmLanguage.json

Lines changed: 5 additions & 5 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/62026a70f9fcc42d9222eccfec34ed5ee0784f3d",
7+
"version": "https://github.com/dotnet/csharp-tmLanguage/commit/1381bedfb087c18aca67af8278050d11bc9d9349",
88
"name": "C#",
99
"scopeName": "source.cs",
1010
"patterns": [
@@ -714,11 +714,11 @@
714714
},
715715
"enum-declaration": {
716716
"begin": "(?=\\benum\\b)",
717-
"end": "(?<=\\})",
717+
"end": "(?<=\\})|(?=;)",
718718
"patterns": [
719719
{
720720
"begin": "(?=enum)",
721-
"end": "(?=\\{)",
721+
"end": "(?=\\{)|(?=;)",
722722
"patterns": [
723723
{
724724
"include": "#comment"
@@ -805,7 +805,7 @@
805805
},
806806
"interface-declaration": {
807807
"begin": "(?=\\binterface\\b)",
808-
"end": "(?<=\\})",
808+
"end": "(?<=\\})|(?=;)",
809809
"patterns": [
810810
{
811811
"begin": "(?x)\n(interface)\\b\\s+\n(@?[_[:alpha:]][_[:alnum:]]*)",
@@ -817,7 +817,7 @@
817817
"name": "entity.name.type.interface.cs"
818818
}
819819
},
820-
"end": "(?=\\{)",
820+
"end": "(?=\\{)|(?=;)",
821821
"patterns": [
822822
{
823823
"include": "#comment"

org.eclipse.tm4e.language_pack/syntaxes/fsharp/fsharp.tmLanguage.json

Lines changed: 12 additions & 15 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/ionide/ionide-fsgrammar/commit/c62c78404d0b2c14816aae61ac0688663a5990a3",
7+
"version": "https://github.com/ionide/ionide-fsgrammar/commit/be3c51d2c28d3aaacd89ecd067e766bebe387f89",
88
"name": "fsharp",
99
"scopeName": "source.fsharp",
1010
"patterns": [
@@ -525,15 +525,6 @@
525525
},
526526
"comments": {
527527
"patterns": [
528-
{
529-
"name": "comment.literate.command.fsharp",
530-
"match": "(\\(\\*{3}.*\\*{3}\\))",
531-
"beginCaptures": {
532-
"1": {
533-
"name": "comment.block.fsharp"
534-
}
535-
}
536-
},
537528
{
538529
"name": "comment.block.markdown.fsharp",
539530
"begin": "^\\s*(\\(\\*\\*(?!\\)))((?!\\*\\)).)*$",
@@ -543,7 +534,7 @@
543534
"name": "comment.block.fsharp"
544535
}
545536
},
546-
"endCaptures": {
537+
"whileCaptures": {
547538
"1": {
548539
"name": "comment.block.fsharp"
549540
}
@@ -807,13 +798,16 @@
807798
]
808799
},
809800
{
810-
"match": "(:)\\s*([?[:alpha:]0-9'`^._ ]+)",
801+
"match": "(:)\\s*([?[:alpha:]0-9'`^._ ]+)(\\|\\s*(null))?",
811802
"captures": {
812803
"1": {
813804
"name": "keyword.symbol.fsharp"
814805
},
815806
"2": {
816807
"name": "entity.name.type.fsharp"
808+
},
809+
"4": {
810+
"name": "entity.name.type.fsharp"
817811
}
818812
}
819813
},
@@ -936,8 +930,8 @@
936930
"patterns": [
937931
{
938932
"name": "binding.fsharp",
939-
"begin": "\\b(let mutable|static let mutable|static let|let inline|let|and|member val|member inline|static member inline|static member val|static member|default|member|override|let!)(\\s+rec|mutable)?(\\s+\\[\\<.*\\>\\])?\\s*(private|internal|public)?\\s+(\\[[^-=]*\\]|[_[:alpha:]]([_[:alpha:]0-9\\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9\\._`\\s]+|(?<=,)\\s)*)?",
940-
"end": "\\s*((with\\b)|(=|\\n+=|(?<=\\=)))",
933+
"begin": "\\b(let mutable|static let mutable|static let|let inline|let|and inline|and|member val|member inline|static member inline|static member val|static member|default|member|override|let!)(\\s+rec|mutable)?(\\s+\\[\\<.*\\>\\])?\\s*(private|internal|public)?\\s+(\\[[^-=]*\\]|[_[:alpha:]]([_[:alpha:]0-9\\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9\\._`\\s]+|(?<=,)\\s)*)?",
934+
"end": "\\s*((with inline|with)\\b|(=|\\n+=|(?<=\\=)))",
941935
"beginCaptures": {
942936
"1": {
943937
"name": "keyword.fsharp"
@@ -1522,7 +1516,7 @@
15221516
"match": "(\\(|\\))"
15231517
},
15241518
{
1525-
"match": "(\\?{0,1})([[:alpha:]0-9'`^._]+|``[[:alpha:]0-9'`^:,._ ]+``)\\s*(:{0,1})(\\s*([?[:alpha:]0-9'`<>._ ]+)){0,1}",
1519+
"match": "(\\?{0,1})([[:alpha:]0-9'`^._]+|``[[:alpha:]0-9'`^:,._ ]+``)\\s*(:{0,1})(\\s*([?[:alpha:]0-9'`<>._ ]+)){0,1}(\\|\\s*(null))?",
15261520
"captures": {
15271521
"1": {
15281522
"name": "keyword.symbol.fsharp"
@@ -1535,6 +1529,9 @@
15351529
},
15361530
"4": {
15371531
"name": "entity.name.type.fsharp"
1532+
},
1533+
"7": {
1534+
"name": "entity.name.type.fsharp"
15381535
}
15391536
}
15401537
},

0 commit comments

Comments
 (0)