vscode-css-languageservice 6.1.1 → 6.2.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 (41) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +4 -3
  3. package/lib/esm/beautify/beautify-css.js +1 -1
  4. package/lib/esm/cssLanguageService.d.ts +2 -1
  5. package/lib/esm/cssLanguageService.js +1 -0
  6. package/lib/esm/cssLanguageTypes.d.ts +2 -2
  7. package/lib/esm/data/webCustomData.js +3502 -310
  8. package/lib/esm/languageFacts/colors.js +6 -7
  9. package/lib/esm/parser/cssErrors.js +34 -35
  10. package/lib/esm/parser/cssNodes.js +4 -4
  11. package/lib/esm/parser/cssParser.js +16 -16
  12. package/lib/esm/parser/scssErrors.js +4 -5
  13. package/lib/esm/parser/scssParser.js +3 -0
  14. package/lib/esm/services/cssCodeActions.js +2 -3
  15. package/lib/esm/services/cssCompletion.js +13 -4
  16. package/lib/esm/services/cssNavigation.js +19 -7
  17. package/lib/esm/services/lessCompletion.js +58 -59
  18. package/lib/esm/services/lint.js +64 -18
  19. package/lib/esm/services/lintRules.js +21 -22
  20. package/lib/esm/services/scssCompletion.js +107 -107
  21. package/lib/esm/services/selectorPrinting.js +2 -3
  22. package/lib/umd/beautify/beautify-css.js +1 -1
  23. package/lib/umd/cssLanguageService.d.ts +2 -1
  24. package/lib/umd/cssLanguageService.js +1 -0
  25. package/lib/umd/cssLanguageTypes.d.ts +2 -2
  26. package/lib/umd/data/webCustomData.js +3502 -310
  27. package/lib/umd/languageFacts/colors.js +7 -8
  28. package/lib/umd/parser/cssErrors.js +35 -36
  29. package/lib/umd/parser/cssNodes.js +4 -4
  30. package/lib/umd/parser/cssParser.js +16 -16
  31. package/lib/umd/parser/scssErrors.js +5 -6
  32. package/lib/umd/parser/scssParser.js +3 -0
  33. package/lib/umd/services/cssCodeActions.js +3 -4
  34. package/lib/umd/services/cssCompletion.js +14 -5
  35. package/lib/umd/services/cssNavigation.js +20 -8
  36. package/lib/umd/services/lessCompletion.js +59 -60
  37. package/lib/umd/services/lint.js +65 -19
  38. package/lib/umd/services/lintRules.js +22 -23
  39. package/lib/umd/services/scssCompletion.js +108 -108
  40. package/lib/umd/services/selectorPrinting.js +3 -4
  41. package/package.json +13 -16
@@ -4,7 +4,7 @@
4
4
  if (v !== undefined) module.exports = v;
5
5
  }
