/
source.solution.js
127 lines (126 loc) · 3.72 KB
/
source.solution.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
// This is a TextMate grammar distributed by `starry-night`.
// This grammar is developed at
// <https://github.com/Nixinova/NovaGrammars>
// and licensed `isc`.
// See <https://github.com/wooorm/starry-night> for more info.
/** @type {import('../lib/index.js').Grammar} */
const grammar = {
extensions: ['.sln'],
names: ['microsoft-visual-studio-solution'],
patterns: [{include: '#main'}],
repository: {
booleans: {
patterns: [
{match: 'TRUE|FALSE', name: 'constant.language.boolean.solution'}
]
},
functions: {
patterns: [
{
begin: '(?:Project|GlobalSection|Global)',
beginCaptures: {0: {name: 'keyword.block.start.solution'}},
end: 'End(?:Project|GlobalSection|Global)',
endCaptures: {0: {name: 'keyword.block.start.solution'}},
name: 'meta.block.solution',
patterns: [{include: '#main'}]
},
{
begin: '\\(',
beginCaptures: {
0: {name: 'punctuation.section.parens.begin.solution'}
},
end: '\\)',
endCaptures: {0: {name: 'punctuation.section.parens.end.solution'}},
name: 'meta.parens.solution',
patterns: [{include: '#strings'}, {include: '#variables'}]
}
]
},
header: {
patterns: [
{
begin: 'Microsoft Visual Studio Solution File',
end: '$',
name: 'entity.other.header.format.solution'
},
{
begin: '#',
beginCaptures: {0: {name: 'punctuation.definition.header.solution'}},
end: '$',
name: 'entity.other.header.major-version.solution'
}
]
},
main: {
patterns: [
{include: '#header'},
{include: '#functions'},
{include: '#variables'},
{include: '#strings'},
{include: '#numbers'},
{include: '#booleans'},
{include: '#punct'}
]
},
numbers: {
patterns: [
{match: '\\d+(?:\\.\\d+)*', name: 'string.unquoted.version.solution'}
]
},
punct: {
patterns: [
{match: ',', name: 'punctuation.separator.attributes.solution'},
{match: '.', name: 'punctuation.accessor.solution'}
]
},
strings: {
patterns: [
{
begin: '"',
beginCaptures: {0: {name: 'punctuation.other.string.begin.solution'}},
end: '"',
endCaptures: {0: {name: 'punctuation.other.string.end.solution'}},
name: 'string.quoted.double.solution'
},
{
begin: '{',
beginCaptures: {0: {name: 'punctuation.other.guid.begin.solution'}},
end: '}',
endCaptures: {0: {name: 'punctuation.other.guid.end.solution'}},
name: 'string.quoted.other.guid.solution'
}
]
},
variables: {
patterns: [
{
captures: {
0: {name: 'variable.other.solution'},
1: {name: 'punctuation.separator.declaration.solution'}
},
match: '(?<![.|])([A-Za-z]+)\\s*(=)',
name: 'meta.generic.variable.other.solution'
},
{
captures: {
0: {name: 'variable.language.property.solution'},
1: {name: 'punctuation.separator.property.solution'}
},
match: '([A-Za-z]+)\\s*(\\|)',
name: 'meta.generic.variable.property.solution'
},
{
match: '(?<=[.|])\\s*[A-Za-z0-9 ]+',
name: 'variable.other.member.solution'
},
{
match: '(?:pre|post)Solution',
name: 'variable.language.setting.solution'
},
{match: '[A-Za-z]+', name: 'variable.other.solution'}
]
}
},
scopeName: 'source.solution'
}
export default grammar