vscode-css-languageservice 6.3.10 → 7.0.0-next.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.
- package/CHANGELOG.md +8 -0
- package/lib/esm/beautify/beautify-css.js +1437 -1606
- package/lib/esm/cssLanguageService.d.ts +2 -2
- package/lib/esm/cssLanguageService.js +18 -18
- package/lib/esm/languageFacts/colors.js +1 -1
- package/lib/esm/languageFacts/dataManager.js +3 -3
- package/lib/esm/languageFacts/entry.js +1 -1
- package/lib/esm/languageFacts/facts.js +3 -3
- package/lib/esm/parser/cssNodes.js +1 -1
- package/lib/esm/parser/cssParser.js +5 -5
- package/lib/esm/parser/cssSymbolScope.js +2 -2
- package/lib/esm/parser/lessParser.js +5 -5
- package/lib/esm/parser/lessScanner.js +1 -1
- package/lib/esm/parser/scssParser.js +6 -6
- package/lib/esm/parser/scssScanner.js +1 -1
- package/lib/esm/services/cssCodeActions.js +4 -4
- package/lib/esm/services/cssCompletion.js +7 -7
- package/lib/esm/services/cssFolding.js +3 -3
- package/lib/esm/services/cssFormatter.js +3 -3
- package/lib/esm/services/cssHover.js +6 -6
- package/lib/esm/services/cssNavigation.js +6 -6
- package/lib/esm/services/cssSelectionRange.js +2 -2
- package/lib/esm/services/cssValidation.js +4 -4
- package/lib/esm/services/lessCompletion.js +2 -2
- package/lib/esm/services/lint.js +5 -5
- package/lib/esm/services/lintRules.js +1 -1
- package/lib/esm/services/lintUtil.js +1 -1
- package/lib/esm/services/pathCompletion.js +3 -3
- package/lib/esm/services/scssCompletion.js +3 -3
- package/lib/esm/services/scssNavigation.js +4 -4
- package/lib/esm/services/selectorPrinting.js +3 -3
- package/package.json +15 -15
- package/lib/umd/beautify/beautify-css.js +0 -1695
- package/lib/umd/cssLanguageService.d.ts +0 -39
- package/lib/umd/cssLanguageService.js +0 -105
- package/lib/umd/cssLanguageTypes.d.ts +0 -267
- package/lib/umd/cssLanguageTypes.js +0 -89
- package/lib/umd/data/webCustomData.js +0 -44613
- package/lib/umd/languageFacts/builtinData.js +0 -155
- package/lib/umd/languageFacts/colors.js +0 -949
- package/lib/umd/languageFacts/dataManager.js +0 -101
- package/lib/umd/languageFacts/dataProvider.js +0 -86
- package/lib/umd/languageFacts/entry.js +0 -217
- package/lib/umd/languageFacts/facts.js +0 -33
- package/lib/umd/parser/cssErrors.js +0 -61
- package/lib/umd/parser/cssNodes.js +0 -1676
- package/lib/umd/parser/cssParser.js +0 -2035
- package/lib/umd/parser/cssScanner.js +0 -619
- package/lib/umd/parser/cssSymbolScope.js +0 -328
- package/lib/umd/parser/lessParser.js +0 -732
- package/lib/umd/parser/lessScanner.js +0 -70
- package/lib/umd/parser/scssErrors.js +0 -30
- package/lib/umd/parser/scssParser.js +0 -874
- package/lib/umd/parser/scssScanner.js +0 -108
- package/lib/umd/services/cssCodeActions.js +0 -89
- package/lib/umd/services/cssCompletion.js +0 -1109
- package/lib/umd/services/cssFolding.js +0 -202
- package/lib/umd/services/cssFormatter.js +0 -149
- package/lib/umd/services/cssHover.js +0 -174
- package/lib/umd/services/cssNavigation.js +0 -539
- package/lib/umd/services/cssSelectionRange.js +0 -59
- package/lib/umd/services/cssValidation.js +0 -54
- package/lib/umd/services/lessCompletion.js +0 -390
- package/lib/umd/services/lint.js +0 -577
- package/lib/umd/services/lintRules.js +0 -90
- package/lib/umd/services/lintUtil.js +0 -210
- package/lib/umd/services/pathCompletion.js +0 -171
- package/lib/umd/services/scssCompletion.js +0 -367
- package/lib/umd/services/scssNavigation.js +0 -169
- package/lib/umd/services/selectorPrinting.js +0 -575
- package/lib/umd/utils/arrays.js +0 -54
- package/lib/umd/utils/objects.js +0 -24
- package/lib/umd/utils/resources.js +0 -25
- package/lib/umd/utils/strings.js +0 -123
|
@@ -1,101 +0,0 @@
|
|
|
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,86 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,217 +0,0 @@
|
|
|
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", "../cssLanguageTypes"], 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.BaselineImages = exports.browserNames = void 0;
|
|
17
|
-
exports.getEntryDescription = getEntryDescription;
|
|
18
|
-
exports.textToMarkedString = textToMarkedString;
|
|
19
|
-
exports.getMissingBaselineBrowsers = getMissingBaselineBrowsers;
|
|
20
|
-
const cssLanguageTypes_1 = require("../cssLanguageTypes");
|
|
21
|
-
exports.browserNames = {
|
|
22
|
-
'C': {
|
|
23
|
-
name: 'Chrome',
|
|
24
|
-
platform: 'desktop'
|
|
25
|
-
},
|
|
26
|
-
'CA': {
|
|
27
|
-
name: 'Chrome',
|
|
28
|
-
platform: 'Android'
|
|
29
|
-
},
|
|
30
|
-
'E': {
|
|
31
|
-
name: 'Edge',
|
|
32
|
-
platform: 'desktop'
|
|
33
|
-
},
|
|
34
|
-
'FF': {
|
|
35
|
-
name: 'Firefox',
|
|
36
|
-
platform: 'desktop'
|
|
37
|
-
},
|
|
38
|
-
'FFA': {
|
|
39
|
-
name: 'Firefox',
|
|
40
|
-
platform: 'Android'
|
|
41
|
-
},
|
|
42
|
-
'S': {
|
|
43
|
-
name: 'Safari',
|
|
44
|
-
platform: 'macOS'
|
|
45
|
-
},
|
|
46
|
-
'SM': {
|
|
47
|
-
name: 'Safari',
|
|
48
|
-
platform: 'iO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9Ik0xNTAgMEwzMCAxMjBMNjAgMTUwTDE1MCA2MEwyMTAgMTIwTDI0MCA5MEwxNTAgMFoiIGNsYXNzPSJncmVlbi1zaGFwZSIvPgogIDxwYXRoIGQ9Ik0zOTAgMEw0MjAgMzBMMTUwIDMwMEwwIDE1MEwzMCAxMjBMMTUwIDI0MEwzOTAgMFoiIGZpbGw9IiMxRUE0NDYiLz4KPC9zdmc+'
|
|
56
|
-
};
|
|
57
|
-
function getEntryStatus(status) {
|
|
58
|
-
switch (status) {
|
|
59
|
-
case 'nonstandard':
|
|
60
|
-
return '🚨️ Property is nonstandard. Avoid using it.\n\n';
|
|
61
|
-
case 'obsolete':
|
|
62
|
-
return '🚨️️️ Property is obsolete. Avoid using it.\n\n';
|
|
63
|
-
default:
|
|
64
|
-
return '';
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
function getEntryBaselineStatus(baseline, browsers) {
|
|
68
|
-
if (baseline.status === "false") {
|
|
69
|
-
const missingBrowsers = getMissingBaselineBrowsers(browsers);
|
|
70
|
-
let status = `Limited availability across major browsers`;
|
|
71
|
-
if (missingBrowsers) {
|
|
72
|
-
status += ` (Not fully implemented in ${missingBrowsers})`;
|
|
73
|
-
}
|
|
74
|
-
return status;
|
|
75
|
-
}
|
|
76
|
-
const baselineYear = baseline.baseline_low_date?.split('-')[0];
|
|
77
|
-
return `${baseline.status === 'low' ? 'Newly' : 'Widely'} available across major browsers (Baseline since ${baselineYear})`;
|
|
78
|
-
}
|
|
79
|
-
function getEntryBaselineImage(baseline) {
|
|
80
|
-
if (!baseline) {
|
|
81
|
-
return '';
|
|
82
|
-
}
|
|
83
|
-
let baselineImg;
|
|
84
|
-
switch (baseline?.status) {
|
|
85
|
-
case 'low':
|
|
86
|
-
baselineImg = exports.BaselineImages.BASELINE_LOW;
|
|
87
|
-
break;
|
|
88
|
-
case 'high':
|
|
89
|
-
baselineImg = exports.BaselineImages.BASELINE_HIGH;
|
|
90
|
-
break;
|
|
91
|
-
default:
|
|
92
|
-
baselineImg = exports.BaselineImages.BASELINE_LIMITED;
|
|
93
|
-
}
|
|
94
|
-
return ``;
|
|
95
|
-
}
|
|
96
|
-
function getEntryDescription(entry, doesSupportMarkdown, settings) {
|
|
97
|
-
let result;
|
|
98
|
-
if (doesSupportMarkdown) {
|
|
99
|
-
result = {
|
|
100
|
-
kind: 'markdown',
|
|
101
|
-
value: getEntryMarkdownDescription(entry, settings)
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
else {
|
|
105
|
-
result = {
|
|
106
|
-
kind: 'plaintext',
|
|
107
|
-
value: getEntryStringDescription(entry, settings)
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
if (result.value === '') {
|
|
111
|
-
return undefined;
|
|
112
|
-
}
|
|
113
|
-
return result;
|
|
114
|
-
}
|
|
115
|
-
function textToMarkedString(text) {
|
|
116
|
-
text = text.replace(/[\\`*_{}[\]()#+\-.!]/g, '\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash
|
|
117
|
-
return text.replace(/</g, '<').replace(/>/g, '>');
|
|
118
|
-
}
|
|
119
|
-
function getEntryStringDescription(entry, settings) {
|
|
120
|
-
if (!entry.description || entry.description === '') {
|
|
121
|
-
return '';
|
|
122
|
-
}
|
|
123
|
-
if (typeof entry.description !== 'string') {
|
|
124
|
-
return entry.description.value;
|
|
125
|
-
}
|
|
126
|
-
let result = '';
|
|
127
|
-
if (settings?.documentation !== false) {
|
|
128
|
-
let status = '';
|
|
129
|
-
if (entry.status) {
|
|
130
|
-
status = getEntryStatus(entry.status);
|
|
131
|
-
result += status;
|
|
132
|
-
}
|
|
133
|
-
result += entry.description;
|
|
134
|
-
if (entry.baseline && !status) {
|
|
135
|
-
result += `\n\n${getEntryBaselineStatus(entry.baseline, entry.browsers)}`;
|
|
136
|
-
}
|
|
137
|
-
if ('syntax' in entry) {
|
|
138
|
-
result += `\n\nSyntax: ${entry.syntax}`;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
if (entry.references && entry.references.length > 0 && settings?.references !== false) {
|
|
142
|
-
if (result.length > 0) {
|
|
143
|
-
result += '\n\n';
|
|
144
|
-
}
|
|
145
|
-
result += entry.references.map(r => {
|
|
146
|
-
return `${r.name}: ${r.url}`;
|
|
147
|
-
}).join(' | ');
|
|
148
|
-
}
|
|
149
|
-
return result;
|
|
150
|
-
}
|
|
151
|
-
function getEntryMarkdownDescription(entry, settings) {
|
|
152
|
-
if (!entry.description || entry.description === '') {
|
|
153
|
-
return '';
|
|
154
|
-
}
|
|
155
|
-
let result = '';
|
|
156
|
-
if (settings?.documentation !== false) {
|
|
157
|
-
let status = '';
|
|
158
|
-
if (entry.status) {
|
|
159
|
-
status = getEntryStatus(entry.status);
|
|
160
|
-
result += status;
|
|
161
|
-
}
|
|
162
|
-
if (typeof entry.description === 'string') {
|
|
163
|
-
result += textToMarkedString(entry.description);
|
|
164
|
-
}
|
|
165
|
-
else {
|
|
166
|
-
result += entry.description.kind === cssLanguageTypes_1.MarkupKind.Markdown ? entry.description.value : textToMarkedString(entry.description.value);
|
|
167
|
-
}
|
|
168
|
-
if (entry.baseline && !status) {
|
|
169
|
-
result += `\n\n${getEntryBaselineImage(entry.baseline)} _${getEntryBaselineStatus(entry.baseline, entry.browsers)}_`;
|
|
170
|
-
}
|
|
171
|
-
if ('syntax' in entry && entry.syntax) {
|
|
172
|
-
result += `\n\nSyntax: ${textToMarkedString(entry.syntax)}`;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
if (entry.references && entry.references.length > 0 && settings?.references !== false) {
|
|
176
|
-
if (result.length > 0) {
|
|
177
|
-
result += '\n\n';
|
|
178
|
-
}
|
|
179
|
-
result += entry.references.map(r => {
|
|
180
|
-
return `[${r.name}](${r.url})`;
|
|
181
|
-
}).join(' | ');
|
|
182
|
-
}
|
|
183
|
-
return result;
|
|
184
|
-
}
|
|
185
|
-
// TODO: Remove "as any" when tsconfig supports es2021+
|
|
186
|
-
const missingBaselineBrowserFormatter = new Intl.ListFormat("en", {
|
|
187
|
-
style: "long",
|
|
188
|
-
type: "disjunction",
|
|
189
|
-
});
|
|
190
|
-
/**
|
|
191
|
-
* Input is like [E12, FF28, FM28, C29, CM29, IE11, O16]
|
|
192
|
-
* Output is like `Safari`
|
|
193
|
-
*/
|
|
194
|
-
function getMissingBaselineBrowsers(browsers) {
|
|
195
|
-
if (!browsers) {
|
|
196
|
-
return '';
|
|
197
|
-
}
|
|
198
|
-
const missingBrowsers = new Map(Object.entries(exports.browserNames));
|
|
199
|
-
for (const shortCompatString of browsers) {
|
|
200
|
-
const match = shortCompatPattern.exec(shortCompatString);
|
|
201
|
-
if (!match) {
|
|
202
|
-
continue;
|
|
203
|
-
}
|
|
204
|
-
const browser = match[1];
|
|
205
|
-
missingBrowsers.delete(browser);
|
|
206
|
-
}
|
|
207
|
-
return missingBaselineBrowserFormatter.format(Object.values(Array.from(missingBrowsers.entries()).reduce((browsers, [browserId, browser]) => {
|
|
208
|
-
if (browser.name in browsers || browserId === 'E') {
|
|
209
|
-
browsers[browser.name] = browser.name;
|
|
210
|
-
return browsers;
|
|
211
|
-
}
|
|
212
|
-
// distinguish between platforms when applicable
|
|
213
|
-
browsers[browser.name] = `${browser.name} on ${browser.platform}`;
|
|
214
|
-
return browsers;
|
|
215
|
-
}, {})));
|
|
216
|
-
}
|
|
217
|
-
});
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2
|
-
if (k2 === undefined) k2 = k;
|
|
3
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
4
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
5
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
6
|
-
}
|
|
7
|
-
Object.defineProperty(o, k2, desc);
|
|
8
|
-
}) : (function(o, m, k, k2) {
|
|
9
|
-
if (k2 === undefined) k2 = k;
|
|
10
|
-
o[k2] = m[k];
|
|
11
|
-
}));
|
|
12
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
13
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
14
|
-
};
|
|
15
|
-
(function (factory) {
|
|
16
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
17
|
-
var v = factory(require, exports);
|
|
18
|
-
if (v !== undefined) module.exports = v;
|
|
19
|
-
}
|
|
20
|
-
else if (typeof define === "function" && define.amd) {
|
|
21
|
-
define(["require", "exports", "./entry", "./colors", "./builtinData"], factory);
|
|
22
|
-
}
|
|
23
|
-
})(function (require, exports) {
|
|
24
|
-
/*---------------------------------------------------------------------------------------------
|
|
25
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
26
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
27
|
-
*--------------------------------------------------------------------------------------------*/
|
|
28
|
-
'use strict';
|
|
29
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
__exportStar(require("./entry"), exports);
|
|
31
|
-
__exportStar(require("./colors"), exports);
|
|
32
|
-
__exportStar(require("./builtinData"), exports);
|
|
33
|
-
});
|
|
@@ -1,61 +0,0 @@
|
|
|
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", "@vscode/l10n"], 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.ParseError = exports.CSSIssueType = void 0;
|
|
17
|
-
const l10n = require("@vscode/l10n");
|
|
18
|
-
class CSSIssueType {
|
|
19
|
-
constructor(id, message) {
|
|
20
|
-
this.id = id;
|
|
21
|
-
this.message = message;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.CSSIssueType = CSSIssueType;
|
|
25
|
-
exports.ParseError = {
|
|
26
|
-
NumberExpected: new CSSIssueType('css-numberexpected', l10n.t("number expected")),
|
|
27
|
-
ConditionExpected: new CSSIssueType('css-conditionexpected', l10n.t("condition expected")),
|
|
28
|
-
RuleOrSelectorExpected: new CSSIssueType('css-ruleorselectorexpected', l10n.t("at-rule or selector expected")),
|
|
29
|
-
DotExpected: new CSSIssueType('css-dotexpected', l10n.t("dot expected")),
|
|
30
|
-
ColonExpected: new CSSIssueType('css-colonexpected', l10n.t("colon expected")),
|
|
31
|
-
SemiColonExpected: new CSSIssueType('css-semicolonexpected', l10n.t("semi-colon expected")),
|
|
32
|
-
TermExpected: new CSSIssueType('css-termexpected', l10n.t("term expected")),
|
|
33
|
-
ExpressionExpected: new CSSIssueType('css-expressionexpected', l10n.t("expression expected")),
|
|
34
|
-
OperatorExpected: new CSSIssueType('css-operatorexpected', l10n.t("operator expected")),
|
|
35
|
-
IdentifierExpected: new CSSIssueType('css-identifierexpected', l10n.t("identifier expected")),
|
|
36
|
-
PercentageExpected: new CSSIssueType('css-percentageexpected', l10n.t("percentage expected")),
|
|
37
|
-
URIOrStringExpected: new CSSIssueType('css-uriorstringexpected', l10n.t("uri or string expected")),
|
|
38
|
-
URIExpected: new CSSIssueType('css-uriexpected', l10n.t("URI expected")),
|
|
39
|
-
VariableNameExpected: new CSSIssueType('css-varnameexpected', l10n.t("variable name expected")),
|
|
40
|
-
VariableValueExpected: new CSSIssueType('css-varvalueexpected', l10n.t("variable value expected")),
|
|
41
|
-
PropertyValueExpected: new CSSIssueType('css-propertyvalueexpected', l10n.t("property value expected")),
|
|
42
|
-
LeftCurlyExpected: new CSSIssueType('css-lcurlyexpected', l10n.t("{ expected")),
|
|
43
|
-
RightCurlyExpected: new CSSIssueType('css-rcurlyexpected', l10n.t("} expected")),
|
|
44
|
-
LeftSquareBracketExpected: new CSSIssueType('css-rbracketexpected', l10n.t("[ expected")),
|
|
45
|
-
RightSquareBracketExpected: new CSSIssueType('css-lbracketexpected', l10n.t("] expected")),
|
|
46
|
-
LeftParenthesisExpected: new CSSIssueType('css-lparentexpected', l10n.t("( expected")),
|
|
47
|
-
RightParenthesisExpected: new CSSIssueType('css-rparentexpected', l10n.t(") expected")),
|
|
48
|
-
CommaExpected: new CSSIssueType('css-commaexpected', l10n.t("comma expected")),
|
|
49
|
-
PageDirectiveOrDeclarationExpected: new CSSIssueType('css-pagedirordeclexpected', l10n.t("page directive or declaraton expected")),
|
|
50
|
-
UnknownAtRule: new CSSIssueType('css-unknownatrule', l10n.t("at-rule unknown")),
|
|
51
|
-
UnknownKeyword: new CSSIssueType('css-unknownkeyword', l10n.t("unknown keyword")),
|
|
52
|
-
SelectorExpected: new CSSIssueType('css-selectorexpected', l10n.t("selector expected")),
|
|
53
|
-
StringLiteralExpected: new CSSIssueType('css-stringliteralexpected', l10n.t("string literal expected")),
|
|
54
|
-
WhitespaceExpected: new CSSIssueType('css-whitespaceexpected', l10n.t("whitespace expected")),
|
|
55
|
-
MediaQueryExpected: new CSSIssueType('css-mediaqueryexpected', l10n.t("media query expected")),
|
|
56
|
-
IdentifierOrWildcardExpected: new CSSIssueType('css-idorwildcardexpected', l10n.t("identifier or wildcard expected")),
|
|
57
|
-
WildcardExpected: new CSSIssueType('css-wildcardexpected', l10n.t("wildcard expected")),
|
|
58
|
-
IdentifierOrVariableExpected: new CSSIssueType('css-idorvarexpected', l10n.t("identifier or variable expected")),
|
|
59
|
-
IfConditionExpected: new CSSIssueType('css-ifconditionexpected', l10n.t("if condition expected")),
|
|
60
|
-
};
|
|
61
|
-
});
|