vscode-css-languageservice 5.1.8 → 5.1.9
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.
|
@@ -354,6 +354,21 @@ export function getColorValue(node) {
|
|
|
354
354
|
var functionNode = node;
|
|
355
355
|
var name = functionNode.getName();
|
|
356
356
|
var colorValues = functionNode.getArguments().getChildren();
|
|
357
|
+
if (colorValues.length === 1) {
|
|
358
|
+
var functionArg = colorValues[0].getChildren();
|
|
359
|
+
if (functionArg.length === 1 && functionArg[0].type === nodes.NodeType.Expression) {
|
|
360
|
+
colorValues = functionArg[0].getChildren();
|
|
361
|
+
if (colorValues.length === 3) {
|
|
362
|
+
var lastValue = colorValues[2];
|
|
363
|
+
if (lastValue instanceof nodes.BinaryExpression) {
|
|
364
|
+
var left = lastValue.getLeft(), right = lastValue.getRight(), operator = lastValue.getOperator();
|
|
365
|
+
if (left && right && operator && operator.matches('/')) {
|
|
366
|
+
colorValues = [colorValues[0], colorValues[1], left, right];
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
357
372
|
if (!name || colorValues.length < 3 || colorValues.length > 4) {
|
|
358
373
|
return null;
|
|
359
374
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
4
|
*--------------------------------------------------------------------------------------------*/
|
|
5
5
|
'use strict';
|
|
6
|
+
import { MarkupKind } from '../cssLanguageTypes';
|
|
6
7
|
export var browserNames = {
|
|
7
8
|
E: 'Edge',
|
|
8
9
|
FF: 'Firefox',
|
|
@@ -86,8 +87,12 @@ function getEntryMarkdownDescription(entry, settings) {
|
|
|
86
87
|
if (entry.status) {
|
|
87
88
|
result += getEntryStatus(entry.status);
|
|
88
89
|
}
|
|
89
|
-
|
|
90
|
-
|
|
90
|
+
if (typeof entry.description === 'string') {
|
|
91
|
+
result += textToMarkedString(entry.description);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
result += entry.description.kind === MarkupKind.Markdown ? entry.description.value : textToMarkedString(entry.description.value);
|
|
95
|
+
}
|
|
91
96
|
var browserLabel = getBrowserLabel(entry.browsers);
|
|
92
97
|
if (browserLabel) {
|
|
93
98
|
result += '\n\n(' + textToMarkedString(browserLabel) + ')';
|
|
@@ -373,6 +373,21 @@
|
|
|
373
373
|
var functionNode = node;
|
|
374
374
|
var name = functionNode.getName();
|
|
375
375
|
var colorValues = functionNode.getArguments().getChildren();
|
|
376
|
+
if (colorValues.length === 1) {
|
|
377
|
+
var functionArg = colorValues[0].getChildren();
|
|
378
|
+
if (functionArg.length === 1 && functionArg[0].type === nodes.NodeType.Expression) {
|
|
379
|
+
colorValues = functionArg[0].getChildren();
|
|
380
|
+
if (colorValues.length === 3) {
|
|
381
|
+
var lastValue = colorValues[2];
|
|
382
|
+
if (lastValue instanceof nodes.BinaryExpression) {
|
|
383
|
+
var left = lastValue.getLeft(), right = lastValue.getRight(), operator = lastValue.getOperator();
|
|
384
|
+
if (left && right && operator && operator.matches('/')) {
|
|
385
|
+
colorValues = [colorValues[0], colorValues[1], left, right];
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
376
391
|
if (!name || colorValues.length < 3 || colorValues.length > 4) {
|
|
377
392
|
return null;
|
|
378
393
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
if (v !== undefined) module.exports = v;
|
|
5
5
|
}
|
|
6
6
|
else if (typeof define === "function" && define.amd) {
|
|
7
|
-
define(["require", "exports"], factory);
|
|
7
|
+
define(["require", "exports", "../cssLanguageTypes"], factory);
|
|
8
8
|
}
|
|
9
9
|
})(function (require, exports) {
|
|
10
10
|
/*---------------------------------------------------------------------------------------------
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
'use strict';
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.getBrowserLabel = exports.textToMarkedString = exports.getEntryDescription = exports.browserNames = void 0;
|
|
17
|
+
var cssLanguageTypes_1 = require("../cssLanguageTypes");
|
|
17
18
|
exports.browserNames = {
|
|
18
19
|
E: 'Edge',
|
|
19
20
|
FF: 'Firefox',
|
|
@@ -99,8 +100,12 @@
|
|
|
99
100
|
if (entry.status) {
|
|
100
101
|
result += getEntryStatus(entry.status);
|
|
101
102
|
}
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
if (typeof entry.description === 'string') {
|
|
104
|
+
result += textToMarkedString(entry.description);
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
result += entry.description.kind === cssLanguageTypes_1.MarkupKind.Markdown ? entry.description.value : textToMarkedString(entry.description.value);
|
|
108
|
+
}
|
|
104
109
|
var browserLabel = getBrowserLabel(entry.browsers);
|
|
105
110
|
if (browserLabel) {
|
|
106
111
|
result += '\n\n(' + textToMarkedString(browserLabel) + ')';
|