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