Skip to content

Commit 35b3e58

Browse files
author
rlewis
committed
FASTBuild syntax highlighter for VSCode
0 parents  commit 35b3e58

8 files changed

Lines changed: 227 additions & 0 deletions

File tree

.vscode/launch.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// A launch configuration that launches the extension inside a new window
2+
{
3+
"version": "0.1.0",
4+
"configurations": [
5+
{
6+
"name": "Launch Extension",
7+
"type": "extensionHost",
8+
"request": "launch",
9+
"runtimeExecutable": "${execPath}",
10+
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ]
11+
}
12+
]
13+
}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Change Log
2+
3+
## [1.0.0] - 2017-08-07
4+
- Initial release

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2017 RoscoP - https://github.com/RoscoP/FASTBuild
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# FASTBuild README
2+
3+
Syntax highlighting for [FASTBuild](http://www.fastbuild.org) configuration (bff) files.
4+
5+
## Release Notes
6+
7+
### 1.0.0
8+
9+
Initial release

language-configuration.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"comments": {
3+
// symbol used for single line comment. Remove this entry if your language does not support line comments
4+
"lineComment": "//",
5+
// symbols used for start and end a block comment. Remove this entry if your language does not support block comments
6+
"blockComment": [ "/*", "*/" ]
7+
},
8+
// symbols used as brackets
9+
"brackets": [
10+
["{", "}"],
11+
["[", "]"],
12+
["(", ")"]
13+
],
14+
// symbols that are auto closed when typing
15+
"autoClosingPairs": [
16+
["{", "}"],
17+
["[", "]"],
18+
["(", ")"],
19+
["\"", "\""],
20+
["'", "'"]
21+
],
22+
// symbols that that can be used to surround a selection
23+
"surroundingPairs": [
24+
["{", "}"],
25+
["[", "]"],
26+
["(", ")"],
27+
["\"", "\""],
28+
["'", "'"]
29+
]
30+
}

media/icon.png

10.2 KB
Loading

package.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "fastbuild",
3+
"displayName": "FASTBuild",
4+
"description": "FASTBuild configuration syntax highlighting",
5+
"version": "1.0.0",
6+
"publisher": "RoscoP",
7+
"engines": {
8+
"vscode": "^1.14.0"
9+
},
10+
"categories": [
11+
"Languages"
12+
],
13+
"icon": "media/icon.png",
14+
"repository": {
15+
"type": "git",
16+
"url": "https://github.com/RoscoP/FASTBuild"
17+
},
18+
"contributes": {
19+
"languages": [{
20+
"id": "fastbuild",
21+
"aliases": ["FASTBuild", "fastbuild"],
22+
"extensions": ["bff"],
23+
"configuration": "./language-configuration.json"
24+
}],
25+
"grammars": [{
26+
"language": "fastbuild",
27+
"scopeName": "source.fastbuild",
28+
"path": "./syntaxes/fastbuild.tmLanguage.json"
29+
}]
30+
}
31+
}

syntaxes/fastbuild.tmLanguage.json

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
3+
"name": "FASTBuild",
4+
"foldingStartMarker": "/\\*\\*(?!\\*)|^(?![^{]*?//|[^{]*?/\\*(?!.*?\\*/.*?\\{)).*?\\{\\s*($|//|/\\*(?!.*?\\*/.*\\S))",
5+
"foldingStopMarker": "(?<!\\*)\\*\\*/|^\\s*\\}",
6+
"patterns": [
7+
{
8+
"include": "#keywords"
9+
},
10+
{
11+
"include": "#functions"
12+
},
13+
{
14+
"include": "#strings_single"
15+
},
16+
{
17+
"include": "#strings_double"
18+
},
19+
{
20+
"include": "#fastbuild_defines"
21+
},
22+
{
23+
"include": "#directives"
24+
},
25+
{
26+
"include": "#defined_variables"
27+
},
28+
{
29+
"include": "#local_variables"
30+
},
31+
{
32+
"include": "#comment"
33+
}
34+
],
35+
"repository": {
36+
"string_highlight": {
37+
"patterns": [{
38+
"name": "constant.character.escape.fastbuild",
39+
"match": "\\^.|\\$[\\w\\d]+\\$|%\\d+"
40+
}]
41+
},
42+
"keywords": {
43+
"patterns": [{
44+
"name": "keyword.operator.fastbuild",
45+
"match": "\\b(\\+\\-/\\*=)\\b"
46+
}]
47+
},
48+
"functions": {
49+
"patterns": [{
50+
"name": "support.function.fastbuild",
51+
"match": "\\b(Alias|Compiler|Copy|CopyDir|CSAssembly|DLL|Exec|Executable|ForEach|Library|ObjectList|Print|RemoveDir|Settings|Test|Unity|Using|VCXProject|VSSolution|XCodeProject)\\b"
52+
}]
53+
},
54+
"strings_single": {
55+
"name": "string.quoted.single.fastbuild",
56+
"begin": "'",
57+
"end": "'",
58+
"patterns": [
59+
{
60+
"include": "#string_highlight"
61+
}
62+
]
63+
},
64+
"strings_double": {
65+
"name": "string.quoted.double.fastbuild",
66+
"begin": "\"",
67+
"end": "\"",
68+
"patterns": [
69+
{
70+
"include": "#string_highlight"
71+
}
72+
]
73+
},
74+
"fastbuild_defines": {
75+
"patterns": [
76+
{
77+
"name": "variable.language.fastbuild",
78+
"match": "__WINDOWS__|__OSX__|__LINUX__"
79+
}
80+
]
81+
},
82+
"directives": {
83+
"patterns": [{
84+
"name": "keyword.other.fastbuild",
85+
"match": "#(undef|if|else|endif|exists|import|include|once)"
86+
}]
87+
},
88+
"defined_variables": {
89+
"patterns": [{
90+
"name": "keyword.other.fastbuild",
91+
"match": "#define\\s+([\\w\\d]+)",
92+
"captures": {
93+
"1": {
94+
"name": "meta.parameter.type.variable.fastbuild"
95+
}
96+
}
97+
}]
98+
},
99+
"local_variables": {
100+
"patterns": [{
101+
"match": "[\\s^]\\.(['\"]?)([\\w\\d\\$]+)\\1?",
102+
"captures": {
103+
"2": {
104+
"name": "variable.other.fastbuild"
105+
}
106+
}
107+
}]
108+
},
109+
"comment": {
110+
"patterns": [
111+
{
112+
"name": "comment.line.double-slash.fastbuild",
113+
"match": "(//|;).*"
114+
}
115+
]
116+
}
117+
},
118+
"scopeName": "source.fastbuild"
119+
}

0 commit comments

Comments
 (0)