Skip to content

Commit

Permalink
Merge pull request #1 from bmalehorn/syntax-highlighting
Browse files Browse the repository at this point in the history
add syntax highlighting
  • Loading branch information
jasonnutter committed Jan 19, 2019
2 parents 4af39dc + 219dee0 commit c9a663a
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ VS Code extension to display the code owners for the current file, as defined in

## Features

### Syntax highlighting

![](./img/syntax_highlighting.png)

### Status bar

![](./img/status_bar_none.png)
Expand Down
Binary file added img/syntax_highlighting.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions language-configuration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"comments": {
"lineComment": "#"
}
}
24 changes: 22 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"url": "https://github.com/jasonnutter/vscode-codeowners"
},
"license": "MIT",
"version": "1.0.0",
"version": "1.0.1",
"engines": {
"vscode": "^1.29.0"
},
Expand All @@ -24,6 +24,26 @@
"command": "vscode-codeowners.show-owners",
"title": "CODEOWNERS: Show owners of current file"
}
],
"languages": [
{
"id": "codeowners",
"aliases": [
"CODEOWNERS",
"codeowners"
],
"filenames": [
"CODEOWNERS"
],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "codeowners",
"scopeName": "text.codeowners",
"path": "./syntaxes/codeowners.tmLanguage.json"
}
]
},
"scripts": {
Expand All @@ -40,4 +60,4 @@
"dependencies": {
"codeowners": "^4.0.2"
}
}
}
39 changes: 39 additions & 0 deletions syntaxes/codeowners.tmLanguage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "codeowners",
"patterns": [
{
"include": "#comment"
},
{
"include": "#pattern"
},
{
"include": "#owner"
}
],
"repository": {
"comment": {
"patterns": [
{
"begin": "^\\s*#",
"captures": {
"0": {
"name": "punctuation.definition.comment.codeowners"
}
},
"end": "$",
"name": "comment.line.codeowners"
}
]
},
"pattern": {
"match": "^\\s*(\\S+)",
"name": "variable.other.codeowners"
},
"owner": {
"match": "\\S*@\\S+",
"name": "storage.type.function.codeowners"
}
},
"scopeName": "text.codeowners"
}

0 comments on commit c9a663a

Please sign in to comment.