Skip to content

Commit c9a663a

Browse files
authored
Merge pull request #1 from bmalehorn/syntax-highlighting
add syntax highlighting
2 parents 4af39dc + 219dee0 commit c9a663a

File tree

5 files changed

+70
-2
lines changed

5 files changed

+70
-2
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ VS Code extension to display the code owners for the current file, as defined in
44

55
## Features
66

7+
### Syntax highlighting
8+
9+
![](./img/syntax_highlighting.png)
10+
711
### Status bar
812

913
![](./img/status_bar_none.png)

img/syntax_highlighting.png

53.1 KB
Loading

language-configuration.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"comments": {
3+
"lineComment": "#"
4+
}
5+
}

package.json

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/jasonnutter/vscode-codeowners"
88
},
99
"license": "MIT",
10-
"version": "1.0.0",
10+
"version": "1.0.1",
1111
"engines": {
1212
"vscode": "^1.29.0"
1313
},
@@ -24,6 +24,26 @@
2424
"command": "vscode-codeowners.show-owners",
2525
"title": "CODEOWNERS: Show owners of current file"
2626
}
27+
],
28+
"languages": [
29+
{
30+
"id": "codeowners",
31+
"aliases": [
32+
"CODEOWNERS",
33+
"codeowners"
34+
],
35+
"filenames": [
36+
"CODEOWNERS"
37+
],
38+
"configuration": "./language-configuration.json"
39+
}
40+
],
41+
"grammars": [
42+
{
43+
"language": "codeowners",
44+
"scopeName": "text.codeowners",
45+
"path": "./syntaxes/codeowners.tmLanguage.json"
46+
}
2747
]
2848
},
2949
"scripts": {
@@ -40,4 +60,4 @@
4060
"dependencies": {
4161
"codeowners": "^4.0.2"
4262
}
43-
}
63+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "codeowners",
3+
"patterns": [
4+
{
5+
"include": "#comment"
6+
},
7+
{
8+
"include": "#pattern"
9+
},
10+
{
11+
"include": "#owner"
12+
}
13+
],
14+
"repository": {
15+
"comment": {
16+
"patterns": [
17+
{
18+
"begin": "^\\s*#",
19+
"captures": {
20+
"0": {
21+
"name": "punctuation.definition.comment.codeowners"
22+
}
23+
},
24+
"end": "$",
25+
"name": "comment.line.codeowners"
26+
}
27+
]
28+
},
29+
"pattern": {
30+
"match": "^\\s*(\\S+)",
31+
"name": "variable.other.codeowners"
32+
},
33+
"owner": {
34+
"match": "\\S*@\\S+",
35+
"name": "storage.type.function.codeowners"
36+
}
37+
},
38+
"scopeName": "text.codeowners"
39+
}

0 commit comments

Comments
 (0)