-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
text.codeowners.js
68 lines (66 loc) · 1.73 KB
/
text.codeowners.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// This is a TextMate grammar distributed by `starry-night`.
// This grammar is developed at
// <https://github.com/Alhadis/language-etc>
// and licensed `isc`.
// See <https://github.com/wooorm/starry-night> for more info.
/**
* @import {Grammar} from '@wooorm/starry-night'
*/
/** @type {Grammar} */
const grammar = {
dependencies: ['etc'],
extensions: [],
names: ['codeowners'],
patterns: [{include: '#main'}],
repository: {
main: {
patterns: [
{include: 'etc#comment'},
{include: 'etc#esc'},
{include: '#pattern'}
]
},
owner: {
captures: {
1: {name: 'keyword.operator.mention.codeowners'},
2: {name: 'variable.assignment.team'}
},
match: '(@)((?:[-.\\w]+/)?[-.\\w]+)(?=$| |#)',
name: 'meta.owner.codeowners'
},
pattern: {
begin: '^((?:[^#\\s\\\\]|\\\\[^#])++)',
beginCaptures: {
1: {
patterns: [
{
match: '\\*\\*',
name: 'keyword.operator.glob.wildcard.globstar.codeowners'
},
{match: '[*?]', name: 'keyword.operator.glob.wildcard.codeowners'},
{
match: '/',
name: 'punctuation.directory.separator.meta.codeowners'
},
{
match: '[^\\[\\]\\\\*?#/\\s]+',
name: 'entity.other.file.name.codeowners'
}
]
}
},
end: '$|(?=#)',
name: 'meta.pattern.codeowners',
patterns: [
{include: '#comment'},
{
begin: '\\s',
end: '(?=$|#)',
patterns: [{include: 'etc#emailUnquoted'}, {include: '#owner'}]
}
]
}
},
scopeName: 'text.codeowners'
}
export default grammar