vscode-css-languageservice 5.4.2 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -1
- package/SECURITY.md +41 -0
- package/lib/esm/beautify/beautify-css.js +11 -4
- package/lib/esm/cssLanguageService.d.ts +2 -1
- package/lib/esm/cssLanguageService.js +15 -17
- package/lib/esm/cssLanguageTypes.js +2 -2
- package/lib/esm/data/webCustomData.js +356 -232
- package/lib/esm/languageFacts/builtinData.js +15 -15
- package/lib/esm/languageFacts/colors.js +66 -69
- package/lib/esm/languageFacts/dataManager.js +38 -42
- package/lib/esm/languageFacts/dataProvider.js +17 -23
- package/lib/esm/languageFacts/entry.js +22 -23
- package/lib/esm/parser/cssErrors.js +5 -7
- package/lib/esm/parser/cssNodes.js +869 -1377
- package/lib/esm/parser/cssParser.js +419 -376
- package/lib/esm/parser/cssScanner.js +168 -175
- package/lib/esm/parser/cssSymbolScope.js +107 -137
- package/lib/esm/parser/lessParser.js +177 -202
- package/lib/esm/parser/lessScanner.js +22 -43
- package/lib/esm/parser/scssErrors.js +5 -7
- package/lib/esm/parser/scssParser.js +196 -208
- package/lib/esm/parser/scssScanner.js +33 -54
- package/lib/esm/services/cssCodeActions.js +36 -40
- package/lib/esm/services/cssCompletion.js +300 -395
- package/lib/esm/services/cssFolding.js +32 -35
- package/lib/esm/services/cssFormatter.js +22 -22
- package/lib/esm/services/cssHover.js +30 -33
- package/lib/esm/services/cssNavigation.js +260 -289
- package/lib/esm/services/cssSelectionRange.js +6 -6
- package/lib/esm/services/cssValidation.js +13 -16
- package/lib/esm/services/lessCompletion.js +351 -370
- package/lib/esm/services/lint.js +161 -175
- package/lib/esm/services/lintRules.js +20 -27
- package/lib/esm/services/lintUtil.js +19 -28
- package/lib/esm/services/pathCompletion.js +84 -158
- package/lib/esm/services/scssCompletion.js +283 -307
- package/lib/esm/services/scssNavigation.js +65 -137
- package/lib/esm/services/selectorPrinting.js +131 -175
- package/lib/esm/utils/arrays.js +6 -12
- package/lib/esm/utils/objects.js +1 -1
- package/lib/esm/utils/resources.js +3 -16
- package/lib/esm/utils/strings.js +10 -12
- package/lib/umd/beautify/beautify-css.js +11 -4
- package/lib/umd/cssLanguageService.d.ts +2 -1
- package/lib/umd/cssLanguageService.js +34 -32
- package/lib/umd/cssLanguageTypes.js +4 -3
- package/lib/umd/data/webCustomData.js +355 -231
- package/lib/umd/languageFacts/colors.js +65 -68
- package/lib/umd/languageFacts/dataManager.js +41 -44
- package/lib/umd/languageFacts/dataProvider.js +17 -22
- package/lib/umd/languageFacts/entry.js +22 -23
- package/lib/umd/languageFacts/facts.js +5 -1
- package/lib/umd/parser/cssErrors.js +5 -6
- package/lib/umd/parser/cssNodes.js +870 -1307
- package/lib/umd/parser/cssParser.js +424 -380
- package/lib/umd/parser/cssScanner.js +168 -173
- package/lib/umd/parser/cssSymbolScope.js +109 -134
- package/lib/umd/parser/lessParser.js +182 -206
- package/lib/umd/parser/lessScanner.js +22 -42
- package/lib/umd/parser/scssErrors.js +5 -6
- package/lib/umd/parser/scssParser.js +202 -213
- package/lib/umd/parser/scssScanner.js +25 -45
- package/lib/umd/services/cssCodeActions.js +41 -44
- package/lib/umd/services/cssCompletion.js +308 -402
- package/lib/umd/services/cssFolding.js +35 -38
- package/lib/umd/services/cssFormatter.js +25 -25
- package/lib/umd/services/cssHover.js +36 -38
- package/lib/umd/services/cssNavigation.js +267 -295
- package/lib/umd/services/cssSelectionRange.js +8 -8
- package/lib/umd/services/cssValidation.js +17 -19
- package/lib/umd/services/lessCompletion.js +354 -372
- package/lib/umd/services/lint.js +167 -180
- package/lib/umd/services/lintRules.js +20 -24
- package/lib/umd/services/lintUtil.js +20 -28
- package/lib/umd/services/pathCompletion.js +87 -160
- package/lib/umd/services/scssCompletion.js +287 -310
- package/lib/umd/services/scssNavigation.js +69 -140
- package/lib/umd/services/selectorPrinting.js +134 -174
- package/lib/umd/utils/arrays.js +6 -12
- package/lib/umd/utils/objects.js +1 -1
- package/lib/umd/utils/resources.js +4 -17
- package/lib/umd/utils/strings.js +10 -12
- package/package.json +16 -15
|
@@ -2,15 +2,6 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
6
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
7
|
-
if (ar || !(i in from)) {
|
|
8
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
9
|
-
ar[i] = from[i];
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
13
|
-
};
|
|
14
5
|
(function (factory) {
|
|
15
6
|
if (typeof module === "object" && typeof module.exports === "object") {
|
|
16
7
|
var v = factory(require, exports);
|
|
@@ -23,17 +14,13 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
23
14
|
"use strict";
|
|
24
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
16
|
exports.joinPath = exports.dirname = void 0;
|
|
26
|
-
|
|
17
|
+
const vscode_uri_1 = require("vscode-uri");
|
|
27
18
|
function dirname(uriString) {
|
|
28
|
-
return vscode_uri_1.Utils.dirname(vscode_uri_1.URI.parse(uriString)).toString();
|
|
19
|
+
return vscode_uri_1.Utils.dirname(vscode_uri_1.URI.parse(uriString)).toString(true);
|
|
29
20
|
}
|
|
30
21
|
exports.dirname = dirname;
|
|
31
|
-
function joinPath(uriString) {
|
|
32
|
-
|
|
33
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
34
|
-
paths[_i - 1] = arguments[_i];
|
|
35
|
-
}
|
|
36
|
-
return vscode_uri_1.Utils.joinPath.apply(vscode_uri_1.Utils, __spreadArray([vscode_uri_1.URI.parse(uriString)], paths, false)).toString();
|
|
22
|
+
function joinPath(uriString, ...paths) {
|
|
23
|
+
return vscode_uri_1.Utils.joinPath(vscode_uri_1.URI.parse(uriString), ...paths).toString(true);
|
|
37
24
|
}
|
|
38
25
|
exports.joinPath = joinPath;
|
|
39
26
|
});
|
package/lib/umd/utils/strings.js
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
if (haystack.length < needle.length) {
|
|
19
19
|
return false;
|
|
20
20
|
}
|
|
21
|
-
for (
|
|
21
|
+
for (let i = 0; i < needle.length; i++) {
|
|
22
22
|
if (haystack[i] !== needle[i]) {
|
|
23
23
|
return false;
|
|
24
24
|
}
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
* Determines if haystack ends with needle.
|
|
31
31
|
*/
|
|
32
32
|
function endsWith(haystack, needle) {
|
|
33
|
-
|
|
33
|
+
let diff = haystack.length - needle.length;
|
|
34
34
|
if (diff > 0) {
|
|
35
35
|
return haystack.lastIndexOf(needle) === diff;
|
|
36
36
|
}
|
|
@@ -52,17 +52,16 @@
|
|
|
52
52
|
* @param first a string
|
|
53
53
|
* @param second a string
|
|
54
54
|
*/
|
|
55
|
-
function difference(first, second, maxLenDelta) {
|
|
56
|
-
|
|
57
|
-
var lengthDifference = Math.abs(first.length - second.length);
|
|
55
|
+
function difference(first, second, maxLenDelta = 4) {
|
|
56
|
+
let lengthDifference = Math.abs(first.length - second.length);
|
|
58
57
|
// We only compute score if length of the currentWord and length of entry.name are similar.
|
|
59
58
|
if (lengthDifference > maxLenDelta) {
|
|
60
59
|
return 0;
|
|
61
60
|
}
|
|
62
61
|
// Initialize LCS (largest common subsequence) matrix.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
let LCS = [];
|
|
63
|
+
let zeroArray = [];
|
|
64
|
+
let i, j;
|
|
66
65
|
for (i = 0; i < second.length + 1; ++i) {
|
|
67
66
|
zeroArray.push(0);
|
|
68
67
|
}
|
|
@@ -85,8 +84,7 @@
|
|
|
85
84
|
/**
|
|
86
85
|
* Limit of string length.
|
|
87
86
|
*/
|
|
88
|
-
function getLimitedString(str, ellipsis) {
|
|
89
|
-
if (ellipsis === void 0) { ellipsis = true; }
|
|
87
|
+
function getLimitedString(str, ellipsis = true) {
|
|
90
88
|
if (!str) {
|
|
91
89
|
return '';
|
|
92
90
|
}
|
|
@@ -100,7 +98,7 @@
|
|
|
100
98
|
* Limit of string length.
|
|
101
99
|
*/
|
|
102
100
|
function trim(str, regexp) {
|
|
103
|
-
|
|
101
|
+
const m = regexp.exec(str);
|
|
104
102
|
if (m && m[0].length) {
|
|
105
103
|
return str.substr(0, str.length - m[0].length);
|
|
106
104
|
}
|
|
@@ -108,7 +106,7 @@
|
|
|
108
106
|
}
|
|
109
107
|
exports.trim = trim;
|
|
110
108
|
function repeat(value, count) {
|
|
111
|
-
|
|
109
|
+
let s = '';
|
|
112
110
|
while (count > 0) {
|
|
113
111
|
if ((count & 1) === 1) {
|
|
114
112
|
s += value;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vscode-css-languageservice",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"description": "Language service for CSS, LESS and SCSS",
|
|
5
5
|
"main": "./lib/umd/cssLanguageService.js",
|
|
6
6
|
"typings": "./lib/umd/cssLanguageService",
|
|
@@ -15,21 +15,22 @@
|
|
|
15
15
|
"url": "https://github.com/Microsoft/vscode-css-languageservice"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@types/mocha": "^9.1.
|
|
19
|
-
"@types/node": "
|
|
20
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
21
|
-
"@typescript-eslint/parser": "^5.
|
|
22
|
-
"@vscode/web-custom-data": "^0.
|
|
23
|
-
"eslint": "^8.
|
|
24
|
-
"js-beautify": "^1.14.
|
|
25
|
-
"mocha": "^
|
|
18
|
+
"@types/mocha": "^9.1.1",
|
|
19
|
+
"@types/node": "16.x",
|
|
20
|
+
"@typescript-eslint/eslint-plugin": "^5.36.1",
|
|
21
|
+
"@typescript-eslint/parser": "^5.36.1",
|
|
22
|
+
"@vscode/web-custom-data": "^0.4.2",
|
|
23
|
+
"eslint": "^8.23.0",
|
|
24
|
+
"js-beautify": "^1.14.6",
|
|
25
|
+
"mocha": "^10.0.0",
|
|
26
26
|
"rimraf": "^3.0.2",
|
|
27
|
-
"
|
|
27
|
+
"source-map-support": "^0.5.21",
|
|
28
|
+
"typescript": "^4.8.2"
|
|
28
29
|
},
|
|
29
30
|
"dependencies": {
|
|
30
|
-
"vscode-languageserver-textdocument": "^1.0.
|
|
31
|
-
"vscode-languageserver-types": "^3.
|
|
32
|
-
"vscode-nls": "^5.
|
|
31
|
+
"vscode-languageserver-textdocument": "^1.0.7",
|
|
32
|
+
"vscode-languageserver-types": "^3.17.2",
|
|
33
|
+
"vscode-nls": "^5.2.0",
|
|
33
34
|
"vscode-uri": "^3.0.3"
|
|
34
35
|
},
|
|
35
36
|
"scripts": {
|
|
@@ -40,8 +41,8 @@
|
|
|
40
41
|
"clean": "rimraf lib",
|
|
41
42
|
"remove-sourcemap-refs": "node ./build/remove-sourcemap-refs.js",
|
|
42
43
|
"watch": "npm run copy-jsbeautify && tsc -w -p ./src",
|
|
43
|
-
"test": "npm run compile && mocha",
|
|
44
|
-
"mocha": "mocha",
|
|
44
|
+
"test": "npm run compile && npm run mocha",
|
|
45
|
+
"mocha": "mocha --require source-map-support/register",
|
|
45
46
|
"coverage": "npm run compile && npx nyc --reporter=html --reporter=text mocha",
|
|
46
47
|
"lint": "eslint src/**/*.ts",
|
|
47
48
|
"update-data": "yarn add @vscode/web-custom-data -D && node ./build/generateData.js",
|