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
@@ -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
- var vscode_uri_1 = require("vscode-uri");
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
- var paths = [];
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
  });
@@ -18,7 +18,7 @@
18
18
  if (haystack.length < needle.length) {
19
19
  return false;
20
20
  }
21
- for (var i = 0; i < needle.length; i++) {
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
- var diff = haystack.length - needle.length;
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
- if (maxLenDelta === void 0) { maxLenDelta = 4; }
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
- var LCS = [];
64
- var zeroArray = [];
65
- var i, j;
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
- var m = regexp.exec(str);
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
- var s = '';
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": "5.4.2",
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.0",
19
- "@types/node": "^10.12.21",
20
- "@typescript-eslint/eslint-plugin": "^5.17.0",
21
- "@typescript-eslint/parser": "^5.17.0",
22
- "@vscode/web-custom-data": "^0.3.9",
23
- "eslint": "^8.11.0",
24
- "js-beautify": "^1.14.3",
25
- "mocha": "^9.2.2",
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
- "typescript": "^4.5.5"
27
+ "source-map-support": "^0.5.21",
28
+ "typescript": "^4.8.2"
28
29
  },
29
30
  "dependencies": {
30
- "vscode-languageserver-textdocument": "^1.0.4",
31
- "vscode-languageserver-types": "^3.16.0",
32
- "vscode-nls": "^5.0.0",
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",