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.
- package/CHANGELOG.md +4 -0
- package/README.md +4 -3
- package/lib/esm/beautify/beautify-css.js +1 -1
- package/lib/esm/cssLanguageService.d.ts +2 -1
- package/lib/esm/cssLanguageService.js +1 -0
- package/lib/esm/cssLanguageTypes.d.ts +2 -2
- package/lib/esm/data/webCustomData.js +3502 -310
- package/lib/esm/languageFacts/colors.js +6 -7
- package/lib/esm/parser/cssErrors.js +34 -35
- package/lib/esm/parser/cssNodes.js +4 -4
- package/lib/esm/parser/cssParser.js +16 -16
- package/lib/esm/parser/scssErrors.js +4 -5
- package/lib/esm/parser/scssParser.js +3 -0
- package/lib/esm/services/cssCodeActions.js +2 -3
- package/lib/esm/services/cssCompletion.js +13 -4
- package/lib/esm/services/cssNavigation.js +19 -7
- package/lib/esm/services/lessCompletion.js +58 -59
- package/lib/esm/services/lint.js +64 -18
- package/lib/esm/services/lintRules.js +21 -22
- package/lib/esm/services/scssCompletion.js +107 -107
- package/lib/esm/services/selectorPrinting.js +2 -3
- package/lib/umd/beautify/beautify-css.js +1 -1
- package/lib/umd/cssLanguageService.d.ts +2 -1
- package/lib/umd/cssLanguageService.js +1 -0
- package/lib/umd/cssLanguageTypes.d.ts +2 -2
- package/lib/umd/data/webCustomData.js +3502 -310
- package/lib/umd/languageFacts/colors.js +7 -8
- package/lib/umd/parser/cssErrors.js +35 -36
- package/lib/umd/parser/cssNodes.js +4 -4
- package/lib/umd/parser/cssParser.js +16 -16
- package/lib/umd/parser/scssErrors.js +5 -6
- package/lib/umd/parser/scssParser.js +3 -0
- package/lib/umd/services/cssCodeActions.js +3 -4
- package/lib/umd/services/cssCompletion.js +14 -5
- package/lib/umd/services/cssNavigation.js +20 -8
- package/lib/umd/services/lessCompletion.js +59 -60
- package/lib/umd/services/lint.js +65 -19
- package/lib/umd/services/lintRules.js +22 -23
- package/lib/umd/services/scssCompletion.js +108 -108
- package/lib/umd/services/selectorPrinting.js +3 -4
- 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
|
|
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
|
|
21
|
-
const
|
|
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:
|
|
141
|
-
{ func: 'green($color)', desc:
|
|
142
|
-
{ func: 'blue($color)', desc:
|
|
143
|
-
{ func: 'mix($color, $color, [$weight])', desc:
|
|
144
|
-
{ func: 'hue($color)', desc:
|
|
145
|
-
{ func: 'saturation($color)', desc:
|
|
146
|
-
{ func: 'lightness($color)', desc:
|
|
147
|
-
{ func: 'adjust-hue($color, $degrees)', desc:
|
|
148
|
-
{ func: 'lighten($color, $amount)', desc:
|
|
149
|
-
{ func: 'darken($color, $amount)', desc:
|
|
150
|
-
{ func: 'saturate($color, $amount)', desc:
|
|
151
|
-
{ func: 'desaturate($color, $amount)', desc:
|
|
152
|
-
{ func: 'grayscale($color)', desc:
|
|
153
|
-
{ func: 'complement($color)', desc:
|
|
154
|
-
{ func: 'invert($color)', desc:
|
|
155
|
-
{ func: 'alpha($color)', desc:
|
|
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:
|
|
158
|
-
{ func: 'opacify($color, $amount)', desc:
|
|
159
|
-
{ func: 'fade-in($color, $amount)', desc:
|
|
160
|
-
{ func: 'transparentize($color, $amount)', desc:
|
|
161
|
-
{ func: 'fade-out($color, $amount)', desc:
|
|
162
|
-
{ func: 'adjust-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])', desc:
|
|
163
|
-
{ func: 'scale-color($color, [$red], [$green], [$blue], [$saturation], [$lightness], [$alpha])', desc:
|
|
164
|
-
{ func: 'change-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])', desc:
|
|
165
|
-
{ func: 'ie-hex-str($color)', desc:
|
|
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:
|
|
169
|
-
{ func: 'selector-append($selectors…)', desc:
|
|
170
|
-
{ func: 'selector-extend($selector, $extendee, $extender)', desc:
|
|
171
|
-
{ func: 'selector-replace($selector, $original, $replacement)', desc:
|
|
172
|
-
{ func: 'selector-unify($selector1, $selector2)', desc:
|
|
173
|
-
{ func: 'is-superselector($super, $sub)', desc:
|
|
174
|
-
{ func: 'simple-selectors($selector)', desc:
|
|
175
|
-
{ func: 'selector-parse($selector)', desc:
|
|
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:
|
|
179
|
-
{ func: 'quote($string)', desc:
|
|
180
|
-
{ func: 'str-length($string)', desc:
|
|
181
|
-
{ func: 'str-insert($string, $insert, $index)', desc:
|
|
182
|
-
{ func: 'str-index($string, $substring)', desc:
|
|
183
|
-
{ func: 'str-slice($string, $start-at, [$end-at])', desc:
|
|
184
|
-
{ func: 'to-upper-case($string)', desc:
|
|
185
|
-
{ func: 'to-lower-case($string)', desc:
|
|
186
|
-
{ func: 'percentage($number)', desc:
|
|
187
|
-
{ func: 'round($number)', desc:
|
|
188
|
-
{ func: 'ceil($number)', desc:
|
|
189
|
-
{ func: 'floor($number)', desc:
|
|
190
|
-
{ func: 'abs($number)', desc:
|
|
191
|
-
{ func: 'min($numbers)', desc:
|
|
192
|
-
{ func: 'max($numbers)', desc:
|
|
193
|
-
{ func: 'random([$limit])', desc:
|
|
194
|
-
{ func: 'length($list)', desc:
|
|
195
|
-
{ func: 'nth($list, $n)', desc:
|
|
196
|
-
{ func: 'set-nth($list, $n, $value)', desc:
|
|
197
|
-
{ func: 'join($list1, $list2, [$separator])', desc:
|
|
198
|
-
{ func: 'append($list1, $val, [$separator])', desc:
|
|
199
|
-
{ func: 'zip($lists)', desc:
|
|
200
|
-
{ func: 'index($list, $value)', desc:
|
|
201
|
-
{ func: 'list-separator(#list)', desc:
|
|
202
|
-
{ func: 'map-get($map, $key)', desc:
|
|
203
|
-
{ func: 'map-merge($map1, $map2)', desc:
|
|
204
|
-
{ func: 'map-remove($map, $keys)', desc:
|
|
205
|
-
{ func: 'map-keys($map)', desc:
|
|
206
|
-
{ func: 'map-values($map)', desc:
|
|
207
|
-
{ func: 'map-has-key($map, $key)', desc:
|
|
208
|
-
{ func: 'keywords($args)', desc:
|
|
209
|
-
{ func: 'feature-exists($feature)', desc:
|
|
210
|
-
{ func: 'variable-exists($name)', desc:
|
|
211
|
-
{ func: 'global-variable-exists($name)', desc:
|
|
212
|
-
{ func: 'function-exists($name)', desc:
|
|
213
|
-
{ func: 'mixin-exists($name)', desc:
|
|
214
|
-
{ func: 'inspect($value)', desc:
|
|
215
|
-
{ func: 'type-of($value)', desc:
|
|
216
|
-
{ func: 'unit($number)', desc:
|
|
217
|
-
{ func: 'unitless($number)', desc:
|
|
218
|
-
{ func: 'comparable($number1, $number2)', desc:
|
|
219
|
-
{ func: 'call($name, $args…)', desc:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
297
|
-
references: [{ name:
|
|
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:
|
|
305
|
-
references: [{ name:
|
|
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:
|
|
315
|
-
references: [{ name:
|
|
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:
|
|
320
|
-
references: [{ name:
|
|
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:
|
|
325
|
-
references: [{ name:
|
|
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:
|
|
330
|
-
references: [{ name:
|
|
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:
|
|
335
|
-
references: [{ name:
|
|
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:
|
|
340
|
-
references: [{ name:
|
|
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:
|
|
345
|
-
references: [{ name:
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
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": "^
|
|
18
|
+
"@types/mocha": "^10.0.0",
|
|
19
19
|
"@types/node": "16.x",
|
|
20
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
21
|
-
"@typescript-eslint/parser": "^5.
|
|
22
|
-
"@vscode/web-custom-data": "^0.4.
|
|
23
|
-
"eslint": "^8.
|
|
24
|
-
"js-beautify": "^1.14.
|
|
25
|
-
"mocha": "^10.
|
|
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.
|
|
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-
|
|
34
|
-
"vscode-uri": "^3.0.4"
|
|
34
|
+
"vscode-uri": "^3.0.6"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
|
-
"
|
|
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
|
}
|