vscode-css-languageservice 5.4.2 → 6.0.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 (84) hide show
  1. package/CHANGELOG.md +5 -1
  2. package/lib/esm/cssLanguageService.d.ts +37 -37
  3. package/lib/esm/cssLanguageService.js +72 -75
  4. package/lib/esm/cssLanguageTypes.d.ts +238 -238
  5. package/lib/esm/cssLanguageTypes.js +42 -42
  6. package/lib/esm/data/webCustomData.js +21965 -21965
  7. package/lib/esm/languageFacts/builtinData.js +142 -142
  8. package/lib/esm/languageFacts/colors.js +469 -472
  9. package/lib/esm/languageFacts/dataManager.js +88 -92
  10. package/lib/esm/languageFacts/dataProvider.js +73 -79
  11. package/lib/esm/languageFacts/entry.js +137 -138
  12. package/lib/esm/languageFacts/facts.js +8 -8
  13. package/lib/esm/parser/cssErrors.js +48 -50
  14. package/lib/esm/parser/cssNodes.js +1502 -2019
  15. package/lib/esm/parser/cssParser.js +1534 -1563
  16. package/lib/esm/parser/cssScanner.js +592 -599
  17. package/lib/esm/parser/cssSymbolScope.js +311 -341
  18. package/lib/esm/parser/lessParser.js +714 -740
  19. package/lib/esm/parser/lessScanner.js +57 -78
  20. package/lib/esm/parser/scssErrors.js +18 -20
  21. package/lib/esm/parser/scssParser.js +796 -818
  22. package/lib/esm/parser/scssScanner.js +95 -116
  23. package/lib/esm/services/cssCodeActions.js +77 -81
  24. package/lib/esm/services/cssCompletion.js +1054 -1149
  25. package/lib/esm/services/cssFolding.js +190 -193
  26. package/lib/esm/services/cssFormatter.js +136 -136
  27. package/lib/esm/services/cssHover.js +148 -151
  28. package/lib/esm/services/cssNavigation.js +378 -470
  29. package/lib/esm/services/cssSelectionRange.js +47 -47
  30. package/lib/esm/services/cssValidation.js +41 -44
  31. package/lib/esm/services/lessCompletion.js +378 -397
  32. package/lib/esm/services/lint.js +518 -532
  33. package/lib/esm/services/lintRules.js +76 -83
  34. package/lib/esm/services/lintUtil.js +196 -205
  35. package/lib/esm/services/pathCompletion.js +157 -231
  36. package/lib/esm/services/scssCompletion.js +354 -378
  37. package/lib/esm/services/scssNavigation.js +82 -154
  38. package/lib/esm/services/selectorPrinting.js +492 -536
  39. package/lib/esm/utils/arrays.js +40 -46
  40. package/lib/esm/utils/objects.js +11 -11
  41. package/lib/esm/utils/resources.js +11 -24
  42. package/lib/esm/utils/strings.js +102 -104
  43. package/lib/umd/cssLanguageService.d.ts +37 -37
  44. package/lib/umd/cssLanguageService.js +99 -102
  45. package/lib/umd/cssLanguageTypes.d.ts +238 -238
  46. package/lib/umd/cssLanguageTypes.js +89 -88
  47. package/lib/umd/data/webCustomData.js +21978 -21978
  48. package/lib/umd/languageFacts/builtinData.js +154 -154
  49. package/lib/umd/languageFacts/colors.js +492 -495
  50. package/lib/umd/languageFacts/dataManager.js +101 -104
  51. package/lib/umd/languageFacts/dataProvider.js +86 -91
  52. package/lib/umd/languageFacts/entry.js +152 -153
  53. package/lib/umd/languageFacts/facts.js +29 -29
  54. package/lib/umd/parser/cssErrors.js +61 -62
  55. package/lib/umd/parser/cssNodes.js +1587 -2034
  56. package/lib/umd/parser/cssParser.js +1547 -1575
  57. package/lib/umd/parser/cssScanner.js +606 -611
  58. package/lib/umd/parser/cssSymbolScope.js +328 -353
  59. package/lib/umd/parser/lessParser.js +727 -752
  60. package/lib/umd/parser/lessScanner.js +70 -90
  61. package/lib/umd/parser/scssErrors.js +31 -32
  62. package/lib/umd/parser/scssParser.js +809 -830
  63. package/lib/umd/parser/scssScanner.js +108 -128
  64. package/lib/umd/services/cssCodeActions.js +90 -93
  65. package/lib/umd/services/cssCompletion.js +1067 -1161
  66. package/lib/umd/services/cssFolding.js +203 -206
  67. package/lib/umd/services/cssFormatter.js +150 -150
  68. package/lib/umd/services/cssHover.js +161 -163
  69. package/lib/umd/services/cssNavigation.js +391 -482
  70. package/lib/umd/services/cssSelectionRange.js +60 -60
  71. package/lib/umd/services/cssValidation.js +54 -56
  72. package/lib/umd/services/lessCompletion.js +391 -409
  73. package/lib/umd/services/lint.js +531 -544
  74. package/lib/umd/services/lintRules.js +91 -95
  75. package/lib/umd/services/lintUtil.js +210 -218
  76. package/lib/umd/services/pathCompletion.js +171 -244
  77. package/lib/umd/services/scssCompletion.js +367 -390
  78. package/lib/umd/services/scssNavigation.js +95 -166
  79. package/lib/umd/services/selectorPrinting.js +510 -550
  80. package/lib/umd/utils/arrays.js +55 -61
  81. package/lib/umd/utils/objects.js +25 -25
  82. package/lib/umd/utils/resources.js +26 -39
  83. package/lib/umd/utils/strings.js +120 -122
  84. package/package.json +10 -10
