vscode-css-languageservice 6.3.9 → 7.0.0-next.1

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