vscode-css-languageservice 5.4.1 → 6.0.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.
Files changed (87) hide show
  1. package/CHANGELOG.md +5 -1
  2. package/README.md +1 -0
  3. package/lib/esm/beautify/beautify-css.js +50 -8
  4. package/lib/esm/cssLanguageService.d.ts +37 -37
  5. package/lib/esm/cssLanguageService.js +72 -75
  6. package/lib/esm/cssLanguageTypes.d.ts +238 -238
  7. package/lib/esm/cssLanguageTypes.js +42 -42
  8. package/lib/esm/data/webCustomData.js +21959 -21965
  9. package/lib/esm/languageFacts/builtinData.js +142 -142
  10. package/lib/esm/languageFacts/colors.js +469 -472
  11. package/lib/esm/languageFacts/dataManager.js +88 -92
  12. package/lib/esm/languageFacts/dataProvider.js +73 -79
  13. package/lib/esm/languageFacts/entry.js +137 -138
  14. package/lib/esm/languageFacts/facts.js +8 -8
  15. package/lib/esm/parser/cssErrors.js +48 -50
  16. package/lib/esm/parser/cssNodes.js +1502 -2019
  17. package/lib/esm/parser/cssParser.js +1534 -1566
  18. package/lib/esm/parser/cssScanner.js +592 -599
  19. package/lib/esm/parser/cssSymbolScope.js +311 -341
  20. package/lib/esm/parser/lessParser.js +714 -740
  21. package/lib/esm/parser/lessScanner.js +57 -78
  22. package/lib/esm/parser/scssErrors.js +18 -20
  23. package/lib/esm/parser/scssParser.js +796 -818
  24. package/lib/esm/parser/scssScanner.js +95 -116
  25. package/lib/esm/services/cssCodeActions.js +77 -81
  26. package/lib/esm/services/cssCompletion.js +1054 -1149
  27. package/lib/esm/services/cssFolding.js +190 -193
  28. package/lib/esm/services/cssFormatter.js +136 -136
  29. package/lib/esm/services/cssHover.js +148 -151
  30. package/lib/esm/services/cssNavigation.js +378 -470
  31. package/lib/esm/services/cssSelectionRange.js +47 -47
  32. package/lib/esm/services/cssValidation.js +41 -44
  33. package/lib/esm/services/lessCompletion.js +378 -397
  34. package/lib/esm/services/lint.js +518 -532
  35. package/lib/esm/services/lintRules.js +76 -83
  36. package/lib/esm/services/lintUtil.js +196 -205
  37. package/lib/esm/services/pathCompletion.js +157 -231
  38. package/lib/esm/services/scssCompletion.js +354 -378
  39. package/lib/esm/services/scssNavigation.js +82 -154
  40. package/lib/esm/services/selectorPrinting.js +492 -536
  41. package/lib/esm/utils/arrays.js +40 -46
  42. package/lib/esm/utils/objects.js +11 -11
  43. package/lib/esm/utils/resources.js +11 -24
  44. package/lib/esm/utils/strings.js +102 -104
  45. package/lib/umd/beautify/beautify-css.js +50 -8
  46. package/lib/umd/cssLanguageService.d.ts +37 -37
  47. package/lib/umd/cssLanguageService.js +99 -102
  48. package/lib/umd/cssLanguageTypes.d.ts +238 -238
  49. package/lib/umd/cssLanguageTypes.js +89 -88
  50. package/lib/umd/data/webCustomData.js +21972 -21978
  51. package/lib/umd/languageFacts/builtinData.js +154 -154
  52. package/lib/umd/languageFacts/colors.js +492 -495
  53. package/lib/umd/languageFacts/dataManager.js +101 -104
  54. package/lib/umd/languageFacts/dataProvider.js +86 -91
  55. package/lib/umd/languageFacts/entry.js +152 -153
  56. package/lib/umd/languageFacts/facts.js +29 -29
  57. package/lib/umd/parser/cssErrors.js +61 -62
  58. package/lib/umd/parser/cssNodes.js +1587 -2034
  59. package/lib/umd/parser/cssParser.js +1547 -1578
  60. package/lib/umd/parser/cssScanner.js +606 -611
  61. package/lib/umd/parser/cssSymbolScope.js +328 -353
  62. package/lib/umd/parser/lessParser.js +727 -752
  63. package/lib/umd/parser/lessScanner.js +70 -90
  64. package/lib/umd/parser/scssErrors.js +31 -32
  65. package/lib/umd/parser/scssParser.js +809 -830
  66. package/lib/umd/parser/scssScanner.js +108 -128
  67. package/lib/umd/services/cssCodeActions.js +90 -93
  68. package/lib/umd/services/cssCompletion.js +1067 -1161
  69. package/lib/umd/services/cssFolding.js +203 -206
  70. package/lib/umd/services/cssFormatter.js +150 -150
  71. package/lib/umd/services/cssHover.js +161 -163
  72. package/lib/umd/services/cssNavigation.js +391 -482
  73. package/lib/umd/services/cssSelectionRange.js +60 -60
  74. package/lib/umd/services/cssValidation.js +54 -56
  75. package/lib/umd/services/lessCompletion.js +391 -409
  76. package/lib/umd/services/lint.js +531 -544
  77. package/lib/umd/services/lintRules.js +91 -95
  78. package/lib/umd/services/lintUtil.js +210 -218
  79. package/lib/umd/services/pathCompletion.js +171 -244
  80. package/lib/umd/services/scssCompletion.js +367 -390
  81. package/lib/umd/services/scssNavigation.js +95 -166
  82. package/lib/umd/services/selectorPrinting.js +510 -550
  83. package/lib/umd/utils/arrays.js +55 -61
  84. package/lib/umd/utils/objects.js +25 -25
  85. package/lib/umd/utils/resources.js +26 -39
  86. package/lib/umd/utils/strings.js +120 -122
  87. package/package.json +11 -11
