Skip to content

Commit de5df48

Browse files
committed
Try out new go grammar
Fixes microsoft#82549
1 parent 3b673f4 commit de5df48

File tree

3 files changed

+48
-31
lines changed

3 files changed

+48
-31
lines changed

extensions/go/cgmanifest.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
"component": {
55
"type": "git",
66
"git": {
7-
"name": "language-go",
8-
"repositoryUrl": "https://github.com/atom/language-go",
9-
"commitHash": "b6fd68f74efa109679e31fe6f4a41ac105262d0e"
7+
"name": "better-go-syntax",
8+
"repositoryUrl": "https://github.com/jeff-hykin/better-go-syntax/ ",
9+
"commitHash": "54ff898316f8647d77ffcf83880a9556445326f1"
1010
}
1111
},
1212
"license": "MIT",
13-
"description": "The file syntaxes/go.json was derived from the Atom package https://atom.io/packages/language-go.",
14-
"version": "0.44.3"
13+
"description": "The file syntaxes/go.tmLanguage.json is from https://github.com/jeff-hykin/better-go-syntax/ .",
14+
"version": "1.0.0"
1515
}
1616
],
1717
"version": 1

extensions/go/package.json

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,36 @@
55
"version": "1.0.0",
66
"publisher": "vscode",
77
"license": "MIT",
8-
"engines": { "vscode": "*" },
8+
"engines": {
9+
"vscode": "*"
10+
},
911
"scripts": {
10-
"update-grammar": "node ../../build/npm/update-grammar.js atom/language-go grammars/go.cson ./syntaxes/go.tmLanguage.json"
12+
"update-grammar": "node ../../build/npm/update-grammar.js jeff-hykin/better-go-syntax source/generated.tmLanguage.json ./syntaxes/go.tmLanguage.json"
1113
},
1214
"contributes": {
13-
"languages": [{
14-
"id": "go",
15-
"extensions": [ ".go" ],
16-
"aliases": [ "Go" ],
17-
"configuration": "./language-configuration.json"
18-
}],
19-
"grammars": [{
20-
"language": "go",
21-
"scopeName": "source.go",
22-
"path": "./syntaxes/go.tmLanguage.json"
23-
}],
15+
"languages": [
16+
{
17+
"id": "go",
18+
"extensions": [
19+
".go"
20+
],
21+
"aliases": [
22+
"Go"
23+
],
24+
"configuration": "./language-configuration.json"
25+
}
26+
],
27+
"grammars": [
28+
{
29+
"language": "go",
30+
"scopeName": "source.go",
31+
"path": "./syntaxes/go.tmLanguage.json"
32+
}
33+
],
2434
"configurationDefaults": {
2535
"[go]": {
2636
"editor.insertSpaces": false
2737
}
2838
}
2939
}
30-
}
40+
}

extensions/go/syntaxes/go.tmLanguage.json

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
{
22
"information_for_contributors": [
3-
"This file has been converted from https://github.com/atom/language-go/blob/master/grammars/go.cson",
3+
"This file has been converted from https://github.com/jeff-hykin/better-go-syntax/blob/master/source/generated.tmLanguage.json",
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/atom/language-go/commit/b6fd68f74efa109679e31fe6f4a41ac105262d0e",
7+
"version": "https://github.com/jeff-hykin/better-go-syntax/commit/54ff898316f8647d77ffcf83880a9556445326f1",
88
"name": "Go",
99
"scopeName": "source.go",
10-
"comment": "Go language",
1110
"patterns": [
11+
{
12+
"include": "#comments"
13+
},
1214
{
1315
"include": "#comments"
1416
},
@@ -350,24 +352,29 @@
350352
"comments": {
351353
"patterns": [
352354
{
353-
"begin": "/\\*",
354-
"end": "\\*/",
355-
"captures": {
356-
"0": {
355+
"name": "comment.block.go",
356+
"begin": "(\\/\\*)",
357+
"beginCaptures": {
358+
"1": {
357359
"name": "punctuation.definition.comment.go"
358360
}
359361
},
360-
"name": "comment.block.go"
362+
"end": "(\\*\\/)",
363+
"endCaptures": {
364+
"1": {
365+
"name": "punctuation.definition.comment.go"
366+
}
367+
}
361368
},
362369
{
363-
"begin": "//",
370+
"name": "comment.line.double-slash.go",
371+
"begin": "(\\/\\/)",
364372
"beginCaptures": {
365-
"0": {
373+
"1": {
366374
"name": "punctuation.definition.comment.go"
367375
}
368376
},
369-
"end": "$",
370-
"name": "comment.line.double-slash.go"
377+
"end": "(?:\\n|$)"
371378
}
372379
]
373380
},

0 commit comments

Comments
 (0)