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,37 +14,33 @@ var __extends = (this && this.__extends) || (function () {
29
14
  'use strict';
30
15
  Object.defineProperty(exports, "__esModule", { value: true });
31
16
  exports.LESSScanner = exports.Ellipsis = void 0;
32
- var scanner = require("./cssScanner");
33
- var _FSL = '/'.charCodeAt(0);
34
- var _NWL = '\n'.charCodeAt(0);
35
- var _CAR = '\r'.charCodeAt(0);
36
- var _LFD = '\f'.charCodeAt(0);
37
- var _TIC = '`'.charCodeAt(0);
38
- var _DOT = '.'.charCodeAt(0);
39
- var customTokenValue = scanner.TokenType.CustomToken;
17
+ const scanner = require("./cssScanner");
18
+ const _FSL = '/'.charCodeAt(0);
19
+ const _NWL = '\n'.charCodeAt(0);
20
+ const _CAR = '\r'.charCodeAt(0);
21
+ const _LFD = '\f'.charCodeAt(0);
22
+ const _TIC = '`'.charCodeAt(0);
23
+ const _DOT = '.'.charCodeAt(0);
24
+ let customTokenValue = scanner.TokenType.CustomToken;
40
25
  exports.Ellipsis = customTokenValue++;
41
- var LESSScanner = /** @class */ (function (_super) {
42
- __extends(LESSScanner, _super);
43
- function LESSScanner() {
44
- return _super !== null && _super.apply(this, arguments) || this;
45
- }
46
- LESSScanner.prototype.scanNext = function (offset) {
26
+ class LESSScanner extends scanner.Scanner {
27
+ scanNext(offset) {
47
28
  // LESS: escaped JavaScript code `const a = "dddd"`
48
- var tokenType = this.escapedJavaScript();
29
+ const tokenType = this.escapedJavaScript();
49
30
  if (tokenType !== null) {
50
31
  return this.finishToken(offset, tokenType);
51
32
  }
52
33
  if (this.stream.advanceIfChars([_DOT, _DOT, _DOT])) {
53
34
  return this.finishToken(offset, exports.Ellipsis);
54
35
  }
55
- return _super.prototype.scanNext.call(this, offset);
56
- };
57
- LESSScanner.prototype.comment = function () {
58
- if (_super.prototype.comment.call(this)) {
36
+ return super.scanNext(offset);
37
+ }
38
+ comment() {
39
+ if (super.comment()) {
59
40
  return true;
60
41
  }
61
42
  if (!this.inURL && this.stream.advanceIfChars([_FSL, _FSL])) {
62
- this.stream.advanceWhileChar(function (ch) {
43
+ this.stream.advanceWhileChar((ch) => {
63
44
  switch (ch) {
64
45
  case _NWL:
65
46
  case _CAR:
@@ -74,17 +55,16 @@ var __extends = (this && this.__extends) || (function () {
74
55
  else {
75
56
  return false;
76
57
  }
77
- };
78
- LESSScanner.prototype.escapedJavaScript = function () {
79
- var ch = this.stream.peekChar();
58
+ }
59
+ escapedJavaScript() {
60
+ const ch = this.stream.peekChar();
80
61
  if (ch === _TIC) {
81
62
  this.stream.advance(1);
82
- this.stream.advanceWhileChar(function (ch) { return ch !== _TIC; });
63
+ this.stream.advanceWhileChar((ch) => { return ch !== _TIC; });
83
64
  return this.stream.advanceIfChar(_TIC) ? scanner.TokenType.EscapedJavaScript : scanner.TokenType.BadEscapedJavaScript;
84
65
  }
85
66
  return null;
86
- };
87
- return LESSScanner;
88
- }(scanner.Scanner));
67
+ }
68
+ }
89
69
  exports.LESSScanner = LESSScanner;
90
70
  });
@@ -14,15 +14,14 @@
14
14
  'use strict';
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.SCSSParseError = exports.SCSSIssueType = void 0;
17
- var nls = require("vscode-nls");
18
- var localize = nls.loadMessageBundle();
19
- var SCSSIssueType = /** @class */ (function () {
20
- function SCSSIssueType(id, message) {
17
+ const nls = require("vscode-nls");
18
+ const localize = nls.loadMessageBundle();
19
+ class SCSSIssueType {
20
+ constructor(id, message) {
21
21
  this.id = id;
22
22
  this.message = message;
23
23
  }
24
- return SCSSIssueType;
25
- }());
24
+ }
26
25
  exports.SCSSIssueType = SCSSIssueType;
27
26
  exports.SCSSParseError = {
28
27
  FromExpected: new SCSSIssueType('scss-fromexpected', localize('expected.from', "'from' expected")),