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