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.
- package/CHANGELOG.md +5 -1
- package/lib/esm/cssLanguageService.d.ts +37 -37
- package/lib/esm/cssLanguageService.js +72 -75
- package/lib/esm/cssLanguageTypes.d.ts +238 -238
- package/lib/esm/cssLanguageTypes.js +42 -42
- package/lib/esm/data/webCustomData.js +21965 -21965
- package/lib/esm/languageFacts/builtinData.js +142 -142
- package/lib/esm/languageFacts/colors.js +469 -472
- package/lib/esm/languageFacts/dataManager.js +88 -92
- package/lib/esm/languageFacts/dataProvider.js +73 -79
- package/lib/esm/languageFacts/entry.js +137 -138
- package/lib/esm/languageFacts/facts.js +8 -8
- package/lib/esm/parser/cssErrors.js +48 -50
- package/lib/esm/parser/cssNodes.js +1502 -2019
- package/lib/esm/parser/cssParser.js +1534 -1563
- package/lib/esm/parser/cssScanner.js +592 -599
- package/lib/esm/parser/cssSymbolScope.js +311 -341
- package/lib/esm/parser/lessParser.js +714 -740
- package/lib/esm/parser/lessScanner.js +57 -78
- package/lib/esm/parser/scssErrors.js +18 -20
- package/lib/esm/parser/scssParser.js +796 -818
- package/lib/esm/parser/scssScanner.js +95 -116
- package/lib/esm/services/cssCodeActions.js +77 -81
- package/lib/esm/services/cssCompletion.js +1054 -1149
- package/lib/esm/services/cssFolding.js +190 -193
- package/lib/esm/services/cssFormatter.js +136 -136
- package/lib/esm/services/cssHover.js +148 -151
- package/lib/esm/services/cssNavigation.js +378 -470
- package/lib/esm/services/cssSelectionRange.js +47 -47
- package/lib/esm/services/cssValidation.js +41 -44
- package/lib/esm/services/lessCompletion.js +378 -397
- package/lib/esm/services/lint.js +518 -532
- package/lib/esm/services/lintRules.js +76 -83
- package/lib/esm/services/lintUtil.js +196 -205
- package/lib/esm/services/pathCompletion.js +157 -231
- package/lib/esm/services/scssCompletion.js +354 -378
- package/lib/esm/services/scssNavigation.js +82 -154
- package/lib/esm/services/selectorPrinting.js +492 -536
- package/lib/esm/utils/arrays.js +40 -46
- package/lib/esm/utils/objects.js +11 -11
- package/lib/esm/utils/resources.js +11 -24
- package/lib/esm/utils/strings.js +102 -104
- package/lib/umd/cssLanguageService.d.ts +37 -37
- package/lib/umd/cssLanguageService.js +99 -102
- package/lib/umd/cssLanguageTypes.d.ts +238 -238
- package/lib/umd/cssLanguageTypes.js +89 -88
- package/lib/umd/data/webCustomData.js +21978 -21978
- package/lib/umd/languageFacts/builtinData.js +154 -154
- package/lib/umd/languageFacts/colors.js +492 -495
- package/lib/umd/languageFacts/dataManager.js +101 -104
- package/lib/umd/languageFacts/dataProvider.js +86 -91
- package/lib/umd/languageFacts/entry.js +152 -153
- package/lib/umd/languageFacts/facts.js +29 -29
- package/lib/umd/parser/cssErrors.js +61 -62
- package/lib/umd/parser/cssNodes.js +1587 -2034
- package/lib/umd/parser/cssParser.js +1547 -1575
- package/lib/umd/parser/cssScanner.js +606 -611
- package/lib/umd/parser/cssSymbolScope.js +328 -353
- package/lib/umd/parser/lessParser.js +727 -752
- package/lib/umd/parser/lessScanner.js +70 -90
- package/lib/umd/parser/scssErrors.js +31 -32
- package/lib/umd/parser/scssParser.js +809 -830
- package/lib/umd/parser/scssScanner.js +108 -128
- package/lib/umd/services/cssCodeActions.js +90 -93
- package/lib/umd/services/cssCompletion.js +1067 -1161
- package/lib/umd/services/cssFolding.js +203 -206
- package/lib/umd/services/cssFormatter.js +150 -150
- package/lib/umd/services/cssHover.js +161 -163
- package/lib/umd/services/cssNavigation.js +391 -482
- package/lib/umd/services/cssSelectionRange.js +60 -60
- package/lib/umd/services/cssValidation.js +54 -56
- package/lib/umd/services/lessCompletion.js +391 -409
- package/lib/umd/services/lint.js +531 -544
- package/lib/umd/services/lintRules.js +91 -95
- package/lib/umd/services/lintUtil.js +210 -218
- package/lib/umd/services/pathCompletion.js +171 -244
- package/lib/umd/services/scssCompletion.js +367 -390
- package/lib/umd/services/scssNavigation.js +95 -166
- package/lib/umd/services/selectorPrinting.js +510 -550
- package/lib/umd/utils/arrays.js +55 -61
- package/lib/umd/utils/objects.js +25 -25
- package/lib/umd/utils/resources.js +26 -39
- package/lib/umd/utils/strings.js +120 -122
- package/package.json +10 -10
package/lib/esm/utils/arrays.js
CHANGED
|
@@ -1,46 +1,40 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
'use strict';
|
|
6
|
-
/**
|
|
7
|
-
* Takes a sorted array and a function p. The array is sorted in such a way that all elements where p(x) is false
|
|
8
|
-
* are located before all elements where p(x) is true.
|
|
9
|
-
* @returns the least x for which p(x) is true or array.length if no element fullfills the given function.
|
|
10
|
-
*/
|
|
11
|
-
export function findFirst(array, p) {
|
|
12
|
-
|
|
13
|
-
if (high === 0) {
|
|
14
|
-
return 0; // no children
|
|
15
|
-
}
|
|
16
|
-
while (low < high) {
|
|
17
|
-
|
|
18
|
-
if (p(array[mid])) {
|
|
19
|
-
high = mid;
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
low = mid + 1;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return low;
|
|
26
|
-
}
|
|
27
|
-
export function includes(array, item) {
|
|
28
|
-
return array.indexOf(item) !== -1;
|
|
29
|
-
}
|
|
30
|
-
export function union() {
|
|
31
|
-
|
|
32
|
-
for (
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
result.push(item);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
return result;
|
|
46
|
-
}
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
'use strict';
|
|
6
|
+
/**
|
|
7
|
+
* Takes a sorted array and a function p. The array is sorted in such a way that all elements where p(x) is false
|
|
8
|
+
* are located before all elements where p(x) is true.
|
|
9
|
+
* @returns the least x for which p(x) is true or array.length if no element fullfills the given function.
|
|
10
|
+
*/
|
|
11
|
+
export function findFirst(array, p) {
|
|
12
|
+
let low = 0, high = array.length;
|
|
13
|
+
if (high === 0) {
|
|
14
|
+
return 0; // no children
|
|
15
|
+
}
|
|
16
|
+
while (low < high) {
|
|
17
|
+
let mid = Math.floor((low + high) / 2);
|
|
18
|
+
if (p(array[mid])) {
|
|
19
|
+
high = mid;
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
low = mid + 1;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return low;
|
|
26
|
+
}
|
|
27
|
+
export function includes(array, item) {
|
|
28
|
+
return array.indexOf(item) !== -1;
|
|
29
|
+
}
|
|
30
|
+
export function union(...arrays) {
|
|
31
|
+
const result = [];
|
|
32
|
+
for (const array of arrays) {
|
|
33
|
+
for (const item of array) {
|
|
34
|
+
if (!includes(result, item)) {
|
|
35
|
+
result.push(item);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return result;
|
|
40
|
+
}
|
package/lib/esm/utils/objects.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
'use strict';
|
|
6
|
-
export function values(obj) {
|
|
7
|
-
return Object.keys(obj).map(
|
|
8
|
-
}
|
|
9
|
-
export function isDefined(obj) {
|
|
10
|
-
return typeof obj !== 'undefined';
|
|
11
|
-
}
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
'use strict';
|
|
6
|
+
export function values(obj) {
|
|
7
|
+
return Object.keys(obj).map(key => obj[key]);
|
|
8
|
+
}
|
|
9
|
+
export function isDefined(obj) {
|
|
10
|
+
return typeof obj !== 'undefined';
|
|
11
|
+
}
|
|
@@ -1,24 +1,11 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
13
|
-
};
|
|
14
|
-
import { URI, Utils } from 'vscode-uri';
|
|
15
|
-
export function dirname(uriString) {
|
|
16
|
-
return Utils.dirname(URI.parse(uriString)).toString();
|
|
17
|
-
}
|
|
18
|
-
export function joinPath(uriString) {
|
|
19
|
-
var paths = [];
|
|
20
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
21
|
-
paths[_i - 1] = arguments[_i];
|
|
22
|
-
}
|
|
23
|
-
return Utils.joinPath.apply(Utils, __spreadArray([URI.parse(uriString)], paths, false)).toString();
|
|
24
|
-
}
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { URI, Utils } from 'vscode-uri';
|
|
6
|
+
export function dirname(uriString) {
|
|
7
|
+
return Utils.dirname(URI.parse(uriString)).toString();
|
|
8
|
+
}
|
|
9
|
+
export function joinPath(uriString, ...paths) {
|
|
10
|
+
return Utils.joinPath(URI.parse(uriString), ...paths).toString();
|
|
11
|
+
}
|
package/lib/esm/utils/strings.js
CHANGED
|
@@ -1,104 +1,102 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
'use strict';
|
|
6
|
-
export function startsWith(haystack, needle) {
|
|
7
|
-
if (haystack.length < needle.length) {
|
|
8
|
-
return false;
|
|
9
|
-
}
|
|
10
|
-
for (
|
|
11
|
-
if (haystack[i] !== needle[i]) {
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return true;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Determines if haystack ends with needle.
|
|
19
|
-
*/
|
|
20
|
-
export function endsWith(haystack, needle) {
|
|
21
|
-
|
|
22
|
-
if (diff > 0) {
|
|
23
|
-
return haystack.lastIndexOf(needle) === diff;
|
|
24
|
-
}
|
|
25
|
-
else if (diff === 0) {
|
|
26
|
-
return haystack === needle;
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Computes the difference score for two strings. More similar strings have a higher score.
|
|
34
|
-
* We use largest common subsequence dynamic programming approach but penalize in the end for length differences.
|
|
35
|
-
* Strings that have a large length difference will get a bad default score 0.
|
|
36
|
-
* Complexity - both time and space O(first.length * second.length)
|
|
37
|
-
* Dynamic programming LCS computation http://en.wikipedia.org/wiki/Longest_common_subsequence_problem
|
|
38
|
-
*
|
|
39
|
-
* @param first a string
|
|
40
|
-
* @param second a string
|
|
41
|
-
*/
|
|
42
|
-
export function difference(first, second, maxLenDelta) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
return s;
|
|
104
|
-
}
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
'use strict';
|
|
6
|
+
export function startsWith(haystack, needle) {
|
|
7
|
+
if (haystack.length < needle.length) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
for (let i = 0; i < needle.length; i++) {
|
|
11
|
+
if (haystack[i] !== needle[i]) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Determines if haystack ends with needle.
|
|
19
|
+
*/
|
|
20
|
+
export function endsWith(haystack, needle) {
|
|
21
|
+
let diff = haystack.length - needle.length;
|
|
22
|
+
if (diff > 0) {
|
|
23
|
+
return haystack.lastIndexOf(needle) === diff;
|
|
24
|
+
}
|
|
25
|
+
else if (diff === 0) {
|
|
26
|
+
return haystack === needle;
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Computes the difference score for two strings. More similar strings have a higher score.
|
|
34
|
+
* We use largest common subsequence dynamic programming approach but penalize in the end for length differences.
|
|
35
|
+
* Strings that have a large length difference will get a bad default score 0.
|
|
36
|
+
* Complexity - both time and space O(first.length * second.length)
|
|
37
|
+
* Dynamic programming LCS computation http://en.wikipedia.org/wiki/Longest_common_subsequence_problem
|
|
38
|
+
*
|
|
39
|
+
* @param first a string
|
|
40
|
+
* @param second a string
|
|
41
|
+
*/
|
|
42
|
+
export function difference(first, second, maxLenDelta = 4) {
|
|
43
|
+
let lengthDifference = Math.abs(first.length - second.length);
|
|
44
|
+
// We only compute score if length of the currentWord and length of entry.name are similar.
|
|
45
|
+
if (lengthDifference > maxLenDelta) {
|
|
46
|
+
return 0;
|
|
47
|
+
}
|
|
48
|
+
// Initialize LCS (largest common subsequence) matrix.
|
|
49
|
+
let LCS = [];
|
|
50
|
+
let zeroArray = [];
|
|
51
|
+
let i, j;
|
|
52
|
+
for (i = 0; i < second.length + 1; ++i) {
|
|
53
|
+
zeroArray.push(0);
|
|
54
|
+
}
|
|
55
|
+
for (i = 0; i < first.length + 1; ++i) {
|
|
56
|
+
LCS.push(zeroArray);
|
|
57
|
+
}
|
|
58
|
+
for (i = 1; i < first.length + 1; ++i) {
|
|
59
|
+
for (j = 1; j < second.length + 1; ++j) {
|
|
60
|
+
if (first[i - 1] === second[j - 1]) {
|
|
61
|
+
LCS[i][j] = LCS[i - 1][j - 1] + 1;
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
LCS[i][j] = Math.max(LCS[i - 1][j], LCS[i][j - 1]);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return LCS[first.length][second.length] - Math.sqrt(lengthDifference);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Limit of string length.
|
|
72
|
+
*/
|
|
73
|
+
export function getLimitedString(str, ellipsis = true) {
|
|
74
|
+
if (!str) {
|
|
75
|
+
return '';
|
|
76
|
+
}
|
|
77
|
+
if (str.length < 140) {
|
|
78
|
+
return str;
|
|
79
|
+
}
|
|
80
|
+
return str.slice(0, 140) + (ellipsis ? '\u2026' : '');
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Limit of string length.
|
|
84
|
+
*/
|
|
85
|
+
export function trim(str, regexp) {
|
|
86
|
+
const m = regexp.exec(str);
|
|
87
|
+
if (m && m[0].length) {
|
|
88
|
+
return str.substr(0, str.length - m[0].length);
|
|
89
|
+
}
|
|
90
|
+
return str;
|
|
91
|
+
}
|
|
92
|
+
export function repeat(value, count) {
|
|
93
|
+
let s = '';
|
|
94
|
+
while (count > 0) {
|
|
95
|
+
if ((count & 1) === 1) {
|
|
96
|
+
s += value;
|
|
97
|
+
}
|
|
98
|
+
value += value;
|
|
99
|
+
count = count >>> 1;
|
|
100
|
+
}
|
|
101
|
+
return s;
|
|
102
|
+
}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { LanguageSettings, ICompletionParticipant, DocumentContext, LanguageServiceOptions, Diagnostic, Position, CompletionList, Hover, Location, DocumentHighlight, DocumentLink, SymbolInformation, Range, CodeActionContext, Command, CodeAction, ColorInformation, Color, ColorPresentation, WorkspaceEdit, FoldingRange, SelectionRange, TextDocument, ICSSDataProvider, CSSDataV1, HoverSettings, CompletionSettings, TextEdit, CSSFormatConfiguration } from './cssLanguageTypes';
|
|
2
|
-
export declare type Stylesheet = {};
|
|
3
|
-
export * from './cssLanguageTypes';
|
|
4
|
-
export interface LanguageService {
|
|
5
|
-
configure(raw?: LanguageSettings): void;
|
|
6
|
-
setDataProviders(useDefaultDataProvider: boolean, customDataProviders: ICSSDataProvider[]): void;
|
|
7
|
-
doValidation(document: TextDocument, stylesheet: Stylesheet, documentSettings?: LanguageSettings): Diagnostic[];
|
|
8
|
-
parseStylesheet(document: TextDocument): Stylesheet;
|
|
9
|
-
doComplete(document: TextDocument, position: Position, stylesheet: Stylesheet, settings?: CompletionSettings): CompletionList;
|
|
10
|
-
doComplete2(document: TextDocument, position: Position, stylesheet: Stylesheet, documentContext: DocumentContext, settings?: CompletionSettings): Promise<CompletionList>;
|
|
11
|
-
setCompletionParticipants(registeredCompletionParticipants: ICompletionParticipant[]): void;
|
|
12
|
-
doHover(document: TextDocument, position: Position, stylesheet: Stylesheet, settings?: HoverSettings): Hover | null;
|
|
13
|
-
findDefinition(document: TextDocument, position: Position, stylesheet: Stylesheet): Location | null;
|
|
14
|
-
findReferences(document: TextDocument, position: Position, stylesheet: Stylesheet): Location[];
|
|
15
|
-
findDocumentHighlights(document: TextDocument, position: Position, stylesheet: Stylesheet): DocumentHighlight[];
|
|
16
|
-
findDocumentLinks(document: TextDocument, stylesheet: Stylesheet, documentContext: DocumentContext): DocumentLink[];
|
|
17
|
-
/**
|
|
18
|
-
* Return statically resolved links, and dynamically resolved links if `fsProvider` is proved.
|
|
19
|
-
*/
|
|
20
|
-
findDocumentLinks2(document: TextDocument, stylesheet: Stylesheet, documentContext: DocumentContext): Promise<DocumentLink[]>;
|
|
21
|
-
findDocumentSymbols(document: TextDocument, stylesheet: Stylesheet): SymbolInformation[];
|
|
22
|
-
doCodeActions(document: TextDocument, range: Range, context: CodeActionContext, stylesheet: Stylesheet): Command[];
|
|
23
|
-
doCodeActions2(document: TextDocument, range: Range, context: CodeActionContext, stylesheet: Stylesheet): CodeAction[];
|
|
24
|
-
findDocumentColors(document: TextDocument, stylesheet: Stylesheet): ColorInformation[];
|
|
25
|
-
getColorPresentations(document: TextDocument, stylesheet: Stylesheet, color: Color, range: Range): ColorPresentation[];
|
|
26
|
-
doRename(document: TextDocument, position: Position, newName: string, stylesheet: Stylesheet): WorkspaceEdit;
|
|
27
|
-
getFoldingRanges(document: TextDocument, context?: {
|
|
28
|
-
rangeLimit?: number;
|
|
29
|
-
}): FoldingRange[];
|
|
30
|
-
getSelectionRanges(document: TextDocument, positions: Position[], stylesheet: Stylesheet): SelectionRange[];
|
|
31
|
-
format(document: TextDocument, range: Range | undefined, options: CSSFormatConfiguration): TextEdit[];
|
|
32
|
-
}
|
|
33
|
-
export declare function getDefaultCSSDataProvider(): ICSSDataProvider;
|
|
34
|
-
export declare function newCSSDataProvider(data: CSSDataV1): ICSSDataProvider;
|
|
35
|
-
export declare function getCSSLanguageService(options?: LanguageServiceOptions): LanguageService;
|
|
36
|
-
export declare function getSCSSLanguageService(options?: LanguageServiceOptions): LanguageService;
|
|
37
|
-
export declare function getLESSLanguageService(options?: LanguageServiceOptions): LanguageService;
|
|
1
|
+
import { LanguageSettings, ICompletionParticipant, DocumentContext, LanguageServiceOptions, Diagnostic, Position, CompletionList, Hover, Location, DocumentHighlight, DocumentLink, SymbolInformation, Range, CodeActionContext, Command, CodeAction, ColorInformation, Color, ColorPresentation, WorkspaceEdit, FoldingRange, SelectionRange, TextDocument, ICSSDataProvider, CSSDataV1, HoverSettings, CompletionSettings, TextEdit, CSSFormatConfiguration } from './cssLanguageTypes';
|
|
2
|
+
export declare type Stylesheet = {};
|
|
3
|
+
export * from './cssLanguageTypes';
|
|
4
|
+
export interface LanguageService {
|
|
5
|
+
configure(raw?: LanguageSettings): void;
|
|
6
|
+
setDataProviders(useDefaultDataProvider: boolean, customDataProviders: ICSSDataProvider[]): void;
|
|
7
|
+
doValidation(document: TextDocument, stylesheet: Stylesheet, documentSettings?: LanguageSettings): Diagnostic[];
|
|
8
|
+
parseStylesheet(document: TextDocument): Stylesheet;
|
|
9
|
+
doComplete(document: TextDocument, position: Position, stylesheet: Stylesheet, settings?: CompletionSettings): CompletionList;
|
|
10
|
+
doComplete2(document: TextDocument, position: Position, stylesheet: Stylesheet, documentContext: DocumentContext, settings?: CompletionSettings): Promise<CompletionList>;
|
|
11
|
+
setCompletionParticipants(registeredCompletionParticipants: ICompletionParticipant[]): void;
|
|
12
|
+
doHover(document: TextDocument, position: Position, stylesheet: Stylesheet, settings?: HoverSettings): Hover | null;
|
|
13
|
+
findDefinition(document: TextDocument, position: Position, stylesheet: Stylesheet): Location | null;
|
|
14
|
+
findReferences(document: TextDocument, position: Position, stylesheet: Stylesheet): Location[];
|
|
15
|
+
findDocumentHighlights(document: TextDocument, position: Position, stylesheet: Stylesheet): DocumentHighlight[];
|
|
16
|
+
findDocumentLinks(document: TextDocument, stylesheet: Stylesheet, documentContext: DocumentContext): DocumentLink[];
|
|
17
|
+
/**
|
|
18
|
+
* Return statically resolved links, and dynamically resolved links if `fsProvider` is proved.
|
|
19
|
+
*/
|
|
20
|
+
findDocumentLinks2(document: TextDocument, stylesheet: Stylesheet, documentContext: DocumentContext): Promise<DocumentLink[]>;
|
|
21
|
+
findDocumentSymbols(document: TextDocument, stylesheet: Stylesheet): SymbolInformation[];
|
|
22
|
+
doCodeActions(document: TextDocument, range: Range, context: CodeActionContext, stylesheet: Stylesheet): Command[];
|
|
23
|
+
doCodeActions2(document: TextDocument, range: Range, context: CodeActionContext, stylesheet: Stylesheet): CodeAction[];
|
|
24
|
+
findDocumentColors(document: TextDocument, stylesheet: Stylesheet): ColorInformation[];
|
|
25
|
+
getColorPresentations(document: TextDocument, stylesheet: Stylesheet, color: Color, range: Range): ColorPresentation[];
|
|
26
|
+
doRename(document: TextDocument, position: Position, newName: string, stylesheet: Stylesheet): WorkspaceEdit;
|
|
27
|
+
getFoldingRanges(document: TextDocument, context?: {
|
|
28
|
+
rangeLimit?: number;
|
|
29
|
+
}): FoldingRange[];
|
|
30
|
+
getSelectionRanges(document: TextDocument, positions: Position[], stylesheet: Stylesheet): SelectionRange[];
|
|
31
|
+
format(document: TextDocument, range: Range | undefined, options: CSSFormatConfiguration): TextEdit[];
|
|
32
|
+
}
|
|
33
|
+
export declare function getDefaultCSSDataProvider(): ICSSDataProvider;
|
|
34
|
+
export declare function newCSSDataProvider(data: CSSDataV1): ICSSDataProvider;
|
|
35
|
+
export declare function getCSSLanguageService(options?: LanguageServiceOptions): LanguageService;
|
|
36
|
+
export declare function getSCSSLanguageService(options?: LanguageServiceOptions): LanguageService;
|
|
37
|
+
export declare function getLESSLanguageService(options?: LanguageServiceOptions): LanguageService;
|