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
|
@@ -3,52 +3,33 @@
|
|
|
3
3
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
'use strict';
|
|
6
|
-
var __extends = (this && this.__extends) || (function () {
|
|
7
|
-
var extendStatics = function (d, b) {
|
|
8
|
-
extendStatics = Object.setPrototypeOf ||
|
|
9
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
10
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
11
|
-
return extendStatics(d, b);
|
|
12
|
-
};
|
|
13
|
-
return function (d, b) {
|
|
14
|
-
if (typeof b !== "function" && b !== null)
|
|
15
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
16
|
-
extendStatics(d, b);
|
|
17
|
-
function __() { this.constructor = d; }
|
|
18
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
19
|
-
};
|
|
20
|
-
})();
|
|
21
6
|
import * as scanner from './cssScanner';
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
export
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
function LESSScanner() {
|
|
33
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
34
|
-
}
|
|
35
|
-
LESSScanner.prototype.scanNext = function (offset) {
|
|
7
|
+
const _FSL = '/'.charCodeAt(0);
|
|
8
|
+
const _NWL = '\n'.charCodeAt(0);
|
|
9
|
+
const _CAR = '\r'.charCodeAt(0);
|
|
10
|
+
const _LFD = '\f'.charCodeAt(0);
|
|
11
|
+
const _TIC = '`'.charCodeAt(0);
|
|
12
|
+
const _DOT = '.'.charCodeAt(0);
|
|
13
|
+
let customTokenValue = scanner.TokenType.CustomToken;
|
|
14
|
+
export const Ellipsis = customTokenValue++;
|
|
15
|
+
export class LESSScanner extends scanner.Scanner {
|
|
16
|
+
scanNext(offset) {
|
|
36
17
|
// LESS: escaped JavaScript code `const a = "dddd"`
|
|
37
|
-
|
|
18
|
+
const tokenType = this.escapedJavaScript();
|
|
38
19
|
if (tokenType !== null) {
|
|
39
20
|
return this.finishToken(offset, tokenType);
|
|
40
21
|
}
|
|
41
22
|
if (this.stream.advanceIfChars([_DOT, _DOT, _DOT])) {
|
|
42
23
|
return this.finishToken(offset, Ellipsis);
|
|
43
24
|
}
|
|
44
|
-
return
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (
|
|
25
|
+
return super.scanNext(offset);
|
|
26
|
+
}
|
|
27
|
+
comment() {
|
|
28
|
+
if (super.comment()) {
|
|
48
29
|
return true;
|
|
49
30
|
}
|
|
50
31
|
if (!this.inURL && this.stream.advanceIfChars([_FSL, _FSL])) {
|
|
51
|
-
this.stream.advanceWhileChar(
|
|
32
|
+
this.stream.advanceWhileChar((ch) => {
|
|
52
33
|
switch (ch) {
|
|
53
34
|
case _NWL:
|
|
54
35
|
case _CAR:
|
|
@@ -63,16 +44,14 @@ var LESSScanner = /** @class */ (function (_super) {
|
|
|
63
44
|
else {
|
|
64
45
|
return false;
|
|
65
46
|
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
47
|
+
}
|
|
48
|
+
escapedJavaScript() {
|
|
49
|
+
const ch = this.stream.peekChar();
|
|
69
50
|
if (ch === _TIC) {
|
|
70
51
|
this.stream.advance(1);
|
|
71
|
-
this.stream.advanceWhileChar(
|
|
52
|
+
this.stream.advanceWhileChar((ch) => { return ch !== _TIC; });
|
|
72
53
|
return this.stream.advanceIfChar(_TIC) ? scanner.TokenType.EscapedJavaScript : scanner.TokenType.BadEscapedJavaScript;
|
|
73
54
|
}
|
|
74
55
|
return null;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
}(scanner.Scanner));
|
|
78
|
-
export { LESSScanner };
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -4,16 +4,14 @@
|
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
'use strict';
|
|
6
6
|
import * as nls from 'vscode-nls';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const localize = nls.loadMessageBundle();
|
|
8
|
+
export class SCSSIssueType {
|
|
9
|
+
constructor(id, message) {
|
|
10
10
|
this.id = id;
|
|
11
11
|
this.message = message;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export { SCSSIssueType };
|
|
16
|
-
export var SCSSParseError = {
|
|
13
|
+
}
|
|
14
|
+
export const SCSSParseError = {
|
|
17
15
|
FromExpected: new SCSSIssueType('scss-fromexpected', localize('expected.from', "'from' expected")),
|
|
18
16
|
ThroughOrToExpected: new SCSSIssueType('scss-throughexpected', localize('expected.through', "'through' or 'to' expected")),
|
|
19
17
|
InExpected: new SCSSIssueType('scss-fromexpected', localize('expected.in', "'in' expected")),
|