vscode-css-languageservice 5.3.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/README.md +1 -0
- package/lib/esm/beautify/beautify-css.js +57 -15
- package/lib/esm/cssLanguageService.d.ts +37 -37
- package/lib/esm/cssLanguageService.js +72 -75
- package/lib/esm/cssLanguageTypes.d.ts +238 -228
- package/lib/esm/cssLanguageTypes.js +42 -42
- package/lib/esm/data/webCustomData.js +21965 -21959
- package/lib/esm/languageFacts/builtinData.js +142 -142
- package/lib/esm/languageFacts/colors.js +469 -472
- package/lib/esm/languageFacts/dataManager.js +88 -92
- package/lib/esm/languageFacts/dataProvider.js +73 -79
- package/lib/esm/languageFacts/entry.js +137 -138
- package/lib/esm/languageFacts/facts.js +8 -8
- package/lib/esm/parser/cssErrors.js +48 -50
- package/lib/esm/parser/cssNodes.js +1502 -2019
- package/lib/esm/parser/cssParser.js +1534 -1566
- package/lib/esm/parser/cssScanner.js +592 -599
- package/lib/esm/parser/cssSymbolScope.js +311 -341
- package/lib/esm/parser/lessParser.js +714 -740
- package/lib/esm/parser/lessScanner.js +57 -78
- package/lib/esm/parser/scssErrors.js +18 -20
- package/lib/esm/parser/scssParser.js +796 -818
- package/lib/esm/parser/scssScanner.js +95 -116
- package/lib/esm/services/cssCodeActions.js +77 -81
- package/lib/esm/services/cssCompletion.js +1054 -1149
- package/lib/esm/services/cssFolding.js +190 -193
- package/lib/esm/services/cssFormatter.js +136 -117
- package/lib/esm/services/cssHover.js +148 -151
- package/lib/esm/services/cssNavigation.js +378 -470
- package/lib/esm/services/cssSelectionRange.js +47 -47
- package/lib/esm/services/cssValidation.js +41 -44
- package/lib/esm/services/lessCompletion.js +378 -397
- package/lib/esm/services/lint.js +518 -532
- package/lib/esm/services/lintRules.js +76 -83
- package/lib/esm/services/lintUtil.js +196 -205
- package/lib/esm/services/pathCompletion.js +157 -231
- package/lib/esm/services/scssCompletion.js +354 -378
- package/lib/esm/services/scssNavigation.js +82 -154
- package/lib/esm/services/selectorPrinting.js +492 -536
- package/lib/esm/utils/arrays.js +40 -46
- package/lib/esm/utils/objects.js +11 -11
- package/lib/esm/utils/resources.js +11 -24
- package/lib/esm/utils/strings.js +102 -104
- package/lib/umd/beautify/beautify-css.js +57 -15
- package/lib/umd/cssLanguageService.d.ts +37 -37
- package/lib/umd/cssLanguageService.js +99 -102
- package/lib/umd/cssLanguageTypes.d.ts +238 -228
- package/lib/umd/cssLanguageTypes.js +89 -88
- package/lib/umd/data/webCustomData.js +21978 -21972
- package/lib/umd/languageFacts/builtinData.js +154 -154
- package/lib/umd/languageFacts/colors.js +492 -495
- package/lib/umd/languageFacts/dataManager.js +101 -104
- package/lib/umd/languageFacts/dataProvider.js +86 -91
- package/lib/umd/languageFacts/entry.js +152 -153
- package/lib/umd/languageFacts/facts.js +29 -29
- package/lib/umd/parser/cssErrors.js +61 -62
- package/lib/umd/parser/cssNodes.js +1587 -2034
- package/lib/umd/parser/cssParser.js +1547 -1578
- package/lib/umd/parser/cssScanner.js +606 -611
- package/lib/umd/parser/cssSymbolScope.js +328 -353
- package/lib/umd/parser/lessParser.js +727 -752
- package/lib/umd/parser/lessScanner.js +70 -90
- package/lib/umd/parser/scssErrors.js +31 -32
- package/lib/umd/parser/scssParser.js +809 -830
- package/lib/umd/parser/scssScanner.js +108 -128
- package/lib/umd/services/cssCodeActions.js +90 -93
- package/lib/umd/services/cssCompletion.js +1067 -1161
- package/lib/umd/services/cssFolding.js +203 -206
- package/lib/umd/services/cssFormatter.js +150 -131
- package/lib/umd/services/cssHover.js +161 -163
- package/lib/umd/services/cssNavigation.js +391 -482
- package/lib/umd/services/cssSelectionRange.js +60 -60
- package/lib/umd/services/cssValidation.js +54 -56
- package/lib/umd/services/lessCompletion.js +391 -409
- package/lib/umd/services/lint.js +531 -544
- package/lib/umd/services/lintRules.js +91 -95
- package/lib/umd/services/lintUtil.js +210 -218
- package/lib/umd/services/pathCompletion.js +171 -244
- package/lib/umd/services/scssCompletion.js +367 -390
- package/lib/umd/services/scssNavigation.js +95 -166
- package/lib/umd/services/selectorPrinting.js +510 -550
- package/lib/umd/utils/arrays.js +55 -61
- package/lib/umd/utils/objects.js +25 -25
- package/lib/umd/utils/resources.js +26 -39
- package/lib/umd/utils/strings.js +120 -122
- package/package.json +11 -11
|
@@ -1,397 +1,378 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
'use strict';
|
|
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
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
'name': 'difference',
|
|
380
|
-
'example': 'difference(@color1, @color2);'
|
|
381
|
-
},
|
|
382
|
-
{
|
|
383
|
-
'name': 'exclusion',
|
|
384
|
-
'example': 'exclusion(@color1, @color2);'
|
|
385
|
-
},
|
|
386
|
-
{
|
|
387
|
-
'name': 'average',
|
|
388
|
-
'example': 'average(@color1, @color2);'
|
|
389
|
-
},
|
|
390
|
-
{
|
|
391
|
-
'name': 'negation',
|
|
392
|
-
'example': 'negation(@color1, @color2);'
|
|
393
|
-
}
|
|
394
|
-
];
|
|
395
|
-
return LESSCompletion;
|
|
396
|
-
}(CSSCompletion));
|
|
397
|
-
export { LESSCompletion };
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
'use strict';
|
|
6
|
+
import { CSSCompletion } from './cssCompletion';
|
|
7
|
+
import { CompletionItemKind, InsertTextFormat, TextEdit } from '../cssLanguageTypes';
|
|
8
|
+
import * as nls from 'vscode-nls';
|
|
9
|
+
const localize = nls.loadMessageBundle();
|
|
10
|
+
export class LESSCompletion extends CSSCompletion {
|
|
11
|
+
constructor(lsOptions, cssDataManager) {
|
|
12
|
+
super('@', lsOptions, cssDataManager);
|
|
13
|
+
}
|
|
14
|
+
createFunctionProposals(proposals, existingNode, sortToEnd, result) {
|
|
15
|
+
for (const p of proposals) {
|
|
16
|
+
const item = {
|
|
17
|
+
label: p.name,
|
|
18
|
+
detail: p.example,
|
|
19
|
+
documentation: p.description,
|
|
20
|
+
textEdit: TextEdit.replace(this.getCompletionRange(existingNode), p.name + '($0)'),
|
|
21
|
+
insertTextFormat: InsertTextFormat.Snippet,
|
|
22
|
+
kind: CompletionItemKind.Function
|
|
23
|
+
};
|
|
24
|
+
if (sortToEnd) {
|
|
25
|
+
item.sortText = 'z';
|
|
26
|
+
}
|
|
27
|
+
result.items.push(item);
|
|
28
|
+
}
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
getTermProposals(entry, existingNode, result) {
|
|
32
|
+
let functions = LESSCompletion.builtInProposals;
|
|
33
|
+
if (entry) {
|
|
34
|
+
functions = functions.filter(f => !f.type || !entry.restrictions || entry.restrictions.indexOf(f.type) !== -1);
|
|
35
|
+
}
|
|
36
|
+
this.createFunctionProposals(functions, existingNode, true, result);
|
|
37
|
+
return super.getTermProposals(entry, existingNode, result);
|
|
38
|
+
}
|
|
39
|
+
getColorProposals(entry, existingNode, result) {
|
|
40
|
+
this.createFunctionProposals(LESSCompletion.colorProposals, existingNode, false, result);
|
|
41
|
+
return super.getColorProposals(entry, existingNode, result);
|
|
42
|
+
}
|
|
43
|
+
getCompletionsForDeclarationProperty(declaration, result) {
|
|
44
|
+
this.getCompletionsForSelector(null, true, result);
|
|
45
|
+
return super.getCompletionsForDeclarationProperty(declaration, result);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
LESSCompletion.builtInProposals = [
|
|
49
|
+
// Boolean functions
|
|
50
|
+
{
|
|
51
|
+
'name': 'if',
|
|
52
|
+
'example': 'if(condition, trueValue [, falseValue]);',
|
|
53
|
+
'description': localize('less.builtin.if', 'returns one of two values depending on a condition.')
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
'name': 'boolean',
|
|
57
|
+
'example': 'boolean(condition);',
|
|
58
|
+
'description': localize('less.builtin.boolean', '"store" a boolean test for later evaluation in a guard or if().')
|
|
59
|
+
},
|
|
60
|
+
// List functions
|
|
61
|
+
{
|
|
62
|
+
'name': 'length',
|
|
63
|
+
'example': 'length(@list);',
|
|
64
|
+
'description': localize('less.builtin.length', 'returns the number of elements in a value list')
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
'name': 'extract',
|
|
68
|
+
'example': 'extract(@list, index);',
|
|
69
|
+
'description': localize('less.builtin.extract', 'returns a value at the specified position in the list')
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
'name': 'range',
|
|
73
|
+
'example': 'range([start, ] end [, step]);',
|
|
74
|
+
'description': localize('less.builtin.range', 'generate a list spanning a range of values')
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
'name': 'each',
|
|
78
|
+
'example': 'each(@list, ruleset);',
|
|
79
|
+
'description': localize('less.builtin.each', 'bind the evaluation of a ruleset to each member of a list.')
|
|
80
|
+
},
|
|
81
|
+
// Other built-ins
|
|
82
|
+
{
|
|
83
|
+
'name': 'escape',
|
|
84
|
+
'example': 'escape(@string);',
|
|
85
|
+
'description': localize('less.builtin.escape', 'URL encodes a string')
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
'name': 'e',
|
|
89
|
+
'example': 'e(@string);',
|
|
90
|
+
'description': localize('less.builtin.e', 'escape string content')
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
'name': 'replace',
|
|
94
|
+
'example': 'replace(@string, @pattern, @replacement[, @flags]);',
|
|
95
|
+
'description': localize('less.builtin.replace', 'string replace')
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
'name': 'unit',
|
|
99
|
+
'example': 'unit(@dimension, [@unit: \'\']);',
|
|
100
|
+
'description': localize('less.builtin.unit', 'remove or change the unit of a dimension')
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
'name': 'color',
|
|
104
|
+
'example': 'color(@string);',
|
|
105
|
+
'description': localize('less.builtin.color', 'parses a string to a color'),
|
|
106
|
+
'type': 'color'
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
'name': 'convert',
|
|
110
|
+
'example': 'convert(@value, unit);',
|
|
111
|
+
'description': localize('less.builtin.convert', 'converts numbers from one type into another')
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
'name': 'data-uri',
|
|
115
|
+
'example': 'data-uri([mimetype,] url);',
|
|
116
|
+
'description': localize('less.builtin.data-uri', 'inlines a resource and falls back to `url()`'),
|
|
117
|
+
'type': 'url'
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
'name': 'abs',
|
|
121
|
+
'description': localize('less.builtin.abs', 'absolute value of a number'),
|
|
122
|
+
'example': 'abs(number);'
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
'name': 'acos',
|
|
126
|
+
'description': localize('less.builtin.acos', 'arccosine - inverse of cosine function'),
|
|
127
|
+
'example': 'acos(number);'
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
'name': 'asin',
|
|
131
|
+
'description': localize('less.builtin.asin', 'arcsine - inverse of sine function'),
|
|
132
|
+
'example': 'asin(number);'
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
'name': 'ceil',
|
|
136
|
+
'example': 'ceil(@number);',
|
|
137
|
+
'description': localize('less.builtin.ceil', 'rounds up to an integer')
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
'name': 'cos',
|
|
141
|
+
'description': localize('less.builtin.cos', 'cosine function'),
|
|
142
|
+
'example': 'cos(number);'
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
'name': 'floor',
|
|
146
|
+
'description': localize('less.builtin.floor', 'rounds down to an integer'),
|
|
147
|
+
'example': 'floor(@number);'
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
'name': 'percentage',
|
|
151
|
+
'description': localize('less.builtin.percentage', 'converts to a %, e.g. 0.5 > 50%'),
|
|
152
|
+
'example': 'percentage(@number);',
|
|
153
|
+
'type': 'percentage'
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
'name': 'round',
|
|
157
|
+
'description': localize('less.builtin.round', 'rounds a number to a number of places'),
|
|
158
|
+
'example': 'round(number, [places: 0]);'
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
'name': 'sqrt',
|
|
162
|
+
'description': localize('less.builtin.sqrt', 'calculates square root of a number'),
|
|
163
|
+
'example': 'sqrt(number);'
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
'name': 'sin',
|
|
167
|
+
'description': localize('less.builtin.sin', 'sine function'),
|
|
168
|
+
'example': 'sin(number);'
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
'name': 'tan',
|
|
172
|
+
'description': localize('less.builtin.tan', 'tangent function'),
|
|
173
|
+
'example': 'tan(number);'
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
'name': 'atan',
|
|
177
|
+
'description': localize('less.builtin.atan', 'arctangent - inverse of tangent function'),
|
|
178
|
+
'example': 'atan(number);'
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
'name': 'pi',
|
|
182
|
+
'description': localize('less.builtin.pi', 'returns pi'),
|
|
183
|
+
'example': 'pi();'
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
'name': 'pow',
|
|
187
|
+
'description': localize('less.builtin.pow', 'first argument raised to the power of the second argument'),
|
|
188
|
+
'example': 'pow(@base, @exponent);'
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
'name': 'mod',
|
|
192
|
+
'description': localize('less.builtin.mod', 'first argument modulus second argument'),
|
|
193
|
+
'example': 'mod(number, number);'
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
'name': 'min',
|
|
197
|
+
'description': localize('less.builtin.min', 'returns the lowest of one or more values'),
|
|
198
|
+
'example': 'min(@x, @y);'
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
'name': 'max',
|
|
202
|
+
'description': localize('less.builtin.max', 'returns the lowest of one or more values'),
|
|
203
|
+
'example': 'max(@x, @y);'
|
|
204
|
+
}
|
|
205
|
+
];
|
|
206
|
+
LESSCompletion.colorProposals = [
|
|
207
|
+
{
|
|
208
|
+
'name': 'argb',
|
|
209
|
+
'example': 'argb(@color);',
|
|
210
|
+
'description': localize('less.builtin.argb', 'creates a #AARRGGBB')
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
'name': 'hsl',
|
|
214
|
+
'example': 'hsl(@hue, @saturation, @lightness);',
|
|
215
|
+
'description': localize('less.builtin.hsl', 'creates a color')
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
'name': 'hsla',
|
|
219
|
+
'example': 'hsla(@hue, @saturation, @lightness, @alpha);',
|
|
220
|
+
'description': localize('less.builtin.hsla', 'creates a color')
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
'name': 'hsv',
|
|
224
|
+
'example': 'hsv(@hue, @saturation, @value);',
|
|
225
|
+
'description': localize('less.builtin.hsv', 'creates a color')
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
'name': 'hsva',
|
|
229
|
+
'example': 'hsva(@hue, @saturation, @value, @alpha);',
|
|
230
|
+
'description': localize('less.builtin.hsva', 'creates a color')
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
'name': 'hue',
|
|
234
|
+
'example': 'hue(@color);',
|
|
235
|
+
'description': localize('less.builtin.hue', 'returns the `hue` channel of `@color` in the HSL space')
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
'name': 'saturation',
|
|
239
|
+
'example': 'saturation(@color);',
|
|
240
|
+
'description': localize('less.builtin.saturation', 'returns the `saturation` channel of `@color` in the HSL space')
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
'name': 'lightness',
|
|
244
|
+
'example': 'lightness(@color);',
|
|
245
|
+
'description': localize('less.builtin.lightness', 'returns the `lightness` channel of `@color` in the HSL space')
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
'name': 'hsvhue',
|
|
249
|
+
'example': 'hsvhue(@color);',
|
|
250
|
+
'description': localize('less.builtin.hsvhue', 'returns the `hue` channel of `@color` in the HSV space')
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
'name': 'hsvsaturation',
|
|
254
|
+
'example': 'hsvsaturation(@color);',
|
|
255
|
+
'description': localize('less.builtin.hsvsaturation', 'returns the `saturation` channel of `@color` in the HSV space')
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
'name': 'hsvvalue',
|
|
259
|
+
'example': 'hsvvalue(@color);',
|
|
260
|
+
'description': localize('less.builtin.hsvvalue', 'returns the `value` channel of `@color` in the HSV space')
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
'name': 'red',
|
|
264
|
+
'example': 'red(@color);',
|
|
265
|
+
'description': localize('less.builtin.red', 'returns the `red` channel of `@color`')
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
'name': 'green',
|
|
269
|
+
'example': 'green(@color);',
|
|
270
|
+
'description': localize('less.builtin.green', 'returns the `green` channel of `@color`')
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
'name': 'blue',
|
|
274
|
+
'example': 'blue(@color);',
|
|
275
|
+
'description': localize('less.builtin.blue', 'returns the `blue` channel of `@color`')
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
'name': 'alpha',
|
|
279
|
+
'example': 'alpha(@color);',
|
|
280
|
+
'description': localize('less.builtin.alpha', 'returns the `alpha` channel of `@color`')
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
'name': 'luma',
|
|
284
|
+
'example': 'luma(@color);',
|
|
285
|
+
'description': localize('less.builtin.luma', 'returns the `luma` value (perceptual brightness) of `@color`')
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
'name': 'saturate',
|
|
289
|
+
'example': 'saturate(@color, 10%);',
|
|
290
|
+
'description': localize('less.builtin.saturate', 'return `@color` 10% points more saturated')
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
'name': 'desaturate',
|
|
294
|
+
'example': 'desaturate(@color, 10%);',
|
|
295
|
+
'description': localize('less.builtin.desaturate', 'return `@color` 10% points less saturated')
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
'name': 'lighten',
|
|
299
|
+
'example': 'lighten(@color, 10%);',
|
|
300
|
+
'description': localize('less.builtin.lighten', 'return `@color` 10% points lighter')
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
'name': 'darken',
|
|
304
|
+
'example': 'darken(@color, 10%);',
|
|
305
|
+
'description': localize('less.builtin.darken', 'return `@color` 10% points darker')
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
'name': 'fadein',
|
|
309
|
+
'example': 'fadein(@color, 10%);',
|
|
310
|
+
'description': localize('less.builtin.fadein', 'return `@color` 10% points less transparent')
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
'name': 'fadeout',
|
|
314
|
+
'example': 'fadeout(@color, 10%);',
|
|
315
|
+
'description': localize('less.builtin.fadeout', 'return `@color` 10% points more transparent')
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
'name': 'fade',
|
|
319
|
+
'example': 'fade(@color, 50%);',
|
|
320
|
+
'description': localize('less.builtin.fade', 'return `@color` with 50% transparency')
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
'name': 'spin',
|
|
324
|
+
'example': 'spin(@color, 10);',
|
|
325
|
+
'description': localize('less.builtin.spin', 'return `@color` with a 10 degree larger in hue')
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
'name': 'mix',
|
|
329
|
+
'example': 'mix(@color1, @color2, [@weight: 50%]);',
|
|
330
|
+
'description': localize('less.builtin.mix', 'return a mix of `@color1` and `@color2`')
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
'name': 'greyscale',
|
|
334
|
+
'example': 'greyscale(@color);',
|
|
335
|
+
'description': localize('less.builtin.greyscale', 'returns a grey, 100% desaturated color'),
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
'name': 'contrast',
|
|
339
|
+
'example': 'contrast(@color1, [@darkcolor: black], [@lightcolor: white], [@threshold: 43%]);',
|
|
340
|
+
'description': localize('less.builtin.contrast', 'return `@darkcolor` if `@color1 is> 43% luma` otherwise return `@lightcolor`, see notes')
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
'name': 'multiply',
|
|
344
|
+
'example': 'multiply(@color1, @color2);'
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
'name': 'screen',
|
|
348
|
+
'example': 'screen(@color1, @color2);'
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
'name': 'overlay',
|
|
352
|
+
'example': 'overlay(@color1, @color2);'
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
'name': 'softlight',
|
|
356
|
+
'example': 'softlight(@color1, @color2);'
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
'name': 'hardlight',
|
|
360
|
+
'example': 'hardlight(@color1, @color2);'
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
'name': 'difference',
|
|
364
|
+
'example': 'difference(@color1, @color2);'
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
'name': 'exclusion',
|
|
368
|
+
'example': 'exclusion(@color1, @color2);'
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
'name': 'average',
|
|
372
|
+
'example': 'average(@color1, @color2);'
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
'name': 'negation',
|
|
376
|
+
'example': 'negation(@color1, @color2);'
|
|
377
|
+
}
|
|
378
|
+
];
|