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
@@ -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,52 +14,48 @@ var __extends = (this && this.__extends) || (function () {
29
14
  'use strict';
30
15
  Object.defineProperty(exports, "__esModule", { value: true });
31
16
  exports.SCSSCompletion = void 0;
32
- var cssCompletion_1 = require("./cssCompletion");
33
- var nodes = require("../parser/cssNodes");
34
- var cssLanguageTypes_1 = require("../cssLanguageTypes");
35
- var nls = require("vscode-nls");
36
- var localize = nls.loadMessageBundle();
37
- var SCSSCompletion = /** @class */ (function (_super) {
38
- __extends(SCSSCompletion, _super);
39
- function SCSSCompletion(lsServiceOptions, cssDataManager) {
40
- var _this = _super.call(this, '$', lsServiceOptions, cssDataManager) || this;
17
+ const cssCompletion_1 = require("./cssCompletion");
18
+ const nodes = require("../parser/cssNodes");
19
+ const cssLanguageTypes_1 = require("../cssLanguageTypes");
20
+ const nls = require("vscode-nls");
21
+ const localize = nls.loadMessageBundle();
22
+ class SCSSCompletion extends cssCompletion_1.CSSCompletion {
23
+ constructor(lsServiceOptions, cssDataManager) {
24
+ super('$', lsServiceOptions, cssDataManager);
41
25
  addReferencesToDocumentation(SCSSCompletion.scssModuleLoaders);
42
26
  addReferencesToDocumentation(SCSSCompletion.scssModuleBuiltIns);
43
- return _this;
44
27
  }
45
- SCSSCompletion.prototype.isImportPathParent = function (type) {
28
+ isImportPathParent(type) {
46
29
  return type === nodes.NodeType.Forward
47
30
  || type === nodes.NodeType.Use
48
- || _super.prototype.isImportPathParent.call(this, type);
49
- };
50
- SCSSCompletion.prototype.getCompletionForImportPath = function (importPathNode, result) {
51
- var parentType = importPathNode.getParent().type;
31
+ || super.isImportPathParent(type);
32
+ }
33
+ getCompletionForImportPath(importPathNode, result) {
34
+ const parentType = importPathNode.getParent().type;
52
35
  if (parentType === nodes.NodeType.Forward || parentType === nodes.NodeType.Use) {
53
- for (var _i = 0, _a = SCSSCompletion.scssModuleBuiltIns; _i < _a.length; _i++) {
54
- var p = _a[_i];
55
- var item = {
36
+ for (let p of SCSSCompletion.scssModuleBuiltIns) {
37
+ const item = {
56
38
  label: p.label,
57
39
  documentation: p.documentation,
58
- textEdit: cssLanguageTypes_1.TextEdit.replace(this.getCompletionRange(importPathNode), "'".concat(p.label, "'")),
40
+ textEdit: cssLanguageTypes_1.TextEdit.replace(this.getCompletionRange(importPathNode), `'${p.label}'`),
59
41
  kind: cssLanguageTypes_1.CompletionItemKind.Module
60
42
  };
61
43
  result.items.push(item);
62
44
  }
63
45
  }
64
- return _super.prototype.getCompletionForImportPath.call(this, importPathNode, result);
65
- };
66
- SCSSCompletion.prototype.createReplaceFunction = function () {
67
- var tabStopCounter = 1;
68
- return function (_match, p1) {
46
+ return super.getCompletionForImportPath(importPathNode, result);
47
+ }
48
+ createReplaceFunction() {
49
+ let tabStopCounter = 1;
50
+ return (_match, p1) => {
69
51
  return '\\' + p1 + ': ${' + tabStopCounter++ + ':' + (SCSSCompletion.variableDefaults[p1] || '') + '}';
70
52
  };
71
- };
72
- SCSSCompletion.prototype.createFunctionProposals = function (proposals, existingNode, sortToEnd, result) {
73
- for (var _i = 0, proposals_1 = proposals; _i < proposals_1.length; _i++) {
74
- var p = proposals_1[_i];
75
- var insertText = p.func.replace(/\[?(\$\w+)\]?/g, this.createReplaceFunction());
76
- var label = p.func.substr(0, p.func.indexOf('('));
77
- var item = {
53
+ }
54
+ createFunctionProposals(proposals, existingNode, sortToEnd, result) {
55
+ for (const p of proposals) {
56
+ const insertText = p.func.replace(/\[?(\$\w+)\]?/g, this.createReplaceFunction());
57
+ const label = p.func.substr(0, p.func.indexOf('('));
58
+ const item = {
78
59
  label: label,
79
60
  detail: p.func,
80
61
  documentation: p.desc,
@@ -88,33 +69,32 @@ var __extends = (this && this.__extends) || (function () {
88
69
  result.items.push(item);
89
70
  }
90
71
  return result;
91
- };
92
- SCSSCompletion.prototype.getCompletionsForSelector = function (ruleSet, isNested, result) {
72
+ }
73
+ getCompletionsForSelector(ruleSet, isNested, result) {
93
74
  this.createFunctionProposals(SCSSCompletion.selectorFuncs, null, true, result);
94
- return _super.prototype.getCompletionsForSelector.call(this, ruleSet, isNested, result);
95
- };
96
- SCSSCompletion.prototype.getTermProposals = function (entry, existingNode, result) {
97
- var functions = SCSSCompletion.builtInFuncs;
75
+ return super.getCompletionsForSelector(ruleSet, isNested, result);
76
+ }
77
+ getTermProposals(entry, existingNode, result) {
78
+ let functions = SCSSCompletion.builtInFuncs;
98
79
  if (entry) {
99
- functions = functions.filter(function (f) { return !f.type || !entry.restrictions || entry.restrictions.indexOf(f.type) !== -1; });
80
+ functions = functions.filter(f => !f.type || !entry.restrictions || entry.restrictions.indexOf(f.type) !== -1);
100
81
  }
101
82
  this.createFunctionProposals(functions, existingNode, true, result);
102
- return _super.prototype.getTermProposals.call(this, entry, existingNode, result);
103
- };
104
- SCSSCompletion.prototype.getColorProposals = function (entry, existingNode, result) {
83
+ return super.getTermProposals(entry, existingNode, result);
84
+ }
85
+ getColorProposals(entry, existingNode, result) {
105
86
  this.createFunctionProposals(SCSSCompletion.colorProposals, existingNode, false, result);
106
- return _super.prototype.getColorProposals.call(this, entry, existingNode, result);
107
- };
108
- SCSSCompletion.prototype.getCompletionsForDeclarationProperty = function (declaration, result) {
87
+ return super.getColorProposals(entry, existingNode, result);
88
+ }
89
+ getCompletionsForDeclarationProperty(declaration, result) {
109
90
  this.getCompletionForAtDirectives(result);
110
91
  this.getCompletionsForSelector(null, true, result);
111
- return _super.prototype.getCompletionsForDeclarationProperty.call(this, declaration, result);
112
- };
113
- SCSSCompletion.prototype.getCompletionsForExtendsReference = function (_extendsRef, existingNode, result) {
114
- var symbols = this.getSymbolContext().findSymbolsAtOffset(this.offset, nodes.ReferenceType.Rule);
115
- for (var _i = 0, symbols_1 = symbols; _i < symbols_1.length; _i++) {
116
- var symbol = symbols_1[_i];
117
- var suggest = {
92
+ return super.getCompletionsForDeclarationProperty(declaration, result);
93
+ }
94
+ getCompletionsForExtendsReference(_extendsRef, existingNode, result) {
95
+ const symbols = this.getSymbolContext().findSymbolsAtOffset(this.offset, nodes.ReferenceType.Rule);
96
+ for (const symbol of symbols) {
97
+ const suggest = {
118
98
  label: symbol.name,
119
99
  textEdit: cssLanguageTypes_1.TextEdit.replace(this.getCompletionRange(existingNode), symbol.name),
120
100
  kind: cssLanguageTypes_1.CompletionItemKind.Function,
@@ -122,265 +102,262 @@ var __extends = (this && this.__extends) || (function () {
122
102
  result.items.push(suggest);
123
103
  }
124
104
  return result;
125
- };
126
- SCSSCompletion.prototype.getCompletionForAtDirectives = function (result) {
127
- var _a;
128
- (_a = result.items).push.apply(_a, SCSSCompletion.scssAtDirectives);
105
+ }
106
+ getCompletionForAtDirectives(result) {
107
+ result.items.push(...SCSSCompletion.scssAtDirectives);
129
108
  return result;
130
- };
131
- SCSSCompletion.prototype.getCompletionForTopLevel = function (result) {
109
+ }
110
+ getCompletionForTopLevel(result) {
132
111
  this.getCompletionForAtDirectives(result);
133
112
  this.getCompletionForModuleLoaders(result);
134
- _super.prototype.getCompletionForTopLevel.call(this, result);
113
+ super.getCompletionForTopLevel(result);
135
114
  return result;
136
- };
137
- SCSSCompletion.prototype.getCompletionForModuleLoaders = function (result) {
138
- var _a;
139
- (_a = result.items).push.apply(_a, SCSSCompletion.scssModuleLoaders);
115
+ }
116
+ getCompletionForModuleLoaders(result) {
117
+ result.items.push(...SCSSCompletion.scssModuleLoaders);
140
118
  return result;
141
- };
142
- SCSSCompletion.variableDefaults = {
143
- '$red': '1',
144
- '$green': '2',
145
- '$blue': '3',
146
- '$alpha': '1.0',
147
- '$color': '#000000',
148
- '$weight': '0.5',
149
- '$hue': '0',
150
- '$saturation': '0%',
151
- '$lightness': '0%',
152
- '$degrees': '0',
153
- '$amount': '0',
154
- '$string': '""',
155
- '$substring': '"s"',
156
- '$number': '0',
157
- '$limit': '1'
158
- };
159
- SCSSCompletion.colorProposals = [
160
- { func: 'red($color)', desc: localize('scss.builtin.red', 'Gets the red component of a color.') },
161
- { func: 'green($color)', desc: localize('scss.builtin.green', 'Gets the green component of a color.') },
162
- { func: 'blue($color)', desc: localize('scss.builtin.blue', 'Gets the blue component of a color.') },
163
- { func: 'mix($color, $color, [$weight])', desc: localize('scss.builtin.mix', 'Mixes two colors together.') },
164
- { func: 'hue($color)', desc: localize('scss.builtin.hue', 'Gets the hue component of a color.') },
165
- { func: 'saturation($color)', desc: localize('scss.builtin.saturation', 'Gets the saturation component of a color.') },
166
- { func: 'lightness($color)', desc: localize('scss.builtin.lightness', 'Gets the lightness component of a color.') },
167
- { func: 'adjust-hue($color, $degrees)', desc: localize('scss.builtin.adjust-hue', 'Changes the hue of a color.') },
168
- { func: 'lighten($color, $amount)', desc: localize('scss.builtin.lighten', 'Makes a color lighter.') },
169
- { func: 'darken($color, $amount)', desc: localize('scss.builtin.darken', 'Makes a color darker.') },
170
- { func: 'saturate($color, $amount)', desc: localize('scss.builtin.saturate', 'Makes a color more saturated.') },
171
- { func: 'desaturate($color, $amount)', desc: localize('scss.builtin.desaturate', 'Makes a color less saturated.') },
172
- { func: 'grayscale($color)', desc: localize('scss.builtin.grayscale', 'Converts a color to grayscale.') },
173
- { func: 'complement($color)', desc: localize('scss.builtin.complement', 'Returns the complement of a color.') },
174
- { func: 'invert($color)', desc: localize('scss.builtin.invert', 'Returns the inverse of a color.') },
175
- { func: 'alpha($color)', desc: localize('scss.builtin.alpha', 'Gets the opacity component of a color.') },
176
- { func: 'opacity($color)', desc: 'Gets the alpha component (opacity) of a color.' },
177
- { func: 'rgba($color, $alpha)', desc: localize('scss.builtin.rgba', 'Changes the alpha component for a color.') },
178
- { func: 'opacify($color, $amount)', desc: localize('scss.builtin.opacify', 'Makes a color more opaque.') },
179
- { func: 'fade-in($color, $amount)', desc: localize('scss.builtin.fade-in', 'Makes a color more opaque.') },
180
- { func: 'transparentize($color, $amount)', desc: localize('scss.builtin.transparentize', 'Makes a color more transparent.') },
181
- { func: 'fade-out($color, $amount)', desc: localize('scss.builtin.fade-out', 'Makes a color more transparent.') },
182
- { func: 'adjust-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])', desc: localize('scss.builtin.adjust-color', 'Increases or decreases one or more components of a color.') },
183
- { func: 'scale-color($color, [$red], [$green], [$blue], [$saturation], [$lightness], [$alpha])', desc: localize('scss.builtin.scale-color', 'Fluidly scales one or more properties of a color.') },
184
- { func: 'change-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])', desc: localize('scss.builtin.change-color', 'Changes one or more properties of a color.') },
185
- { func: 'ie-hex-str($color)', desc: localize('scss.builtin.ie-hex-str', 'Converts a color into the format understood by IE filters.') }
186
- ];
187
- SCSSCompletion.selectorFuncs = [
188
- { func: 'selector-nest($selectors…)', desc: localize('scss.builtin.selector-nest', 'Nests selector beneath one another like they would be nested in the stylesheet.') },
189
- { func: 'selector-append($selectors…)', desc: localize('scss.builtin.selector-append', 'Appends selectors to one another without spaces in between.') },
190
- { func: 'selector-extend($selector, $extendee, $extender)', desc: localize('scss.builtin.selector-extend', 'Extends $extendee with $extender within $selector.') },
191
- { func: 'selector-replace($selector, $original, $replacement)', desc: localize('scss.builtin.selector-replace', 'Replaces $original with $replacement within $selector.') },
192
- { func: 'selector-unify($selector1, $selector2)', desc: localize('scss.builtin.selector-unify', 'Unifies two selectors to produce a selector that matches elements matched by both.') },
193
- { func: 'is-superselector($super, $sub)', desc: localize('scss.builtin.is-superselector', 'Returns whether $super matches all the elements $sub does, and possibly more.') },
194
- { func: 'simple-selectors($selector)', desc: localize('scss.builtin.simple-selectors', 'Returns the simple selectors that comprise a compound selector.') },
195
- { func: 'selector-parse($selector)', desc: localize('scss.builtin.selector-parse', 'Parses a selector into the format returned by &.') }
196
- ];
197
- SCSSCompletion.builtInFuncs = [
198
- { func: 'unquote($string)', desc: localize('scss.builtin.unquote', 'Removes quotes from a string.') },
199
- { func: 'quote($string)', desc: localize('scss.builtin.quote', 'Adds quotes to a string.') },
200
- { func: 'str-length($string)', desc: localize('scss.builtin.str-length', 'Returns the number of characters in a string.') },
201
- { func: 'str-insert($string, $insert, $index)', desc: localize('scss.builtin.str-insert', 'Inserts $insert into $string at $index.') },
202
- { func: 'str-index($string, $substring)', desc: localize('scss.builtin.str-index', 'Returns the index of the first occurance of $substring in $string.') },
203
- { func: 'str-slice($string, $start-at, [$end-at])', desc: localize('scss.builtin.str-slice', 'Extracts a substring from $string.') },
204
- { func: 'to-upper-case($string)', desc: localize('scss.builtin.to-upper-case', 'Converts a string to upper case.') },
205
- { func: 'to-lower-case($string)', desc: localize('scss.builtin.to-lower-case', 'Converts a string to lower case.') },
206
- { func: 'percentage($number)', desc: localize('scss.builtin.percentage', 'Converts a unitless number to a percentage.'), type: 'percentage' },
207
- { func: 'round($number)', desc: localize('scss.builtin.round', 'Rounds a number to the nearest whole number.') },
208
- { func: 'ceil($number)', desc: localize('scss.builtin.ceil', 'Rounds a number up to the next whole number.') },
209
- { func: 'floor($number)', desc: localize('scss.builtin.floor', 'Rounds a number down to the previous whole number.') },
210
- { func: 'abs($number)', desc: localize('scss.builtin.abs', 'Returns the absolute value of a number.') },
211
- { func: 'min($numbers)', desc: localize('scss.builtin.min', 'Finds the minimum of several numbers.') },
212
- { func: 'max($numbers)', desc: localize('scss.builtin.max', 'Finds the maximum of several numbers.') },
213
- { func: 'random([$limit])', desc: localize('scss.builtin.random', 'Returns a random number.') },
214
- { func: 'length($list)', desc: localize('scss.builtin.length', 'Returns the length of a list.') },
215
- { func: 'nth($list, $n)', desc: localize('scss.builtin.nth', 'Returns a specific item in a list.') },
216
- { func: 'set-nth($list, $n, $value)', desc: localize('scss.builtin.set-nth', 'Replaces the nth item in a list.') },
217
- { func: 'join($list1, $list2, [$separator])', desc: localize('scss.builtin.join', 'Joins together two lists into one.') },
218
- { func: 'append($list1, $val, [$separator])', desc: localize('scss.builtin.append', 'Appends a single value onto the end of a list.') },
219
- { func: 'zip($lists)', desc: localize('scss.builtin.zip', 'Combines several lists into a single multidimensional list.') },
220
- { func: 'index($list, $value)', desc: localize('scss.builtin.index', 'Returns the position of a value within a list.') },
221
- { func: 'list-separator(#list)', desc: localize('scss.builtin.list-separator', 'Returns the separator of a list.') },
222
- { func: 'map-get($map, $key)', desc: localize('scss.builtin.map-get', 'Returns the value in a map associated with a given key.') },
223
- { func: 'map-merge($map1, $map2)', desc: localize('scss.builtin.map-merge', 'Merges two maps together into a new map.') },
224
- { func: 'map-remove($map, $keys)', desc: localize('scss.builtin.map-remove', 'Returns a new map with keys removed.') },
225
- { func: 'map-keys($map)', desc: localize('scss.builtin.map-keys', 'Returns a list of all keys in a map.') },
226
- { func: 'map-values($map)', desc: localize('scss.builtin.map-values', 'Returns a list of all values in a map.') },
227
- { func: 'map-has-key($map, $key)', desc: localize('scss.builtin.map-has-key', 'Returns whether a map has a value associated with a given key.') },
228
- { func: 'keywords($args)', desc: localize('scss.builtin.keywords', 'Returns the keywords passed to a function that takes variable arguments.') },
229
- { func: 'feature-exists($feature)', desc: localize('scss.builtin.feature-exists', 'Returns whether a feature exists in the current Sass runtime.') },
230
- { func: 'variable-exists($name)', desc: localize('scss.builtin.variable-exists', 'Returns whether a variable with the given name exists in the current scope.') },
231
- { func: 'global-variable-exists($name)', desc: localize('scss.builtin.global-variable-exists', 'Returns whether a variable with the given name exists in the global scope.') },
232
- { func: 'function-exists($name)', desc: localize('scss.builtin.function-exists', 'Returns whether a function with the given name exists.') },
233
- { func: 'mixin-exists($name)', desc: localize('scss.builtin.mixin-exists', 'Returns whether a mixin with the given name exists.') },
234
- { func: 'inspect($value)', desc: localize('scss.builtin.inspect', 'Returns the string representation of a value as it would be represented in Sass.') },
235
- { func: 'type-of($value)', desc: localize('scss.builtin.type-of', 'Returns the type of a value.') },
236
- { func: 'unit($number)', desc: localize('scss.builtin.unit', 'Returns the unit(s) associated with a number.') },
237
- { func: 'unitless($number)', desc: localize('scss.builtin.unitless', 'Returns whether a number has units.') },
238
- { func: 'comparable($number1, $number2)', desc: localize('scss.builtin.comparable', 'Returns whether two numbers can be added, subtracted, or compared.') },
239
- { func: 'call($name, $args…)', desc: localize('scss.builtin.call', 'Dynamically calls a Sass function.') }
240
- ];
241
- SCSSCompletion.scssAtDirectives = [
242
- {
243
- label: "@extend",
244
- documentation: localize("scss.builtin.@extend", "Inherits the styles of another selector."),
245
- kind: cssLanguageTypes_1.CompletionItemKind.Keyword
246
- },
247
- {
248
- label: "@at-root",
249
- documentation: localize("scss.builtin.@at-root", "Causes one or more rules to be emitted at the root of the document."),
250
- kind: cssLanguageTypes_1.CompletionItemKind.Keyword
251
- },
252
- {
253
- label: "@debug",
254
- documentation: localize("scss.builtin.@debug", "Prints the value of an expression to the standard error output stream. Useful for debugging complicated Sass files."),
255
- kind: cssLanguageTypes_1.CompletionItemKind.Keyword
256
- },
257
- {
258
- label: "@warn",
259
- documentation: localize("scss.builtin.@warn", "Prints the value of an expression to the standard error output stream. Useful for libraries that need to warn users of deprecations or recovering from minor mixin usage mistakes. Warnings can be turned off with the `--quiet` command-line option or the `:quiet` Sass option."),
260
- kind: cssLanguageTypes_1.CompletionItemKind.Keyword
261
- },
262
- {
263
- label: "@error",
264
- documentation: localize("scss.builtin.@error", "Throws the value of an expression as a fatal error with stack trace. Useful for validating arguments to mixins and functions."),
265
- kind: cssLanguageTypes_1.CompletionItemKind.Keyword
266
- },
267
- {
268
- label: "@if",
269
- documentation: localize("scss.builtin.@if", "Includes the body if the expression does not evaluate to `false` or `null`."),
270
- insertText: "@if ${1:expr} {\n\t$0\n}",
271
- insertTextFormat: cssLanguageTypes_1.InsertTextFormat.Snippet,
272
- kind: cssLanguageTypes_1.CompletionItemKind.Keyword
273
- },
274
- {
275
- label: "@for",
276
- documentation: localize("scss.builtin.@for", "For loop that repeatedly outputs a set of styles for each `$var` in the `from/through` or `from/to` clause."),
277
- insertText: "@for \\$${1:var} from ${2:start} ${3|to,through|} ${4:end} {\n\t$0\n}",
278
- insertTextFormat: cssLanguageTypes_1.InsertTextFormat.Snippet,
279
- kind: cssLanguageTypes_1.CompletionItemKind.Keyword
280
- },
281
- {
282
- label: "@each",
283
- documentation: localize("scss.builtin.@each", "Each loop that sets `$var` to each item in the list or map, then outputs the styles it contains using that value of `$var`."),
284
- insertText: "@each \\$${1:var} in ${2:list} {\n\t$0\n}",
285
- insertTextFormat: cssLanguageTypes_1.InsertTextFormat.Snippet,
286
- kind: cssLanguageTypes_1.CompletionItemKind.Keyword
287
- },
288
- {
289
- label: "@while",
290
- documentation: localize("scss.builtin.@while", "While loop that takes an expression and repeatedly outputs the nested styles until the statement evaluates to `false`."),
291
- insertText: "@while ${1:condition} {\n\t$0\n}",
292
- insertTextFormat: cssLanguageTypes_1.InsertTextFormat.Snippet,
293
- kind: cssLanguageTypes_1.CompletionItemKind.Keyword
294
- },
295
- {
296
- label: "@mixin",
297
- documentation: localize("scss.builtin.@mixin", "Defines styles that can be re-used throughout the stylesheet with `@include`."),
298
- insertText: "@mixin ${1:name} {\n\t$0\n}",
299
- insertTextFormat: cssLanguageTypes_1.InsertTextFormat.Snippet,
300
- kind: cssLanguageTypes_1.CompletionItemKind.Keyword
301
- },
302
- {
303
- label: "@include",
304
- documentation: localize("scss.builtin.@include", "Includes the styles defined by another mixin into the current rule."),
305
- kind: cssLanguageTypes_1.CompletionItemKind.Keyword
306
- },
307
- {
308
- label: "@function",
309
- documentation: localize("scss.builtin.@function", "Defines complex operations that can be re-used throughout stylesheets."),
310
- kind: cssLanguageTypes_1.CompletionItemKind.Keyword
311
- }
312
- ];
313
- SCSSCompletion.scssModuleLoaders = [
314
- {
315
- label: "@use",
316
- documentation: localize("scss.builtin.@use", "Loads mixins, functions, and variables from other Sass stylesheets as 'modules', and combines CSS from multiple stylesheets together."),
317
- references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/at-rules/use' }],
318
- insertText: "@use $0;",
319
- insertTextFormat: cssLanguageTypes_1.InsertTextFormat.Snippet,
320
- kind: cssLanguageTypes_1.CompletionItemKind.Keyword
321
- },
322
- {
323
- label: "@forward",
324
- documentation: localize("scss.builtin.@forward", "Loads a Sass stylesheet and makes its mixins, functions, and variables available when this stylesheet is loaded with the @use rule."),
325
- references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/at-rules/forward' }],
326
- insertText: "@forward $0;",
327
- insertTextFormat: cssLanguageTypes_1.InsertTextFormat.Snippet,
328
- kind: cssLanguageTypes_1.CompletionItemKind.Keyword
329
- },
330
- ];
331
- SCSSCompletion.scssModuleBuiltIns = [
332
- {
333
- label: 'sass:math',
334
- documentation: localize('scss.builtin.sass:math', 'Provides functions that operate on numbers.'),
335
- references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/modules/math' }]
336
- },
337
- {
338
- label: 'sass:string',
339
- documentation: localize('scss.builtin.sass:string', 'Makes it easy to combine, search, or split apart strings.'),
340
- references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/modules/string' }]
341
- },
342
- {
343
- label: 'sass:color',
344
- documentation: localize('scss.builtin.sass:color', 'Generates new colors based on existing ones, making it easy to build color themes.'),
345
- references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/modules/color' }]
346
- },
347
- {
348
- label: 'sass:list',
349
- documentation: localize('scss.builtin.sass:list', 'Lets you access and modify values in lists.'),
350
- references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/modules/list' }]
351
- },
352
- {
353
- label: 'sass:map',
354
- documentation: localize('scss.builtin.sass:map', 'Makes it possible to look up the value associated with a key in a map, and much more.'),
355
- references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/modules/map' }]
356
- },
357
- {
358
- label: 'sass:selector',
359
- documentation: localize('scss.builtin.sass:selector', 'Provides access to Sass’s powerful selector engine.'),
360
- references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/modules/selector' }]
361
- },
362
- {
363
- label: 'sass:meta',
364
- documentation: localize('scss.builtin.sass:meta', 'Exposes the details of Sass’s inner workings.'),
365
- references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/modules/meta' }]
366
- },
367
- ];
368
- return SCSSCompletion;
369
- }(cssCompletion_1.CSSCompletion));
119
+ }
120
+ }
370
121
  exports.SCSSCompletion = SCSSCompletion;
122
+ SCSSCompletion.variableDefaults = {
123
+ '$red': '1',
124
+ '$green': '2',
125
+ '$blue': '3',
126
+ '$alpha': '1.0',
127
+ '$color': '#000000',
128
+ '$weight': '0.5',
129
+ '$hue': '0',
130
+ '$saturation': '0%',
131
+ '$lightness': '0%',
132
+ '$degrees': '0',
133
+ '$amount': '0',
134
+ '$string': '""',
135
+ '$substring': '"s"',
136
+ '$number': '0',
137
+ '$limit': '1'
138
+ };
139
+ SCSSCompletion.colorProposals = [
140
+ { func: 'red($color)', desc: localize('scss.builtin.red', 'Gets the red component of a color.') },
141
+ { func: 'green($color)', desc: localize('scss.builtin.green', 'Gets the green component of a color.') },
142
+ { func: 'blue($color)', desc: localize('scss.builtin.blue', 'Gets the blue component of a color.') },
143
+ { func: 'mix($color, $color, [$weight])', desc: localize('scss.builtin.mix', 'Mixes two colors together.') },
144
+ { func: 'hue($color)', desc: localize('scss.builtin.hue', 'Gets the hue component of a color.') },
145
+ { func: 'saturation($color)', desc: localize('scss.builtin.saturation', 'Gets the saturation component of a color.') },
146
+ { func: 'lightness($color)', desc: localize('scss.builtin.lightness', 'Gets the lightness component of a color.') },
147
+ { func: 'adjust-hue($color, $degrees)', desc: localize('scss.builtin.adjust-hue', 'Changes the hue of a color.') },
148
+ { func: 'lighten($color, $amount)', desc: localize('scss.builtin.lighten', 'Makes a color lighter.') },
149
+ { func: 'darken($color, $amount)', desc: localize('scss.builtin.darken', 'Makes a color darker.') },
150
+ { func: 'saturate($color, $amount)', desc: localize('scss.builtin.saturate', 'Makes a color more saturated.') },
151
+ { func: 'desaturate($color, $amount)', desc: localize('scss.builtin.desaturate', 'Makes a color less saturated.') },
152
+ { func: 'grayscale($color)', desc: localize('scss.builtin.grayscale', 'Converts a color to grayscale.') },
153
+ { func: 'complement($color)', desc: localize('scss.builtin.complement', 'Returns the complement of a color.') },
154
+ { func: 'invert($color)', desc: localize('scss.builtin.invert', 'Returns the inverse of a color.') },
155
+ { func: 'alpha($color)', desc: localize('scss.builtin.alpha', 'Gets the opacity component of a color.') },
156
+ { func: 'opacity($color)', desc: 'Gets the alpha component (opacity) of a color.' },
157
+ { func: 'rgba($color, $alpha)', desc: localize('scss.builtin.rgba', 'Changes the alpha component for a color.') },
158
+ { func: 'opacify($color, $amount)', desc: localize('scss.builtin.opacify', 'Makes a color more opaque.') },
159
+ { func: 'fade-in($color, $amount)', desc: localize('scss.builtin.fade-in', 'Makes a color more opaque.') },
160
+ { func: 'transparentize($color, $amount)', desc: localize('scss.builtin.transparentize', 'Makes a color more transparent.') },
161
+ { func: 'fade-out($color, $amount)', desc: localize('scss.builtin.fade-out', 'Makes a color more transparent.') },
162
+ { func: 'adjust-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])', desc: localize('scss.builtin.adjust-color', 'Increases or decreases one or more components of a color.') },
163
+ { func: 'scale-color($color, [$red], [$green], [$blue], [$saturation], [$lightness], [$alpha])', desc: localize('scss.builtin.scale-color', 'Fluidly scales one or more properties of a color.') },
164
+ { func: 'change-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])', desc: localize('scss.builtin.change-color', 'Changes one or more properties of a color.') },
165
+ { func: 'ie-hex-str($color)', desc: localize('scss.builtin.ie-hex-str', 'Converts a color into the format understood by IE filters.') }
166
+ ];
167
+ SCSSCompletion.selectorFuncs = [
168
+ { func: 'selector-nest($selectors…)', desc: localize('scss.builtin.selector-nest', 'Nests selector beneath one another like they would be nested in the stylesheet.') },
169
+ { func: 'selector-append($selectors…)', desc: localize('scss.builtin.selector-append', 'Appends selectors to one another without spaces in between.') },
170
+ { func: 'selector-extend($selector, $extendee, $extender)', desc: localize('scss.builtin.selector-extend', 'Extends $extendee with $extender within $selector.') },
171
+ { func: 'selector-replace($selector, $original, $replacement)', desc: localize('scss.builtin.selector-replace', 'Replaces $original with $replacement within $selector.') },
172
+ { func: 'selector-unify($selector1, $selector2)', desc: localize('scss.builtin.selector-unify', 'Unifies two selectors to produce a selector that matches elements matched by both.') },
173
+ { func: 'is-superselector($super, $sub)', desc: localize('scss.builtin.is-superselector', 'Returns whether $super matches all the elements $sub does, and possibly more.') },
174
+ { func: 'simple-selectors($selector)', desc: localize('scss.builtin.simple-selectors', 'Returns the simple selectors that comprise a compound selector.') },
175
+ { func: 'selector-parse($selector)', desc: localize('scss.builtin.selector-parse', 'Parses a selector into the format returned by &.') }
176
+ ];
177
+ SCSSCompletion.builtInFuncs = [
178
+ { func: 'unquote($string)', desc: localize('scss.builtin.unquote', 'Removes quotes from a string.') },
179
+ { func: 'quote($string)', desc: localize('scss.builtin.quote', 'Adds quotes to a string.') },
180
+ { func: 'str-length($string)', desc: localize('scss.builtin.str-length', 'Returns the number of characters in a string.') },
181
+ { func: 'str-insert($string, $insert, $index)', desc: localize('scss.builtin.str-insert', 'Inserts $insert into $string at $index.') },
182
+ { func: 'str-index($string, $substring)', desc: localize('scss.builtin.str-index', 'Returns the index of the first occurance of $substring in $string.') },
183
+ { func: 'str-slice($string, $start-at, [$end-at])', desc: localize('scss.builtin.str-slice', 'Extracts a substring from $string.') },
184
+ { func: 'to-upper-case($string)', desc: localize('scss.builtin.to-upper-case', 'Converts a string to upper case.') },
185
+ { func: 'to-lower-case($string)', desc: localize('scss.builtin.to-lower-case', 'Converts a string to lower case.') },
186
+ { func: 'percentage($number)', desc: localize('scss.builtin.percentage', 'Converts a unitless number to a percentage.'), type: 'percentage' },
187
+ { func: 'round($number)', desc: localize('scss.builtin.round', 'Rounds a number to the nearest whole number.') },
188
+ { func: 'ceil($number)', desc: localize('scss.builtin.ceil', 'Rounds a number up to the next whole number.') },
189
+ { func: 'floor($number)', desc: localize('scss.builtin.floor', 'Rounds a number down to the previous whole number.') },
190
+ { func: 'abs($number)', desc: localize('scss.builtin.abs', 'Returns the absolute value of a number.') },
191
+ { func: 'min($numbers)', desc: localize('scss.builtin.min', 'Finds the minimum of several numbers.') },
192
+ { func: 'max($numbers)', desc: localize('scss.builtin.max', 'Finds the maximum of several numbers.') },
193
+ { func: 'random([$limit])', desc: localize('scss.builtin.random', 'Returns a random number.') },
194
+ { func: 'length($list)', desc: localize('scss.builtin.length', 'Returns the length of a list.') },
195
+ { func: 'nth($list, $n)', desc: localize('scss.builtin.nth', 'Returns a specific item in a list.') },
196
+ { func: 'set-nth($list, $n, $value)', desc: localize('scss.builtin.set-nth', 'Replaces the nth item in a list.') },
197
+ { func: 'join($list1, $list2, [$separator])', desc: localize('scss.builtin.join', 'Joins together two lists into one.') },
198
+ { func: 'append($list1, $val, [$separator])', desc: localize('scss.builtin.append', 'Appends a single value onto the end of a list.') },
199
+ { func: 'zip($lists)', desc: localize('scss.builtin.zip', 'Combines several lists into a single multidimensional list.') },
200
+ { func: 'index($list, $value)', desc: localize('scss.builtin.index', 'Returns the position of a value within a list.') },
201
+ { func: 'list-separator(#list)', desc: localize('scss.builtin.list-separator', 'Returns the separator of a list.') },
202
+ { func: 'map-get($map, $key)', desc: localize('scss.builtin.map-get', 'Returns the value in a map associated with a given key.') },
203
+ { func: 'map-merge($map1, $map2)', desc: localize('scss.builtin.map-merge', 'Merges two maps together into a new map.') },
204
+ { func: 'map-remove($map, $keys)', desc: localize('scss.builtin.map-remove', 'Returns a new map with keys removed.') },
205
+ { func: 'map-keys($map)', desc: localize('scss.builtin.map-keys', 'Returns a list of all keys in a map.') },
206
+ { func: 'map-values($map)', desc: localize('scss.builtin.map-values', 'Returns a list of all values in a map.') },
207
+ { func: 'map-has-key($map, $key)', desc: localize('scss.builtin.map-has-key', 'Returns whether a map has a value associated with a given key.') },
208
+ { func: 'keywords($args)', desc: localize('scss.builtin.keywords', 'Returns the keywords passed to a function that takes variable arguments.') },
209
+ { func: 'feature-exists($feature)', desc: localize('scss.builtin.feature-exists', 'Returns whether a feature exists in the current Sass runtime.') },
210
+ { func: 'variable-exists($name)', desc: localize('scss.builtin.variable-exists', 'Returns whether a variable with the given name exists in the current scope.') },
211
+ { func: 'global-variable-exists($name)', desc: localize('scss.builtin.global-variable-exists', 'Returns whether a variable with the given name exists in the global scope.') },
212
+ { func: 'function-exists($name)', desc: localize('scss.builtin.function-exists', 'Returns whether a function with the given name exists.') },
213
+ { func: 'mixin-exists($name)', desc: localize('scss.builtin.mixin-exists', 'Returns whether a mixin with the given name exists.') },
214
+ { func: 'inspect($value)', desc: localize('scss.builtin.inspect', 'Returns the string representation of a value as it would be represented in Sass.') },
215
+ { func: 'type-of($value)', desc: localize('scss.builtin.type-of', 'Returns the type of a value.') },
216
+ { func: 'unit($number)', desc: localize('scss.builtin.unit', 'Returns the unit(s) associated with a number.') },
217
+ { func: 'unitless($number)', desc: localize('scss.builtin.unitless', 'Returns whether a number has units.') },
218
+ { func: 'comparable($number1, $number2)', desc: localize('scss.builtin.comparable', 'Returns whether two numbers can be added, subtracted, or compared.') },
219
+ { func: 'call($name, $args…)', desc: localize('scss.builtin.call', 'Dynamically calls a Sass function.') }
220
+ ];
221
+ SCSSCompletion.scssAtDirectives = [
222
+ {
223
+ label: "@extend",
224
+ documentation: localize("scss.builtin.@extend", "Inherits the styles of another selector."),
225
+ kind: cssLanguageTypes_1.CompletionItemKind.Keyword
226
+ },
227
+ {
228
+ label: "@at-root",
229
+ documentation: localize("scss.builtin.@at-root", "Causes one or more rules to be emitted at the root of the document."),
230
+ kind: cssLanguageTypes_1.CompletionItemKind.Keyword
231
+ },
232
+ {
233
+ label: "@debug",
234
+ documentation: localize("scss.builtin.@debug", "Prints the value of an expression to the standard error output stream. Useful for debugging complicated Sass files."),
235
+ kind: cssLanguageTypes_1.CompletionItemKind.Keyword
236
+ },
237
+ {
238
+ label: "@warn",
239
+ documentation: localize("scss.builtin.@warn", "Prints the value of an expression to the standard error output stream. Useful for libraries that need to warn users of deprecations or recovering from minor mixin usage mistakes. Warnings can be turned off with the `--quiet` command-line option or the `:quiet` Sass option."),
240
+ kind: cssLanguageTypes_1.CompletionItemKind.Keyword
241
+ },
242
+ {
243
+ label: "@error",
244
+ documentation: localize("scss.builtin.@error", "Throws the value of an expression as a fatal error with stack trace. Useful for validating arguments to mixins and functions."),
245
+ kind: cssLanguageTypes_1.CompletionItemKind.Keyword
246
+ },
247
+ {
248
+ label: "@if",
249
+ documentation: localize("scss.builtin.@if", "Includes the body if the expression does not evaluate to `false` or `null`."),
250
+ insertText: "@if ${1:expr} {\n\t$0\n}",
251
+ insertTextFormat: cssLanguageTypes_1.InsertTextFormat.Snippet,
252
+ kind: cssLanguageTypes_1.CompletionItemKind.Keyword
253
+ },
254
+ {
255
+ label: "@for",
256
+ documentation: localize("scss.builtin.@for", "For loop that repeatedly outputs a set of styles for each `$var` in the `from/through` or `from/to` clause."),
257
+ insertText: "@for \\$${1:var} from ${2:start} ${3|to,through|} ${4:end} {\n\t$0\n}",
258
+ insertTextFormat: cssLanguageTypes_1.InsertTextFormat.Snippet,
259
+ kind: cssLanguageTypes_1.CompletionItemKind.Keyword
260
+ },
261
+ {
262
+ label: "@each",
263
+ documentation: localize("scss.builtin.@each", "Each loop that sets `$var` to each item in the list or map, then outputs the styles it contains using that value of `$var`."),
264
+ insertText: "@each \\$${1:var} in ${2:list} {\n\t$0\n}",
265
+ insertTextFormat: cssLanguageTypes_1.InsertTextFormat.Snippet,
266
+ kind: cssLanguageTypes_1.CompletionItemKind.Keyword
267
+ },
268
+ {
269
+ label: "@while",
270
+ documentation: localize("scss.builtin.@while", "While loop that takes an expression and repeatedly outputs the nested styles until the statement evaluates to `false`."),
271
+ insertText: "@while ${1:condition} {\n\t$0\n}",
272
+ insertTextFormat: cssLanguageTypes_1.InsertTextFormat.Snippet,
273
+ kind: cssLanguageTypes_1.CompletionItemKind.Keyword
274
+ },
275
+ {
276
+ label: "@mixin",
277
+ documentation: localize("scss.builtin.@mixin", "Defines styles that can be re-used throughout the stylesheet with `@include`."),
278
+ insertText: "@mixin ${1:name} {\n\t$0\n}",
279
+ insertTextFormat: cssLanguageTypes_1.InsertTextFormat.Snippet,
280
+ kind: cssLanguageTypes_1.CompletionItemKind.Keyword
281
+ },
282
+ {
283
+ label: "@include",
284
+ documentation: localize("scss.builtin.@include", "Includes the styles defined by another mixin into the current rule."),
285
+ kind: cssLanguageTypes_1.CompletionItemKind.Keyword
286
+ },
287
+ {
288
+ label: "@function",
289
+ documentation: localize("scss.builtin.@function", "Defines complex operations that can be re-used throughout stylesheets."),
290
+ kind: cssLanguageTypes_1.CompletionItemKind.Keyword
291
+ }
292
+ ];
293
+ SCSSCompletion.scssModuleLoaders = [
294
+ {
295
+ label: "@use",
296
+ documentation: localize("scss.builtin.@use", "Loads mixins, functions, and variables from other Sass stylesheets as 'modules', and combines CSS from multiple stylesheets together."),
297
+ references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/at-rules/use' }],
298
+ insertText: "@use $0;",
299
+ insertTextFormat: cssLanguageTypes_1.InsertTextFormat.Snippet,
300
+ kind: cssLanguageTypes_1.CompletionItemKind.Keyword
301
+ },
302
+ {
303
+ label: "@forward",
304
+ documentation: localize("scss.builtin.@forward", "Loads a Sass stylesheet and makes its mixins, functions, and variables available when this stylesheet is loaded with the @use rule."),
305
+ references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/at-rules/forward' }],
306
+ insertText: "@forward $0;",
307
+ insertTextFormat: cssLanguageTypes_1.InsertTextFormat.Snippet,
308
+ kind: cssLanguageTypes_1.CompletionItemKind.Keyword
309
+ },
310
+ ];
311
+ SCSSCompletion.scssModuleBuiltIns = [
312
+ {
313
+ label: 'sass:math',
314
+ documentation: localize('scss.builtin.sass:math', 'Provides functions that operate on numbers.'),
315
+ references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/modules/math' }]
316
+ },
317
+ {
318
+ label: 'sass:string',
319
+ documentation: localize('scss.builtin.sass:string', 'Makes it easy to combine, search, or split apart strings.'),
320
+ references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/modules/string' }]
321
+ },
322
+ {
323
+ label: 'sass:color',
324
+ documentation: localize('scss.builtin.sass:color', 'Generates new colors based on existing ones, making it easy to build color themes.'),
325
+ references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/modules/color' }]
326
+ },
327
+ {
328
+ label: 'sass:list',
329
+ documentation: localize('scss.builtin.sass:list', 'Lets you access and modify values in lists.'),
330
+ references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/modules/list' }]
331
+ },
332
+ {
333
+ label: 'sass:map',
334
+ documentation: localize('scss.builtin.sass:map', 'Makes it possible to look up the value associated with a key in a map, and much more.'),
335
+ references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/modules/map' }]
336
+ },
337
+ {
338
+ label: 'sass:selector',
339
+ documentation: localize('scss.builtin.sass:selector', 'Provides access to Sass’s powerful selector engine.'),
340
+ references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/modules/selector' }]
341
+ },
342
+ {
343
+ label: 'sass:meta',
344
+ documentation: localize('scss.builtin.sass:meta', 'Exposes the details of Sass’s inner workings.'),
345
+ references: [{ name: 'Sass documentation', url: 'https://sass-lang.com/documentation/modules/meta' }]
346
+ },
347
+ ];
371
348
  /**
372
349
  * Todo @Pine: Remove this and do it through custom data
373
350
  */
374
351
  function addReferencesToDocumentation(items) {
375
- items.forEach(function (i) {
352
+ items.forEach(i => {
376
353
  if (i.documentation && i.references && i.references.length > 0) {
377
- var markdownDoc = typeof i.documentation === 'string'
354
+ const markdownDoc = typeof i.documentation === 'string'
378
355
  ? { kind: 'markdown', value: i.documentation }
379
356
  : { kind: 'markdown', value: i.documentation.value };
380
357
  markdownDoc.value += '\n\n';
381
358
  markdownDoc.value += i.references
382
- .map(function (r) {
383
- return "[".concat(r.name, "](").concat(r.url, ")");
359
+ .map(r => {
360
+ return `[${r.name}](${r.url})`;
384
361
  })
385
362
  .join(' | ');
386
363
  i.documentation = markdownDoc;