@@ -1,128 +1,108 @@
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
- (function (factory) {
17
- if (typeof module === "object" && typeof module.exports === "object") {
18
- var v = factory(require, exports);
19
- if (v !== undefined) module.exports = v;
20
- }
21
- else if (typeof define === "function" && define.amd) {
22
- define(["require", "exports", "./cssScanner"], factory);
23
- }
24
- })(function (require, exports) {
25
- /*---------------------------------------------------------------------------------------------
26
- * Copyright (c) Microsoft Corporation. All rights reserved.
27
- * Licensed under the MIT License. See License.txt in the project root for license information.
28
- *--------------------------------------------------------------------------------------------*/
29
- 'use strict';
30
- Object.defineProperty(exports, "__esModule", { value: true });
31
- exports.SCSSScanner = exports.Module = exports.Ellipsis = exports.SmallerEqualsOperator = exports.GreaterEqualsOperator = exports.NotEqualsOperator = exports.EqualsOperator = exports.Default = exports.InterpolationFunction = exports.VariableName = void 0;
32
- var cssScanner_1 = 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 _DLR = '$'.charCodeAt(0);
38
- var _HSH = '#'.charCodeAt(0);
39
- var _CUL = '{'.charCodeAt(0);
40
- var _EQS = '='.charCodeAt(0);
41
- var _BNG = '!'.charCodeAt(0);
42
- var _LAN = '<'.charCodeAt(0);
43
- var _RAN = '>'.charCodeAt(0);
44
- var _DOT = '.'.charCodeAt(0);
45
- var _ATS = '@'.charCodeAt(0);
46
- var customTokenValue = cssScanner_1.TokenType.CustomToken;
47
- exports.VariableName = customTokenValue++;
48
- exports.InterpolationFunction = customTokenValue++;
49
- exports.Default = customTokenValue++;
50
- exports.EqualsOperator = customTokenValue++;
51
- exports.NotEqualsOperator = customTokenValue++;
52
- exports.GreaterEqualsOperator = customTokenValue++;
53
- exports.SmallerEqualsOperator = customTokenValue++;
54
- exports.Ellipsis = customTokenValue++;
55
- exports.Module = customTokenValue++;
56
- var SCSSScanner = /** @class */ (function (_super) {
57
- __extends(SCSSScanner, _super);
58
- function SCSSScanner() {
59
- return _super !== null && _super.apply(this, arguments) || this;
60
- }
61
- SCSSScanner.prototype.scanNext = function (offset) {
62
- // scss variable
63
- if (this.stream.advanceIfChar(_DLR)) {
64
- var content = ['$'];
65
- if (this.ident(content)) {
66
- return this.finishToken(offset, exports.VariableName, content.join(''));
67
- }
68
- else {
69
- this.stream.goBackTo(offset);
70
- }
71
- }
72
- // scss: interpolation function #{..})
73
- if (this.stream.advanceIfChars([_HSH, _CUL])) {
74
- return this.finishToken(offset, exports.InterpolationFunction);
75
- }
76
- // operator ==
77
- if (this.stream.advanceIfChars([_EQS, _EQS])) {
78
- return this.finishToken(offset, exports.EqualsOperator);
79
- }
80
- // operator !=
81
- if (this.stream.advanceIfChars([_BNG, _EQS])) {
82
- return this.finishToken(offset, exports.NotEqualsOperator);
83
- }
84
- // operators <, <=
85
- if (this.stream.advanceIfChar(_LAN)) {
86
- if (this.stream.advanceIfChar(_EQS)) {
87
- return this.finishToken(offset, exports.SmallerEqualsOperator);
88
- }
89
- return this.finishToken(offset, cssScanner_1.TokenType.Delim);
90
- }
91
- // ooperators >, >=
92
- if (this.stream.advanceIfChar(_RAN)) {
93
- if (this.stream.advanceIfChar(_EQS)) {
94
- return this.finishToken(offset, exports.GreaterEqualsOperator);
95
- }
96
- return this.finishToken(offset, cssScanner_1.TokenType.Delim);
97
- }
98
- // ellipis
99
- if (this.stream.advanceIfChars([_DOT, _DOT, _DOT])) {
100
- return this.finishToken(offset, exports.Ellipsis);
101
- }
102
- return _super.prototype.scanNext.call(this, offset);
103
- };
104
- SCSSScanner.prototype.comment = function () {
105
- if (_super.prototype.comment.call(this)) {
106
- return true;
107
- }
108
- if (!this.inURL && this.stream.advanceIfChars([_FSL, _FSL])) {
109
- this.stream.advanceWhileChar(function (ch) {
110
- switch (ch) {
111
- case _NWL:
112
- case _CAR:
113
- case _LFD:
114
- return false;
115
- default:
116
- return true;
117
- }
118
- });
119
- return true;
120
- }
121
- else {
122
- return false;
123
- }
124
- };
125
- return SCSSScanner;
126
- }(cssScanner_1.Scanner));
127
- exports.SCSSScanner = SCSSScanner;
128
- });
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", "./cssScanner"], 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.SCSSScanner = exports.Module = exports.Ellipsis = exports.SmallerEqualsOperator = exports.GreaterEqualsOperator = exports.NotEqualsOperator = exports.EqualsOperator = exports.Default = exports.InterpolationFunction = exports.VariableName = void 0;
17
+ const cssScanner_1 = 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 _DLR = '$'.charCodeAt(0);
23
+ const _HSH = '#'.charCodeAt(0);
24
+ const _CUL = '{'.charCodeAt(0);
25
+ const _EQS = '='.charCodeAt(0);
26
+ const _BNG = '!'.charCodeAt(0);
27
+ const _LAN = '<'.charCodeAt(0);
28
+ const _RAN = '>'.charCodeAt(0);
29
+ const _DOT = '.'.charCodeAt(0);
30
+ const _ATS = '@'.charCodeAt(0);
31
+ let customTokenValue = cssScanner_1.TokenType.CustomToken;
32
+ exports.VariableName = customTokenValue++;
33
+ exports.InterpolationFunction = customTokenValue++;
34
+ exports.Default = customTokenValue++;
35
+ exports.EqualsOperator = customTokenValue++;
36
+ exports.NotEqualsOperator = customTokenValue++;
37
+ exports.GreaterEqualsOperator = customTokenValue++;
38
+ exports.SmallerEqualsOperator = customTokenValue++;
39
+ exports.Ellipsis = customTokenValue++;
40
+ exports.Module = customTokenValue++;
41
+ class SCSSScanner extends cssScanner_1.Scanner {
42
+ scanNext(offset) {
43
+ // scss variable
44
+ if (this.stream.advanceIfChar(_DLR)) {
45
+ const content = ['$'];
46
+ if (this.ident(content)) {
47
+ return this.finishToken(offset, exports.VariableName, content.join(''));
48
+ }
49
+ else {
50
+ this.stream.goBackTo(offset);
51
+ }
52
+ }
53
+ // scss: interpolation function #{..})
54
+ if (this.stream.advanceIfChars([_HSH, _CUL])) {
55
+ return this.finishToken(offset, exports.InterpolationFunction);
56
+ }
57
+ // operator ==
58
+ if (this.stream.advanceIfChars([_EQS, _EQS])) {
59
+ return this.finishToken(offset, exports.EqualsOperator);
60
+ }
61
+ // operator !=
62
+ if (this.stream.advanceIfChars([_BNG, _EQS])) {
63
+ return this.finishToken(offset, exports.NotEqualsOperator);
64
+ }
65
+ // operators <, <=
66
+ if (this.stream.advanceIfChar(_LAN)) {
67
+ if (this.stream.advanceIfChar(_EQS)) {
68
+ return this.finishToken(offset, exports.SmallerEqualsOperator);
69
+ }
70
+ return this.finishToken(offset, cssScanner_1.TokenType.Delim);
71
+ }
72
+ // ooperators >, >=
73
+ if (this.stream.advanceIfChar(_RAN)) {
74
+ if (this.stream.advanceIfChar(_EQS)) {
75
+ return this.finishToken(offset, exports.GreaterEqualsOperator);
76
+ }
77
+ return this.finishToken(offset, cssScanner_1.TokenType.Delim);
78
+ }
79
+ // ellipis
80
+ if (this.stream.advanceIfChars([_DOT, _DOT, _DOT])) {
81
+ return this.finishToken(offset, exports.Ellipsis);
82
+ }
83
+ return super.scanNext(offset);
84
+ }
85
+ comment() {
86
+ if (super.comment()) {
87
+ return true;
88
+ }
89
+ if (!this.inURL && this.stream.advanceIfChars([_FSL, _FSL])) {
90
+ this.stream.advanceWhileChar((ch) => {
91
+ switch (ch) {
92
+ case _NWL:
93
+ case _CAR:
94
+ case _LFD:
95
+ return false;
96
+ default:
97
+ return true;
98
+ }
99
+ });
100
+ return true;
101
+ }
102
+ else {
103
+ return false;
104
+ }
105
+ }
106
+ }
107
+ exports.SCSSScanner = SCSSScanner;
108
+ });
@@ -1,93 +1,90 @@
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", "../parser/cssNodes", "../utils/strings", "../services/lintRules", "../cssLanguageTypes", "vscode-nls"], 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.CSSCodeActions = void 0;
17
- var nodes = require("../parser/cssNodes");
18
- var strings_1 = require("../utils/strings");
19
- var lintRules_1 = require("../services/lintRules");
20
- var cssLanguageTypes_1 = require("../cssLanguageTypes");
21
- var nls = require("vscode-nls");
22
- var localize = nls.loadMessageBundle();
23
- var CSSCodeActions = /** @class */ (function () {
24
- function CSSCodeActions(cssDataManager) {
25
- this.cssDataManager = cssDataManager;
26
- }
27
- CSSCodeActions.prototype.doCodeActions = function (document, range, context, stylesheet) {
28
- return this.doCodeActions2(document, range, context, stylesheet).map(function (ca) {
29
- var textDocumentEdit = ca.edit && ca.edit.documentChanges && ca.edit.documentChanges[0];
30
- return cssLanguageTypes_1.Command.create(ca.title, '_css.applyCodeAction', document.uri, document.version, textDocumentEdit && textDocumentEdit.edits);
31
- });
32
- };
33
- CSSCodeActions.prototype.doCodeActions2 = function (document, range, context, stylesheet) {
34
- var result = [];
35
- if (context.diagnostics) {
36
- for (var _i = 0, _a = context.diagnostics; _i < _a.length; _i++) {
37
- var diagnostic = _a[_i];
38
- this.appendFixesForMarker(document, stylesheet, diagnostic, result);
39
- }
40
- }
41
- return result;
42
- };
43
- CSSCodeActions.prototype.getFixesForUnknownProperty = function (document, property, marker, result) {
44
- var propertyName = property.getName();
45
- var candidates = [];
46
- this.cssDataManager.getProperties().forEach(function (p) {
47
- var score = (0, strings_1.difference)(propertyName, p.name);
48
- if (score >= propertyName.length / 2 /*score_lim*/) {
49
- candidates.push({ property: p.name, score: score });
50
- }
51
- });
52
- // Sort in descending order.
53
- candidates.sort(function (a, b) {
54
- return b.score - a.score || a.property.localeCompare(b.property);
55
- });
56
- var maxActions = 3;
57
- for (var _i = 0, candidates_1 = candidates; _i < candidates_1.length; _i++) {
58
- var candidate = candidates_1[_i];
59
- var propertyName_1 = candidate.property;
60
- var title = localize('css.codeaction.rename', "Rename to '{0}'", propertyName_1);
61
- var edit = cssLanguageTypes_1.TextEdit.replace(marker.range, propertyName_1);
62
- var documentIdentifier = cssLanguageTypes_1.VersionedTextDocumentIdentifier.create(document.uri, document.version);
63
- var workspaceEdit = { documentChanges: [cssLanguageTypes_1.TextDocumentEdit.create(documentIdentifier, [edit])] };
64
- var codeAction = cssLanguageTypes_1.CodeAction.create(title, workspaceEdit, cssLanguageTypes_1.CodeActionKind.QuickFix);
65
- codeAction.diagnostics = [marker];
66
- result.push(codeAction);
67
- if (--maxActions <= 0) {
68
- return;
69
- }
70
- }
71
- };
72
- CSSCodeActions.prototype.appendFixesForMarker = function (document, stylesheet, marker, result) {
73
- if (marker.code !== lintRules_1.Rules.UnknownProperty.id) {
74
- return;
75
- }
76
- var offset = document.offsetAt(marker.range.start);
77
- var end = document.offsetAt(marker.range.end);
78
- var nodepath = nodes.getNodePath(stylesheet, offset);
79
- for (var i = nodepath.length - 1; i >= 0; i--) {
80
- var node = nodepath[i];
81
- if (node instanceof nodes.Declaration) {
82
- var property = node.getProperty();
83
- if (property && property.offset === offset && property.end === end) {
84
- this.getFixesForUnknownProperty(document, property, marker, result);
85
- return;
86
- }
87
- }
88
- }
89
- };
90
- return CSSCodeActions;
91
- }());
92
- exports.CSSCodeActions = CSSCodeActions;
93
- });
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", "../parser/cssNodes", "../utils/strings", "../services/lintRules", "../cssLanguageTypes", "vscode-nls"], 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.CSSCodeActions = void 0;
17
+ const nodes = require("../parser/cssNodes");
18
+ const strings_1 = require("../utils/strings");
19
+ const lintRules_1 = require("../services/lintRules");
20
+ const cssLanguageTypes_1 = require("../cssLanguageTypes");
21
+ const nls = require("vscode-nls");
22
+ const localize = nls.loadMessageBundle();
23
+ class CSSCodeActions {
24
+ constructor(cssDataManager) {
25
+ this.cssDataManager = cssDataManager;
26
+ }
27
+ doCodeActions(document, range, context, stylesheet) {
28
+ return this.doCodeActions2(document, range, context, stylesheet).map(ca => {
29
+ const textDocumentEdit = ca.edit && ca.edit.documentChanges && ca.edit.documentChanges[0];
30
+ return cssLanguageTypes_1.Command.create(ca.title, '_css.applyCodeAction', document.uri, document.version, textDocumentEdit && textDocumentEdit.edits);
31
+ });
32
+ }
33
+ doCodeActions2(document, range, context, stylesheet) {
34
+ const result = [];
35
+ if (context.diagnostics) {
36
+ for (const diagnostic of context.diagnostics) {
37
+ this.appendFixesForMarker(document, stylesheet, diagnostic, result);
38
+ }
39
+ }
40
+ return result;
41
+ }
42
+ getFixesForUnknownProperty(document, property, marker, result) {
43
+ const propertyName = property.getName();
44
+ const candidates = [];
45
+ this.cssDataManager.getProperties().forEach(p => {
46
+ const score = (0, strings_1.difference)(propertyName, p.name);
47
+ if (score >= propertyName.length / 2 /*score_lim*/) {
48
+ candidates.push({ property: p.name, score });
49
+ }
50
+ });
51
+ // Sort in descending order.
52
+ candidates.sort((a, b) => {
53
+ return b.score - a.score || a.property.localeCompare(b.property);
54
+ });
55
+ let maxActions = 3;
56
+ for (const candidate of candidates) {
57
+ const propertyName = candidate.property;
58
+ const title = localize('css.codeaction.rename', "Rename to '{0}'", propertyName);
59
+ const edit = cssLanguageTypes_1.TextEdit.replace(marker.range, propertyName);
60
+ const documentIdentifier = cssLanguageTypes_1.VersionedTextDocumentIdentifier.create(document.uri, document.version);
61
+ const workspaceEdit = { documentChanges: [cssLanguageTypes_1.TextDocumentEdit.create(documentIdentifier, [edit])] };
62
+ const codeAction = cssLanguageTypes_1.CodeAction.create(title, workspaceEdit, cssLanguageTypes_1.CodeActionKind.QuickFix);
63
+ codeAction.diagnostics = [marker];
64
+ result.push(codeAction);
65
+ if (--maxActions <= 0) {
66
+ return;
67
+ }
68
+ }
69
+ }
70
+ appendFixesForMarker(document, stylesheet, marker, result) {
71
+ if (marker.code !== lintRules_1.Rules.UnknownProperty.id) {
72
+ return;
73
+ }
74
+ const offset = document.offsetAt(marker.range.start);
75
+ const end = document.offsetAt(marker.range.end);
76
+ const nodepath = nodes.getNodePath(stylesheet, offset);
77
+ for (let i = nodepath.length - 1; i >= 0; i--) {
78
+ const node = nodepath[i];
79
+ if (node instanceof nodes.Declaration) {
80
+ const property = node.getProperty();
81
+ if (property && property.offset === offset && property.end === end) {
82
+ this.getFixesForUnknownProperty(document, property, marker, result);
83
+ return;
84
+ }
85
+ }
86
+ }
87
+ }
88
+ }
89
+ exports.CSSCodeActions = CSSCodeActions;
90
+ });