Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

Commit e21da97

Browse files
Reformat.
1 parent faae437 commit e21da97

File tree

2 files changed

+103
-92
lines changed

2 files changed

+103
-92
lines changed

Diff for: package.json

+43-34
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,44 @@
11
{
2-
"name": "pine-script-syntax-highlighting",
3-
"displayName": "Pine Script Syntax Highlighting",
4-
"description": "Syntax Highlighting for Pine Script",
5-
"version": "0.1.5",
6-
"publisher": "leifcr",
7-
"license": "MIT",
8-
"engines": {
9-
"vscode": "^1.27.0"
10-
},
11-
"categories": [
12-
"Programming Languages"
13-
],
14-
"contributes": {
15-
"languages": [{
16-
"id": "pine",
17-
"aliases": ["Pine Script", "pine"],
18-
"extensions": [".pine"],
19-
"configuration": "./language-configuration.json"
20-
}],
21-
"grammars": [{
22-
"language": "pine",
23-
"scopeName": "source.pine",
24-
"path": "./syntaxes/pine.tmLanguage.json"
25-
}]
26-
},
27-
"icon": "images/pinetreeicon.png",
28-
"repository": {
29-
"type": "git",
30-
"url": "https://github.com/leifcr/pine-script-syntax-highlighting.git"
31-
},
32-
"bugs": {
33-
"url": "https://github.com/leifcr/pine-script-syntax-highlighting/issues"
34-
}
35-
}
2+
"name": "pine-script-syntax-highlighting",
3+
"displayName": "Pine Script Syntax Highlighting",
4+
"description": "Syntax Highlighting for Pine Script",
5+
"version": "0.1.5",
6+
"publisher": "leifcr",
7+
"license": "MIT",
8+
"engines": {
9+
"vscode": "^1.27.0"
10+
},
11+
"categories": [
12+
"Programming Languages"
13+
],
14+
"contributes": {
15+
"languages": [
16+
{
17+
"id": "pine",
18+
"aliases": [
19+
"Pine Script",
20+
"pine"
21+
],
22+
"extensions": [
23+
".pine"
24+
],
25+
"configuration": "./language-configuration.json"
26+
}
27+
],
28+
"grammars": [
29+
{
30+
"language": "pine",
31+
"scopeName": "source.pine",
32+
"path": "./syntaxes/pine.tmLanguage.json"
33+
}
34+
]
35+
},
36+
"icon": "images/pinetreeicon.png",
37+
"repository": {
38+
"type": "git",
39+
"url": "https://github.com/leifcr/pine-script-syntax-highlighting.git"
40+
},
41+
"bugs": {
42+
"url": "https://github.com/leifcr/pine-script-syntax-highlighting/issues"
43+
}
44+
}

Diff for: syntaxes/pine.tmLanguage.json