@@ -1,104 +1,101 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "../utils/objects", "../data/webCustomData", "./dataProvider"], factory);
8
- }
9
- })(function (require, exports) {
10
- /*---------------------------------------------------------------------------------------------
11
- * Copyright (c) Microsoft Corporation. All rights reserved.
12
- * Licensed under the MIT License. See License.txt in the project root for license information.
13
- *--------------------------------------------------------------------------------------------*/
14
- 'use strict';
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.CSSDataManager = void 0;
17
- var objects = require("../utils/objects");
18
- var webCustomData_1 = require("../data/webCustomData");
19
- var dataProvider_1 = require("./dataProvider");
20
- var CSSDataManager = /** @class */ (function () {
21
- function CSSDataManager(options) {
22
- this.dataProviders = [];
23
- this._propertySet = {};
24
- this._atDirectiveSet = {};
25
- this._pseudoClassSet = {};
26
- this._pseudoElementSet = {};
27
- this._properties = [];
28
- this._atDirectives = [];
29
- this._pseudoClasses = [];
30
- this._pseudoElements = [];
31
- this.setDataProviders((options === null || options === void 0 ? void 0 : options.useDefaultDataProvider) !== false, (options === null || options === void 0 ? void 0 : options.customDataProviders) || []);
32
- }
33
- CSSDataManager.prototype.setDataProviders = function (builtIn, providers) {
34
- var _a;
35
- this.dataProviders = [];
36
- if (builtIn) {
37
- this.dataProviders.push(new dataProvider_1.CSSDataProvider(webCustomData_1.cssData));
38
- }
39
- (_a = this.dataProviders).push.apply(_a, providers);
40
- this.collectData();
41
- };
42
- /**
43
- * Collect all data & handle duplicates
44
- */
45
- CSSDataManager.prototype.collectData = function () {
46
- var _this = this;
47
- this._propertySet = {};
48
- this._atDirectiveSet = {};
49
- this._pseudoClassSet = {};
50
- this._pseudoElementSet = {};
51
- this.dataProviders.forEach(function (provider) {
52
- provider.provideProperties().forEach(function (p) {
53
- if (!_this._propertySet[p.name]) {
54
- _this._propertySet[p.name] = p;
55
- }
56
- });
57
- provider.provideAtDirectives().forEach(function (p) {
58
- if (!_this._atDirectiveSet[p.name]) {
59
- _this._atDirectiveSet[p.name] = p;
60
- }
61
- });
62
- provider.providePseudoClasses().forEach(function (p) {
63
- if (!_this._pseudoClassSet[p.name]) {
64
- _this._pseudoClassSet[p.name] = p;
65
- }
66
- });
67
- provider.providePseudoElements().forEach(function (p) {
68
- if (!_this._pseudoElementSet[p.name]) {
69
- _this._pseudoElementSet[p.name] = p;
70
- }
71
- });
72
- });
73
- this._properties = objects.values(this._propertySet);
74
- this._atDirectives = objects.values(this._atDirectiveSet);
75
- this._pseudoClasses = objects.values(this._pseudoClassSet);
76
- this._pseudoElements = objects.values(this._pseudoElementSet);
77
- };
78
- CSSDataManager.prototype.getProperty = function (name) { return this._propertySet[name]; };
79
- CSSDataManager.prototype.getAtDirective = function (name) { return this._atDirectiveSet[name]; };
80
- CSSDataManager.prototype.getPseudoClass = function (name) { return this._pseudoClassSet[name]; };
81
- CSSDataManager.prototype.getPseudoElement = function (name) { return this._pseudoElementSet[name]; };
82
- CSSDataManager.prototype.getProperties = function () {
83
- return this._properties;
84
- };
85
- CSSDataManager.prototype.getAtDirectives = function () {
86
- return this._atDirectives;
87
- };
88
- CSSDataManager.prototype.getPseudoClasses = function () {
89
- return this._pseudoClasses;
90
- };
91
- CSSDataManager.prototype.getPseudoElements = function () {
92
- return this._pseudoElements;
93
- };
94
- CSSDataManager.prototype.isKnownProperty = function (name) {
95
- return name.toLowerCase() in this._propertySet;
96
- };
97
- CSSDataManager.prototype.isStandardProperty = function (name) {
98
- return this.isKnownProperty(name) &&
99
- (!this._propertySet[name.toLowerCase()].status || this._propertySet[name.toLowerCase()].status === 'standard');
100
- };
101
- return CSSDataManager;
102
- }());
103
- exports.CSSDataManager = CSSDataManager;
104
- });
1
+ (function (factory) {
2
+ if (typeof module === "object" && typeof module.exports === "object") {
3
+ var v = factory(require, exports);
4
+ if (v !== undefined) module.exports = v;
5
+ }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports", "../utils/objects", "../data/webCustomData", "./dataProvider"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ /*---------------------------------------------------------------------------------------------
11
+ * Copyright (c) Microsoft Corporation. All rights reserved.
12
+ * Licensed under the MIT License. See License.txt in the project root for license information.
13
+ *--------------------------------------------------------------------------------------------*/
14
+ 'use strict';
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.CSSDataManager = void 0;
17
+ const objects = require("../utils/objects");
18
+ const webCustomData_1 = require("../data/webCustomData");
19
+ const dataProvider_1 = require("./dataProvider");
20
+ class CSSDataManager {
21
+ constructor(options) {
22
+ this.dataProviders = [];
23
+ this._propertySet = {};
24
+ this._atDirectiveSet = {};
25
+ this._pseudoClassSet = {};
26
+ this._pseudoElementSet = {};
27
+ this._properties = [];
28
+ this._atDirectives = [];
29
+ this._pseudoClasses = [];
30
+ this._pseudoElements = [];
31
+ this.setDataProviders(options?.useDefaultDataProvider !== false, options?.customDataProviders || []);
32
+ }
33
+ setDataProviders(builtIn, providers) {
34
+ this.dataProviders = [];
35
+ if (builtIn) {
36
+ this.dataProviders.push(new dataProvider_1.CSSDataProvider(webCustomData_1.cssData));
37
+ }
38
+ this.dataProviders.push(...providers);
39
+ this.collectData();
40
+ }
41
+ /**
42
+ * Collect all data & handle duplicates
43
+ */
44
+ collectData() {
45
+ this._propertySet = {};
46
+ this._atDirectiveSet = {};
47
+ this._pseudoClassSet = {};
48
+ this._pseudoElementSet = {};
49
+ this.dataProviders.forEach(provider => {
50
+ provider.provideProperties().forEach(p => {
51
+ if (!this._propertySet[p.name]) {
52
+ this._propertySet[p.name] = p;
53
+ }
54
+ });
55
+ provider.provideAtDirectives().forEach(p => {
56
+ if (!this._atDirectiveSet[p.name]) {
57
+ this._atDirectiveSet[p.name] = p;
58
+ }
59
+ });
60
+ provider.providePseudoClasses().forEach(p => {
61
+ if (!this._pseudoClassSet[p.name]) {
62
+ this._pseudoClassSet[p.name] = p;
63
+ }
64
+ });
65
+ provider.providePseudoElements().forEach(p => {
66
+ if (!this._pseudoElementSet[p.name]) {
67
+ this._pseudoElementSet[p.name] = p;
68
+ }
69
+ });
70
+ });
71
+ this._properties = objects.values(this._propertySet);
72
+ this._atDirectives = objects.values(this._atDirectiveSet);
73
+ this._pseudoClasses = objects.values(this._pseudoClassSet);
74
+ this._pseudoElements = objects.values(this._pseudoElementSet);
75
+ }
76
+ getProperty(name) { return this._propertySet[name]; }
77
+ getAtDirective(name) { return this._atDirectiveSet[name]; }
78
+ getPseudoClass(name) { return this._pseudoClassSet[name]; }
79
+ getPseudoElement(name) { return this._pseudoElementSet[name]; }
80
+ getProperties() {
81
+ return this._properties;
82
+ }
83
+ getAtDirectives() {
84
+ return this._atDirectives;
85
+ }
86
+ getPseudoClasses() {
87
+ return this._pseudoClasses;
88
+ }
89
+ getPseudoElements() {
90
+ return this._pseudoElements;
91
+ }
92
+ isKnownProperty(name) {
93
+ return name.toLowerCase() in this._propertySet;
94
+ }
95
+ isStandardProperty(name) {
96
+ return this.isKnownProperty(name) &&
97
+ (!this._propertySet[name.toLowerCase()].status || this._propertySet[name.toLowerCase()].status === 'standard');
98
+ }
99
+ }
100
+ exports.CSSDataManager = CSSDataManager;
101
+ });
@@ -1,91 +1,86 @@
1
- (function (factory) {
2
- if (typeof module === "object" && typeof module.exports === "object") {
3
- var v = factory(require, exports);
4
- if (v !== undefined) module.exports = v;
5
- }
6
- else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports"], factory);
8
- }
9
- })(function (require, exports) {
10
- /*---------------------------------------------------------------------------------------------
11
- * Copyright (c) Microsoft Corporation. All rights reserved.
12
- * Licensed under the MIT License. See License.txt in the project root for license information.
13
- *--------------------------------------------------------------------------------------------*/
14
- 'use strict';
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.CSSDataProvider = void 0;
17
- var CSSDataProvider = /** @class */ (function () {
18
- /**
19
- * Currently, unversioned data uses the V1 implementation
20
- * In the future when the provider handles multiple versions of HTML custom data,
21
- * use the latest implementation for unversioned data
22
- */
23
- function CSSDataProvider(data) {
24
- this._properties = [];
25
- this._atDirectives = [];
26
- this._pseudoClasses = [];
27
- this._pseudoElements = [];
28
- this.addData(data);
29
- }
30
- CSSDataProvider.prototype.provideProperties = function () {
31
- return this._properties;
32
- };
33
- CSSDataProvider.prototype.provideAtDirectives = function () {
34
- return this._atDirectives;
35
- };
36
- CSSDataProvider.prototype.providePseudoClasses = function () {
37
- return this._pseudoClasses;
38
- };
39
- CSSDataProvider.prototype.providePseudoElements = function () {
40
- return this._pseudoElements;
41
- };
42
- CSSDataProvider.prototype.addData = function (data) {
43
- if (Array.isArray(data.properties)) {
44
- for (var _i = 0, _a = data.properties; _i < _a.length; _i++) {
45
- var prop = _a[_i];
46
- if (isPropertyData(prop)) {
47
- this._properties.push(prop);
48
- }
49
- }
50
- }
51
- if (Array.isArray(data.atDirectives)) {
52
- for (var _b = 0, _c = data.atDirectives; _b < _c.length; _b++) {
53
- var prop = _c[_b];
54
- if (isAtDirective(prop)) {
55
- this._atDirectives.push(prop);
56
- }
57
- }
58
- }
59
- if (Array.isArray(data.pseudoClasses)) {
60
- for (var _d = 0, _e = data.pseudoClasses; _d < _e.length; _d++) {
61
- var prop = _e[_d];
62
- if (isPseudoClassData(prop)) {
63
- this._pseudoClasses.push(prop);
64
- }
65
- }
66
- }
67
- if (Array.isArray(data.pseudoElements)) {
68
- for (var _f = 0, _g = data.pseudoElements; _f < _g.length; _f++) {
69
- var prop = _g[_f];
70
- if (isPseudoElementData(prop)) {
71
- this._pseudoElements.push(prop);
72
- }
73
- }
74
- }
75
- };
76
- return CSSDataProvider;
77
- }());
78
- exports.CSSDataProvider = CSSDataProvider;
79
- function isPropertyData(d) {
80
- return typeof d.name === 'string';
81
- }
82
- function isAtDirective(d) {
83
- return typeof d.name === 'string';
84
- }
85
- function isPseudoClassData(d) {
86
- return typeof d.name === 'string';
87
- }
88
- function isPseudoElementData(d) {
89
- return typeof d.name === 'string';
90
- }
91
- });
1
+ (function (factory) {
2
+ if (typeof module === "object" && typeof module.exports === "object") {
3
+ var v = factory(require, exports);
4
+ if (v !== undefined) module.exports = v;
5
+ }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports"], factory);
8
+ }
9
+ })(function (require, exports) {
10
+ /*---------------------------------------------------------------------------------------------
11
+ * Copyright (c) Microsoft Corporation. All rights reserved.
12
+ * Licensed under the MIT License. See License.txt in the project root for license information.
13
+ *--------------------------------------------------------------------------------------------*/
14
+ 'use strict';
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.CSSDataProvider = void 0;
17
+ class CSSDataProvider {
18
+ /**
19
+ * Currently, unversioned data uses the V1 implementation
20
+ * In the future when the provider handles multiple versions of HTML custom data,
21
+ * use the latest implementation for unversioned data
22
+ */
23
+ constructor(data) {
24
+ this._properties = [];
25
+ this._atDirectives = [];
26
+ this._pseudoClasses = [];
27
+ this._pseudoElements = [];
28
+ this.addData(data);
29
+ }
30
+ provideProperties() {
31
+ return this._properties;
32
+ }
33
+ provideAtDirectives() {
34
+ return this._atDirectives;
35
+ }
36
+ providePseudoClasses() {
37
+ return this._pseudoClasses;
38
+ }
39
+ providePseudoElements() {
40
+ return this._pseudoElements;
41
+ }
42
+ addData(data) {
43
+ if (Array.isArray(data.properties)) {
44
+ for (const prop of data.properties) {
45
+ if (isPropertyData(prop)) {
46
+ this._properties.push(prop);
47
+ }
48
+ }
49
+ }
50
+ if (Array.isArray(data.atDirectives)) {
51
+ for (const prop of data.atDirectives) {
52
+ if (isAtDirective(prop)) {
53
+ this._atDirectives.push(prop);
54
+ }
55
+ }
56
+ }
57
+ if (Array.isArray(data.pseudoClasses)) {
58
+ for (const prop of data.pseudoClasses) {
59
+ if (isPseudoClassData(prop)) {
60
+ this._pseudoClasses.push(prop);
61
+ }
62
+ }
63
+ }
64
+ if (Array.isArray(data.pseudoElements)) {
65
+ for (const prop of data.pseudoElements) {
66
+ if (isPseudoElementData(prop)) {
67
+ this._pseudoElements.push(prop);
68
+ }
69
+ }
70
+ }
71
+ }
72
+ }
73
+ exports.CSSDataProvider = CSSDataProvider;
74
+ function isPropertyData(d) {
75
+ return typeof d.name === 'string';
76
+ }
77
+ function isAtDirective(d) {
78
+ return typeof d.name === 'string';
79
+ }
80
+ function isPseudoClassData(d) {
81
+ return typeof d.name === 'string';
82
+ }
83
+ function isPseudoElementData(d) {
84
+ return typeof d.name === 'string';
85
+ }
86
+ });