6
6
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./cssCompletion", "../parser/cssNodes", "../cssLanguageTypes", "vscode-nls"], factory);
7
+ define(["require", "exports", "./cssCompletion", "../parser/cssNodes", "../cssLanguageTypes", "@vscode/l10n"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  /*---------------------------------------------------------------------------------------------
@@ -17,8 +17,8 @@
17
17
  const cssCompletion_1 = require("./cssCompletion");
18
18
  const nodes = require("../parser/cssNodes");
19
19
  const cssLanguageTypes_1 = require("../cssLanguageTypes");
20
- const nls = require("vscode-nls");
21
- const localize = nls.loadMessageBundle();
20
+ const l10n = require("@vscode/l10n");
21
+ const sassDocumentationName = l10n.t('Sass documentation');
22
22
  class SCSSCompletion extends cssCompletion_1.CSSCompletion {
23
23
  constructor(lsServiceOptions, cssDataManager) {
24
24
  super('$', lsServiceOptions, cssDataManager);
@@ -137,172 +137,172 @@
137
137
  '$limit': '1'
138
138
  };
139
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.') },
140
+ { func: 'red($color)', desc: l10n.t('Gets the red component of a color.') },
141
+ { func: 'green($color)', desc: l10n.t('Gets the green component of a color.') },
142
+ { func: 'blue($color)', desc: l10n.t('Gets the blue component of a color.') },
143
+ { func: 'mix($color, $color, [$weight])', desc: l10n.t('Mixes two colors together.') },
144
+ { func: 'hue($color)', desc: l10n.t('Gets the hue component of a color.') },
145
+ { func: 'saturation($color)', desc: l10n.t('Gets the saturation component of a color.') },
146
+ { func: 'lightness($color)', desc: l10n.t('Gets the lightness component of a color.') },
147
+ { func: 'adjust-hue($color, $degrees)', desc: l10n.t('Changes the hue of a color.') },
148
+ { func: 'lighten($color, $amount)', desc: l10n.t('Makes a color lighter.') },
149
+ { func: 'darken($color, $amount)', desc: l10n.t('Makes a color darker.') },
150
+ { func: 'saturate($color, $amount)', desc: l10n.t('Makes a color more saturated.') },
151
+ { func: 'desaturate($color, $amount)', desc: l10n.t('Makes a color less saturated.') },
152
+ { func: 'grayscale($color)', desc: l10n.t('Converts a color to grayscale.') },
153
+ { func: 'complement($color)', desc: l10n.t('Returns the complement of a color.') },
154
+ { func: 'invert($color)', desc: l10n.t('Returns the inverse of a color.') },
155
+ { func: 'alpha($color)', desc: l10n.t('Gets the opacity component of a color.') },
156
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.') }
157
+ { func: 'rgba($color, $alpha)', desc: l10n.t('Changes the alpha component for a color.') },
158
+ { func: 'opacify($color, $amount)', desc: l10n.t('Makes a color more opaque.') },
159
+ { func: 'fade-in($color, $amount)', desc: l10n.t('Makes a color more opaque.') },
160
+ { func: 'transparentize($color, $amount)', desc: l10n.t('Makes a color more transparent.') },
161
+ { func: 'fade-out($color, $amount)', desc: l10n.t('Makes a color more transparent.') },
162
+ { func: 'adjust-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])', desc: l10n.t('Increases or decreases one or more components of a color.') },
163
+ { func: 'scale-color($color, [$red], [$green], [$blue], [$saturation], [$lightness], [$alpha])', desc: l10n.t('Fluidly scales one or more properties of a color.') },
164
+ { func: 'change-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])', desc: l10n.t('Changes one or more properties of a color.') },
165
+ { func: 'ie-hex-str($color)', desc: l10n.t('Converts a color into the format understood by IE filters.') }
166
166
  ];
167
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 &.') }
168
+ { func: 'selector-nest($selectors…)', desc: l10n.t('Nests selector beneath one another like they would be nested in the stylesheet.') },
169
+ { func: 'selector-append($selectors…)', desc: l10n.t('Appends selectors to one another without spaces in between.') },
170
+ { func: 'selector-extend($selector, $extendee, $extender)', desc: l10n.t('Extends $extendee with $extender within $selector.') },
171
+ { func: 'selector-replace($selector, $original, $replacement)', desc: l10n.t('Replaces $original with $replacement within $selector.') },
172
+ { func: 'selector-unify($selector1, $selector2)', desc: l10n.t('Unifies two selectors to produce a selector that matches elements matched by both.') },
173
+ { func: 'is-superselector($super, $sub)', desc: l10n.t('Returns whether $super matches all the elements $sub does, and possibly more.') },
174
+ { func: 'simple-selectors($selector)', desc: l10n.t('Returns the simple selectors that comprise a compound selector.') },
175
+ { func: 'selector-parse($selector)', desc: l10n.t('Parses a selector into the format returned by &.') }
176
176
  ];
177
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.') }
178
+ { func: 'unquote($string)', desc: l10n.t('Removes quotes from a string.') },
179
+ { func: 'quote($string)', desc: l10n.t('Adds quotes to a string.') },
180
+ { func: 'str-length($string)', desc: l10n.t('Returns the number of characters in a string.') },
181
+ { func: 'str-insert($string, $insert, $index)', desc: l10n.t('Inserts $insert into $string at $index.') },
182
+ { func: 'str-index($string, $substring)', desc: l10n.t('Returns the index of the first occurance of $substring in $string.') },
183
+ { func: 'str-slice($string, $start-at, [$end-at])', desc: l10n.t('Extracts a substring from $string.') },
184
+ { func: 'to-upper-case($string)', desc: l10n.t('Converts a string to upper case.') },
185
+ { func: 'to-lower-case($string)', desc: l10n.t('Converts a string to lower case.') },
186
+ { func: 'percentage($number)', desc: l10n.t('Converts a unitless number to a percentage.'), type: 'percentage' },
187
+ { func: 'round($number)', desc: l10n.t('Rounds a number to the nearest whole number.') },
188
+ { func: 'ceil($number)', desc: l10n.t('Rounds a number up to the next whole number.') },
189
+ { func: 'floor($number)', desc: l10n.t('Rounds a number down to the previous whole number.') },
190
+ { func: 'abs($number)', desc: l10n.t('Returns the absolute value of a number.') },
191
+ { func: 'min($numbers)', desc: l10n.t('Finds the minimum of several numbers.') },
192
+ { func: 'max($numbers)', desc: l10n.t('Finds the maximum of several numbers.') },
193
+ { func: 'random([$limit])', desc: l10n.t('Returns a random number.') },
194
+ { func: 'length($list)', desc: l10n.t('Returns the length of a list.') },
195
+ { func: 'nth($list, $n)', desc: l10n.t('Returns a specific item in a list.') },
196
+ { func: 'set-nth($list, $n, $value)', desc: l10n.t('Replaces the nth item in a list.') },
197
+ { func: 'join($list1, $list2, [$separator])', desc: l10n.t('Joins together two lists into one.') },
198
+ { func: 'append($list1, $val, [$separator])', desc: l10n.t('Appends a single value onto the end of a list.') },
199
+ { func: 'zip($lists)', desc: l10n.t('Combines several lists into a single multidimensional list.') },
200
+ { func: 'index($list, $value)', desc: l10n.t('Returns the position of a value within a list.') },
201
+ { func: 'list-separator(#list)', desc: l10n.t('Returns the separator of a list.') },
202
+ { func: 'map-get($map, $key)', desc: l10n.t('Returns the value in a map associated with a given key.') },
203
+ { func: 'map-merge($map1, $map2)', desc: l10n.t('Merges two maps together into a new map.') },
204
+ { func: 'map-remove($map, $keys)', desc: l10n.t('Returns a new map with keys removed.') },
205
+ { func: 'map-keys($map)', desc: l10n.t('Returns a list of all keys in a map.') },
206
+ { func: 'map-values($map)', desc: l10n.t('Returns a list of all values in a map.') },
207
+ { func: 'map-has-key($map, $key)', desc: l10n.t('Returns whether a map has a value associated with a given key.') },
208
+ { func: 'keywords($args)', desc: l10n.t('Returns the keywords passed to a function that takes variable arguments.') },
209
+ { func: 'feature-exists($feature)', desc: l10n.t('Returns whether a feature exists in the current Sass runtime.') },
210
+ { func: 'variable-exists($name)', desc: l10n.t('Returns whether a variable with the given name exists in the current scope.') },
211
+ { func: 'global-variable-exists($name)', desc: l10n.t('Returns whether a variable with the given name exists in the global scope.') },
212
+ { func: 'function-exists($name)', desc: l10n.t('Returns whether a function with the given name exists.') },
213
+ { func: 'mixin-exists($name)', desc: l10n.t('Returns whether a mixin with the given name exists.') },
214
+ { func: 'inspect($value)', desc: l10n.t('Returns the string representation of a value as it would be represented in Sass.') },
215
+ { func: 'type-of($value)', desc: l10n.t('Returns the type of a value.') },
216
+ { func: 'unit($number)', desc: l10n.t('Returns the unit(s) associated with a number.') },
217
+ { func: 'unitless($number)', desc: l10n.t('Returns whether a number has units.') },
218
+ { func: 'comparable($number1, $number2)', desc: l10n.t('Returns whether two numbers can be added, subtracted, or compared.') },
219
+ { func: 'call($name, $args…)', desc: l10n.t('Dynamically calls a Sass function.') }
220
220
  ];
221
221
  SCSSCompletion.scssAtDirectives = [
222
222
  {
223
223
  label: "@extend",
224
- documentation: localize("scss.builtin.@extend", "Inherits the styles of another selector."),
224
+ documentation: l10n.t("Inherits the styles of another selector."),
225
225
  kind: cssLanguageTypes_1.CompletionItemKind.Keyword
226
226
  },
227
227
  {
228
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."),
229
+ documentation: l10n.t("Causes one or more rules to be emitted at the root of the document."),
230
230
  kind: cssLanguageTypes_1.CompletionItemKind.Keyword
231
231
  },
232
232
  {
233
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."),
234
+ documentation: l10n.t("Prints the value of an expression to the standard error output stream. Useful for debugging complicated Sass files."),
235
235
  kind: cssLanguageTypes_1.CompletionItemKind.Keyword
236
236
  },
237
237
  {
238
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."),
239
+ documentation: l10n.t("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
240
  kind: cssLanguageTypes_1.CompletionItemKind.Keyword
241
241
  },
242
242
  {
243
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."),
244
+ documentation: l10n.t("Throws the value of an expression as a fatal error with stack trace. Useful for validating arguments to mixins and functions."),
245
245
  kind: cssLanguageTypes_1.CompletionItemKind.Keyword
246
246
  },
247
247
  {
248
248
  label: "@if",
249
- documentation: localize("scss.builtin.@if", "Includes the body if the expression does not evaluate to `false` or `null`."),
249
+ documentation: l10n.t("Includes the body if the expression does not evaluate to `false` or `null`."),
250
250
  insertText: "@if ${1:expr} {\n\t$0\n}",
251
251
  insertTextFormat: cssLanguageTypes_1.InsertTextFormat.Snippet,
252
252
  kind: cssLanguageTypes_1.CompletionItemKind.Keyword
253
253
  },
254
254
  {
255
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."),
256
+ documentation: l10n.t("For loop that repeatedly outputs a set of styles for each `$var` in the `from/through` or `from/to` clause."),
257
257
  insertText: "@for \\$${1:var} from ${2:start} ${3|to,through|} ${4:end} {\n\t$0\n}",
258
258
  insertTextFormat: cssLanguageTypes_1.InsertTextFormat.Snippet,
259
259
  kind: cssLanguageTypes_1.CompletionItemKind.Keyword
260
260
  },
261
261
  {
262
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`."),
263
+ documentation: l10n.t("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
264
  insertText: "@each \\$${1:var} in ${2:list} {\n\t$0\n}",
265
265
  insertTextFormat: cssLanguageTypes_1.InsertTextFormat.Snippet,
266
266
  kind: cssLanguageTypes_1.CompletionItemKind.Keyword
267
267
  },
268
268
  {
269
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`."),
270
+ documentation: l10n.t("While loop that takes an expression and repeatedly outputs the nested styles until the statement evaluates to `false`."),
271
271
  insertText: "@while ${1:condition} {\n\t$0\n}",
272
272
  insertTextFormat: cssLanguageTypes_1.InsertTextFormat.Snippet,
273
273
  kind: cssLanguageTypes_1.CompletionItemKind.Keyword
274
274
  },
275
275
  {
276
276
  label: "@mixin",
277
- documentation: localize("scss.builtin.@mixin", "Defines styles that can be re-used throughout the stylesheet with `@include`."),
277
+ documentation: l10n.t("Defines styles that can be re-used throughout the stylesheet with `@include`."),
278
278
  insertText: "@mixin ${1:name} {\n\t$0\n}",
279
279
  insertTextFormat: cssLanguageTypes_1.InsertTextFormat.Snippet,
280
280
  kind: cssLanguageTypes_1.CompletionItemKind.Keyword
281
281
  },
282
282
  {
283
283
  label: "@include",
284
- documentation: localize("scss.builtin.@include", "Includes the styles defined by another mixin into the current rule."),
284
+ documentation: l10n.t("Includes the styles defined by another mixin into the current rule."),
285
285
  kind: cssLanguageTypes_1.CompletionItemKind.Keyword
286
286
  },
287
287
  {
288
288
  label: "@function",
289
- documentation: localize("scss.builtin.@function", "Defines complex operations that can be re-used throughout stylesheets."),
289
+ documentation: l10n.t("Defines complex operations that can be re-used throughout stylesheets."),
290
290
  kind: cssLanguageTypes_1.CompletionItemKind.Keyword
291
291
  }
292
292
  ];
293
293
  SCSSCompletion.scssModuleLoaders = [
294
294
  {
295
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' }],
296
+ documentation: l10n.t("Loads mixins, functions, and variables from other Sass stylesheets as 'modules', and combines CSS from multiple stylesheets together."),
297
+ references: [{ name: sassDocumentationName, url: 'https://sass-lang.com/documentation/at-rules/use' }],
298
298
  insertText: "@use $0;",
299
299
  insertTextFormat: cssLanguageTypes_1.InsertTextFormat.Snippet,
300
300
  kind: cssLanguageTypes_1.CompletionItemKind.Keyword
301
301
  },
302
302
  {
303
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' }],
304
+ documentation: l10n.t("Loads a Sass stylesheet and makes its mixins, functions, and variables available when this stylesheet is loaded with the @use rule."),
305
+ references: [{ name: sassDocumentationName, url: 'https://sass-lang.com/documentation/at-rules/forward' }],
306
306
  insertText: "@forward $0;",
307
307
  insertTextFormat: cssLanguageTypes_1.InsertTextFormat.Snippet,
308
308
  kind: cssLanguageTypes_1.CompletionItemKind.Keyword
@@ -311,38 +311,38 @@
311
311
  SCSSCompletion.scssModuleBuiltIns = [
312
312
  {
313
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' }]
314
+ documentation: l10n.t('Provides functions that operate on numbers.'),
315
+ references: [{ name: sassDocumentationName, url: 'https://sass-lang.com/documentation/modules/math' }]
316
316
  },
317
317
  {
318
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' }]
319
+ documentation: l10n.t('Makes it easy to combine, search, or split apart strings.'),
320
+ references: [{ name: sassDocumentationName, url: 'https://sass-lang.com/documentation/modules/string' }]
321
321
  },
322
322
  {
323
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' }]
324
+ documentation: l10n.t('Generates new colors based on existing ones, making it easy to build color themes.'),
325
+ references: [{ name: sassDocumentationName, url: 'https://sass-lang.com/documentation/modules/color' }]
326
326
  },
327
327
  {
328
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' }]
329
+ documentation: l10n.t('Lets you access and modify values in lists.'),
330
+ references: [{ name: sassDocumentationName, url: 'https://sass-lang.com/documentation/modules/list' }]
331
331
  },
332
332
  {
333
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' }]
334
+ documentation: l10n.t('Makes it possible to look up the value associated with a key in a map, and much more.'),
335
+ references: [{ name: sassDocumentationName, url: 'https://sass-lang.com/documentation/modules/map' }]
336
336
  },
337
337
  {
338
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' }]
339
+ documentation: l10n.t('Provides access to Sass’s powerful selector engine.'),
340
+ references: [{ name: sassDocumentationName, url: 'https://sass-lang.com/documentation/modules/selector' }]
341
341
  },
342
342
  {
343
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' }]
344
+ documentation: l10n.t('Exposes the details of Sass’s inner workings.'),
345
+ references: [{ name: sassDocumentationName, url: 'https://sass-lang.com/documentation/modules/meta' }]
346
346
  },
347
347
  ];
348
348
  /**
@@ -4,7 +4,7 @@
4
4
  if (v !== undefined) module.exports = v;
5
5
  }
6
6
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "../parser/cssNodes", "../parser/cssScanner", "vscode-nls"], factory);
7
+ define(["require", "exports", "../parser/cssNodes", "../parser/cssScanner", "@vscode/l10n"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  /*---------------------------------------------------------------------------------------------
@@ -16,8 +16,7 @@
16
16
  exports.selectorToElement = exports.SelectorPrinting = exports.toElement = exports.LabelElement = exports.RootElement = exports.Element = void 0;
17
17
  const nodes = require("../parser/cssNodes");
18
18
  const cssScanner_1 = require("../parser/cssScanner");
19
- const nls = require("vscode-nls");
20
- const localize = nls.loadMessageBundle();
19
+ const l10n = require("@vscode/l10n");
21
20
  class Element {
22
21
  constructor() {
23
22
  this.parent = null;
@@ -419,7 +418,7 @@
419
418
  };
420
419
  const specificity = calculateScore(node);
421
420
  ;
422
- return localize('specificity', "[Selector Specificity](https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity): ({0}, {1}, {2})", specificity.id, specificity.attr, specificity.tag);
421
+ return l10n.t("[Selector Specificity](https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity): ({0}, {1}, {2})", specificity.id, specificity.attr, specificity.tag);
423
422
  }
424
423
  }
425
424
  exports.SelectorPrinting = SelectorPrinting;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vscode-css-languageservice",
3
- "version": "6.1.1",
3
+ "version": "6.2.1",
4
4
  "description": "Language service for CSS, LESS and SCSS",
5
5
  "main": "./lib/umd/cssLanguageService.js",
6
6
  "typings": "./lib/umd/cssLanguageService",
@@ -15,27 +15,26 @@
15
15
  "url": "https://github.com/Microsoft/vscode-css-languageservice"
16
16
  },
17
17
  "devDependencies": {
18
- "@types/mocha": "^9.1.1",
18
+ "@types/mocha": "^10.0.0",
19
19
  "@types/node": "16.x",
20
- "@typescript-eslint/eslint-plugin": "^5.37.0",
21
- "@typescript-eslint/parser": "^5.37.0",
22
- "@vscode/web-custom-data": "^0.4.2",
23
- "eslint": "^8.23.1",
24
- "js-beautify": "^1.14.6",
25
- "mocha": "^10.0.0",
20
+ "@typescript-eslint/eslint-plugin": "^5.44.0",
21
+ "@typescript-eslint/parser": "^5.44.0",
22
+ "@vscode/web-custom-data": "^0.4.4",
23
+ "eslint": "^8.28.0",
24
+ "js-beautify": "^1.14.7",
25
+ "mocha": "^10.1.0",
26
26
  "rimraf": "^3.0.2",
27
27
  "source-map-support": "^0.5.21",
28
- "typescript": "^4.8.3"
28
+ "typescript": "^4.9.3"
29
29
  },
30
30
  "dependencies": {
31
+ "@vscode/l10n": "^0.0.10",
31
32
  "vscode-languageserver-textdocument": "^1.0.7",
32
33
  "vscode-languageserver-types": "^3.17.2",
33
- "vscode-nls": "^5.2.0",
34
- "vscode-uri": "^3.0.4"
34
+ "vscode-uri": "^3.0.6"
35
35
  },
36
36
  "scripts": {
37
- "prepublishOnly": "npm run clean && npm run compile-esm && npm run test && npm run remove-sourcemap-refs",
38
- "postpublish": "node ./build/post-publish.js",
37
+ "prepack": "npm run clean && npm run compile-esm && npm run test && npm run remove-sourcemap-refs",
39
38
  "compile": "tsc -p ./src && npm run copy-jsbeautify && npm run lint ",
40
39
  "compile-esm": "tsc -p ./src/tsconfig.esm.json",
41
40
  "clean": "rimraf lib",
@@ -49,8 +48,6 @@
49
48
  "install-types-next": "yarn add vscode-languageserver-types@next -f -S && yarn add vscode-languageserver-textdocument@next -f -S",
50
49
  "copy-jsbeautify": "node ./build/copy-jsbeautify.js",
51
50
  "update-jsbeautify": "yarn add js-beautify && node ./build/update-jsbeautify.js",
52
- "update-jsbeautify-next": "yarn add js-beautify@next && node ./build/update-jsbeautify.js",
53
- "preversion": "npm test",
54
- "postversion": "git push && git push --tags"
51
+ "update-jsbeautify-next": "yarn add js-beautify@next && node ./build/update-jsbeautify.js"
55
52
  }
56
53
  }