+60-58
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
{
2-
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
3-
"name": "Pine Script",
4-
"patterns": [
2+
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
3+
"name": "Pine Script",
4+
"patterns": [
55
{
66
"match": "//.*",
77
"name": "comment.pine"
88
},
99
{
10-
"include": "#constants"
11-
},
10+
"include": "#constants"
11+
},
1212
{
13-
"include": "#functions"
14-
},
13+
"include": "#functions"
14+
},
1515
{
16-
"include": "#operators"
17-
},
16+
"include": "#operators"
17+
},
1818
{
19-
"include": "#keywords"
20-
},
21-
{
22-
"include": "#strings"
23-
}
24-
],
25-
"repository": {
19+
"include": "#keywords"
20+
},
21+
{
22+
"include": "#strings"
23+
}
24+
],
25+
"repository": {
2626
"strings": {
2727
"patterns": [
2828
{
@@ -38,7 +38,7 @@
3838
"name": "punctuation.definition.string.end.pine"
3939
}
4040
},
41-
"name" : "string.quoted.double.pine",
41+
"name": "string.quoted.double.pine",
4242
"patterns": [
4343
{
4444
"match": "\\\\.",
@@ -50,7 +50,7 @@
5050
"begin": "'",
5151
"beginCaptures": {
5252
"1": {
53-
"name": "punctuation.definition.string.begin.pine"
53+
"name": "punctuation.definition.string.begin.pine"
5454
}
5555
},
5656
"end": "'",
@@ -59,7 +59,7 @@
5959
"name": "punctuation.definition.string.end.pine"
6060
}
6161
},
62-
"name" : "string.quoted.double.pine",
62+
"name": "string.quoted.double.pine",
6363
"patterns": [
6464
{
6565
"match": "\\\\.",
@@ -74,50 +74,50 @@
7474
{
7575
"match": "\\b(abs|acos|alertcondition|alma|asin|atan|atr|avg|bar(color|since)|bb|bbw|bgcolor|bool|cci|ceil|change|cmo|cog|color|color\\.new|correlation|cos|cross|crossover|crossunder|cum|dayofmonth|dayofweek|dev|dmi|ema|exp|falling|fill|financial|fixnan|float|floor|heikinashi|highest|highestbars|hline|hma|hour|iff|input|int|kagi|kc|kcw|label|line|linebreak|linreg|log|log10|lowest|lowestbars|macd|max|max_bars_back|mfi|min|minute|mom|month|na|nz|offset|percentile_linear_interpolation|percentile_nearest_rank|pivothigh|pivotlow|plot|plotarrow|plotbar|plotcandle|plotchar|plotshape|pointfigure|pow|quandl|renko|rising|rma|roc|round|rsi|sar|second|security|sign|sin|sma|sqrt|stdev|stoch|str\\.replace_all|strategy|string|study|sum|supertrend|swma|tan|tickerid|time|timestamp|tostring|tr|tsi|valuewhen|variance|vwma|weekofyear|wma|wpr|year)(?=\\()",
7676
"captures": {
77-
"1": {
78-
"name": "support.function.pine"
79-
}
80-
}
77+
"1": {
78+
"name": "support.function.pine"
79+
}
80+
}
8181
},
8282
{
8383
"match": "\\barray\\.(avg|clear|concat|copy|covariance|fill|get|includes|indexof|insert|lastindexof|max|median|min|mode|new_bool|new_color|new_float|new_int|pop|push|remove|reverse|set|shift|size|slice|sort|standardize|stdev|sum|unshift|variance)(?=\\()",
8484
"captures": {
85-
"1": {
86-
"name": "support.function.pine"
87-
}
88-
}
85+
"1": {
86+
"name": "support.function.pine"
87+
}
88+
}
8989
},
9090
{
9191
"match": "\\blabel\\.(delete|get_text|get_x|get_y|new|set_color|set_size|set_text|set_textalign|set_textcolor|set_tooltip|set_x|set_xloc|set_xy|set_y|set_yloc)(?=\\()",
9292
"captures": {
93-
"1": {
94-
"name": "support.function.pine"
95-
}
96-
}
93+
"1": {
94+
"name": "support.function.pine"
95+
}
96+
}
9797
},
9898
{
9999
"match": "\\bline\\.(delete|get_price|get_x1|get_x2|get_y1|get_y2|new|set_color|set_extend|set_style|set_width|set_x1|set_x2|set_xloc|set_xy1|set_xy2|set_y1|set_y2)(?=\\()",
100100
"captures": {
101-
"1": {
102-
"name": "support.function.pine"
103-
}
104-
}
101+
"1": {
102+
"name": "support.function.pine"
103+
}
104+
}
105105
},
106106
{
107107
"match": "\\bstrategy\\.(cancel|cancel_all|close|close_all|entry|exit|order)(?=\\()",
108108
"captures": {
109-
"1": {
110-
"name": "support.function.pine"
111-
}
112-
}
109+
"1": {
110+
"name": "support.function.pine"
111+
}
112+
}
113113
},
114114
{
115115
"match": "\\bstrategy\\.risk\\.(allow_entry_in|max_cons_loss_days|max_drawdown|max_intraday_filled_orders|max_intraday_loss|max_position_size)(?=\\()",
116116
"captures": {
117-
"1": {
118-
"name": "support.function.pine"
119-
}
120-
}
117+
"1": {
118+
"name": "support.function.pine"
119+
}
120+
}
121121
},
122122
{
123123
"match": "[a-zA-Z_][a-zA-Z0-9_]*\\s*(?=\\=)",
@@ -126,18 +126,18 @@
126126
{
127127
"match": "([a-zA-Z_][a-zA-Z0-9_]*)\\(.*\\)\\s(=>)\\s",
128128
"captures": {
129-
"1": {
130-
"name": "support.function.pine"
131-
},
132-
"2": {
133-
"name": "keyword.operator.assignment.pine"
134-
}
135-
}
129+
"1": {
130+
"name": "support.function.pine"
131+
},
132+
"2": {
133+
"name": "keyword.operator.assignment.pine"
134+
}
135+
}
136136
}
137137
]
138138
},
139139
"constants": {
140-
"patterns":[
140+
"patterns": [
141141
{
142142
"match": "\\b(true|false)\\b",
143143
"name": "constant.language.pine"
@@ -301,11 +301,13 @@
301301
]
302302
},
303303
"keywords": {
304-
"patterns": [{
305-
"name": "keyword.control.pine",
306-
"match": "\\b(if|else|while|for|return)\\b"
307-
}]
308-
}
309-
},
310-
"scopeName": "source.pine"
304+
"patterns": [
305+
{
306+
"name": "keyword.control.pine",
307+
"match": "\\b(if|else|while|for|return)\\b"
308+
}
309+
]
310+
}
311+
},
312+
"scopeName": "source.pine"
311313
}

0 commit comments

Comments
 (0)