@master/css-language-service 2.0.0-rc.26 → 2.0.0-rc.28
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/dist/common.cjs +57 -0
- package/dist/common.d.ts +9 -0
- package/dist/common.mjs +48 -0
- package/dist/core.cjs +188 -0
- package/dist/core.d.ts +30 -0
- package/dist/core.mjs +186 -0
- package/dist/features/edit-syntax-colors.cjs +19 -0
- package/dist/features/edit-syntax-colors.d.ts +4 -0
- package/dist/features/edit-syntax-colors.mjs +17 -0
- package/dist/features/inspect-syntax.cjs +70 -0
- package/dist/features/inspect-syntax.d.ts +4 -0
- package/dist/features/inspect-syntax.mjs +68 -0
- package/dist/features/render-syntax-colors.cjs +88 -0
- package/dist/features/render-syntax-colors.d.ts +4 -0
- package/dist/features/render-syntax-colors.mjs +86 -0
- package/dist/features/suggest-syntax.cjs +20 -0
- package/dist/features/suggest-syntax.d.ts +4 -0
- package/dist/features/suggest-syntax.mjs +18 -0
- package/dist/index.cjs +23 -15
- package/dist/index.d.ts +7 -5
- package/dist/index.mjs +7 -5
- package/dist/settings.cjs +130 -29
- package/dist/settings.d.ts +16 -8
- package/dist/settings.mjs +130 -29
- package/dist/utils/beautify-css.cjs +13 -0
- package/dist/utils/beautify-css.d.ts +1 -0
- package/dist/utils/beautify-css.mjs +11 -0
- package/dist/utils/convert-color-space.cjs +40 -0
- package/dist/utils/convert-color-space.d.ts +2 -0
- package/dist/utils/convert-color-space.mjs +38 -0
- package/dist/utils/convert-color-token.cjs +28 -0
- package/dist/utils/convert-color-token.d.ts +3 -0
- package/dist/utils/convert-color-token.mjs +26 -0
- package/dist/utils/create-doc.cjs +26 -0
- package/dist/utils/create-doc.d.ts +16 -0
- package/dist/utils/create-doc.mjs +21 -0
- package/dist/utils/css-data-provider.cjs +9 -0
- package/dist/utils/css-data-provider.d.ts +3 -0
- package/dist/utils/css-data-provider.mjs +7 -0
- package/dist/utils/find-matching-brackets.cjs +29 -0
- package/dist/utils/find-matching-brackets.d.ts +1 -0
- package/dist/utils/find-matching-brackets.mjs +27 -0
- package/dist/utils/get-color-completion-items.cjs +30 -0
- package/dist/utils/get-color-completion-items.d.ts +3 -0
- package/dist/utils/get-color-completion-items.mjs +28 -0
- package/dist/utils/get-css-data-documentation.cjs +90 -0
- package/dist/utils/get-css-data-documentation.d.ts +5 -0
- package/dist/utils/get-css-data-documentation.mjs +88 -0
- package/dist/utils/get-main-completion-items.cjs +105 -0
- package/dist/utils/get-main-completion-items.d.ts +3 -0
- package/dist/utils/get-main-completion-items.mjs +103 -0
- package/dist/utils/get-position.cjs +12 -0
- package/dist/utils/get-position.d.ts +1 -0
- package/dist/utils/get-position.mjs +10 -0
- package/dist/utils/get-pseudo-class-completion-items.cjs +65 -0
- package/dist/utils/get-pseudo-class-completion-items.d.ts +3 -0
- package/dist/utils/get-pseudo-class-completion-items.mjs +63 -0
- package/dist/utils/get-pseudo-element-completion-items.cjs +56 -0
- package/dist/utils/get-pseudo-element-completion-items.d.ts +3 -0
- package/dist/utils/get-pseudo-element-completion-items.mjs +54 -0
- package/dist/utils/get-query-completion-items.cjs +102 -0
- package/dist/utils/get-query-completion-items.d.ts +3 -0
- package/dist/utils/get-query-completion-items.mjs +100 -0
- package/dist/utils/get-range.cjs +21 -0
- package/dist/utils/get-range.d.ts +2 -0
- package/dist/utils/get-range.mjs +19 -0
- package/dist/utils/get-utility-info.cjs +32 -0
- package/dist/utils/get-utility-info.d.ts +7 -0
- package/dist/utils/get-utility-info.mjs +30 -0
- package/dist/utils/get-value-completion-items.cjs +185 -0
- package/dist/utils/get-value-completion-items.d.ts +3 -0
- package/dist/utils/get-value-completion-items.mjs +183 -0
- package/dist/utils/query-syntax-completions.cjs +115 -0
- package/dist/utils/query-syntax-completions.d.ts +3 -0
- package/dist/utils/query-syntax-completions.mjs +113 -0
- package/dist/utils/regex.cjs +1 -1
- package/dist/utils/regex.mjs +1 -1
- package/dist/utils/sort-completion-items.cjs +11 -0
- package/dist/utils/sort-completion-items.d.ts +2 -0
- package/dist/utils/sort-completion-items.mjs +9 -0
- package/package.json +1 -1
- package/dist/constant.cjs +0 -3064
- package/dist/constant.d.ts +0 -33
- package/dist/constant.mjs +0 -3055
- package/dist/position-check.cjs +0 -37
- package/dist/position-check.d.ts +0 -7
- package/dist/position-check.mjs +0 -35
- package/dist/providers/color.cjs +0 -319
- package/dist/providers/color.d.ts +0 -5
- package/dist/providers/color.mjs +0 -315
- package/dist/providers/completion.cjs +0 -309
- package/dist/providers/completion.d.ts +0 -14
- package/dist/providers/completion.mjs +0 -303
- package/dist/providers/hover.cjs +0 -65
- package/dist/providers/hover.d.ts +0 -2
- package/dist/providers/hover.mjs +0 -63
- package/dist/utils/get-css-entry-markdown-description.cjs +0 -77
- package/dist/utils/get-css-entry-markdown-description.d.ts +0 -1
- package/dist/utils/get-css-entry-markdown-description.mjs +0 -75
- package/dist/utils/hex-to-rgb.cjs +0 -13
- package/dist/utils/hex-to-rgb.d.ts +0 -2
- package/dist/utils/hex-to-rgb.mjs +0 -11
- package/dist/utils/oklab-to-rgb.cjs +0 -33
- package/dist/utils/oklab-to-rgb.d.ts +0 -1
- package/dist/utils/oklab-to-rgb.mjs +0 -31
- package/dist/utils/oklch-to-oklab.cjs +0 -11
- package/dist/utils/oklch-to-oklab.d.ts +0 -1
- package/dist/utils/oklch-to-oklab.mjs +0 -9
- package/dist/utils/to-two-digit-hex.cjs +0 -8
- package/dist/utils/to-two-digit-hex.d.ts +0 -1
- package/dist/utils/to-two-digit-hex.mjs +0 -6
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { getCSSDataDocumentation } from '../utils/get-css-data-documentation.mjs';
|
|
2
|
+
import { generateCSS, Layer, isCoreRule } from '@master/css';
|
|
3
|
+
import cssDataProvider from '../utils/css-data-provider.mjs';
|
|
4
|
+
import getUtilityInfo from '../utils/get-utility-info.mjs';
|
|
5
|
+
|
|
6
|
+
function inspectSyntax(document, position) {
|
|
7
|
+
const classPosition = this.getClassPosition(document, position);
|
|
8
|
+
if (!classPosition) return;
|
|
9
|
+
const { token } = classPosition;
|
|
10
|
+
const range = {
|
|
11
|
+
start: document.positionAt(classPosition.range.start),
|
|
12
|
+
end: document.positionAt(classPosition.range.end)
|
|
13
|
+
};
|
|
14
|
+
const styleClasses = this.css.styles[token];
|
|
15
|
+
if (styleClasses) {
|
|
16
|
+
const documentation = getCSSDataDocumentation({}, {
|
|
17
|
+
generatedCSS: generateCSS([
|
|
18
|
+
token
|
|
19
|
+
], this.css),
|
|
20
|
+
docs: 'styles'
|
|
21
|
+
});
|
|
22
|
+
if (documentation) {
|
|
23
|
+
return {
|
|
24
|
+
contents: {
|
|
25
|
+
kind: documentation.kind,
|
|
26
|
+
value: `(style) ` + styleClasses.join(' ') + '\n' + documentation.value
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
} else {
|
|
31
|
+
const rules = this.css.generate(token);
|
|
32
|
+
const rule = rules[0];
|
|
33
|
+
if (rule) {
|
|
34
|
+
if (rule.layer === Layer.Utility) {
|
|
35
|
+
const { data, docs } = getUtilityInfo(rule.RegisteredRule, this.css);
|
|
36
|
+
const documentation = getCSSDataDocumentation(data, {
|
|
37
|
+
generatedCSS: generateCSS([
|
|
38
|
+
token
|
|
39
|
+
], this.css),
|
|
40
|
+
docs
|
|
41
|
+
});
|
|
42
|
+
if (documentation) {
|
|
43
|
+
return {
|
|
44
|
+
contents: documentation,
|
|
45
|
+
range
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
} else {
|
|
49
|
+
const nativeProperties = cssDataProvider.provideProperties();
|
|
50
|
+
const nativeCSSPropertyData = nativeProperties.find(({ name })=>name === rule.id);
|
|
51
|
+
const documentation = getCSSDataDocumentation(nativeCSSPropertyData, {
|
|
52
|
+
generatedCSS: generateCSS([
|
|
53
|
+
token
|
|
54
|
+
], this.css),
|
|
55
|
+
docs: isCoreRule(rule.id) && rule.id
|
|
56
|
+
});
|
|
57
|
+
if (documentation) {
|
|
58
|
+
return {
|
|
59
|
+
contents: documentation,
|
|
60
|
+
range
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export { inspectSyntax as default };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var regex = require('../utils/regex.cjs');
|
|
4
|
+
var culori = require('culori');
|
|
5
|
+
var css = require('@master/css');
|
|
6
|
+
|
|
7
|
+
async function renderSyntaxColors(document) {
|
|
8
|
+
const text = document.getText() ?? '';
|
|
9
|
+
const colorInformations = [];
|
|
10
|
+
for (const instanceMatch of text.matchAll(regex.instancePattern)){
|
|
11
|
+
if (instanceMatch.index === undefined) break;
|
|
12
|
+
const instanceStartIndex = instanceMatch.index;
|
|
13
|
+
const syntax = instanceMatch[0];
|
|
14
|
+
const rule = this.css.generate(syntax)[0];
|
|
15
|
+
if (rule && rule.layer !== css.Layer.Utility) {
|
|
16
|
+
const keyTokenLength = rule.keyToken?.length ?? 0;
|
|
17
|
+
let currentLength = 0;
|
|
18
|
+
const resolveValueComponent = (valueComponent)=>{
|
|
19
|
+
if (valueComponent.text === undefined) return; // text is always existing, just for type
|
|
20
|
+
const startOffset = instanceStartIndex + keyTokenLength + currentLength;
|
|
21
|
+
// TODO: check number mt:30
|
|
22
|
+
const valueComponentTokenLength = valueComponent.token.length;
|
|
23
|
+
let color;
|
|
24
|
+
switch(valueComponent.type){
|
|
25
|
+
case 'function':
|
|
26
|
+
if ([
|
|
27
|
+
'rgb',
|
|
28
|
+
'rgba',
|
|
29
|
+
'hsl',
|
|
30
|
+
'hsla',
|
|
31
|
+
'hwb',
|
|
32
|
+
'lab',
|
|
33
|
+
'lch',
|
|
34
|
+
'oklab',
|
|
35
|
+
'oklch',
|
|
36
|
+
'color'
|
|
37
|
+
].includes(valueComponent.name)) {
|
|
38
|
+
color = culori.parse(valueComponent.text);
|
|
39
|
+
} else if (valueComponent.children.length) {
|
|
40
|
+
currentLength += valueComponent.name.length + 1 // function name + '('
|
|
41
|
+
;
|
|
42
|
+
valueComponent.children.forEach(resolveValueComponent);
|
|
43
|
+
}
|
|
44
|
+
break;
|
|
45
|
+
case 'variable':
|
|
46
|
+
if (valueComponent.variable?.type === 'color') {
|
|
47
|
+
color = culori.parse(valueComponent.text);
|
|
48
|
+
}
|
|
49
|
+
break;
|
|
50
|
+
case 'string':
|
|
51
|
+
if (valueComponent.text !== '#' && valueComponent.text?.startsWith('#')) {
|
|
52
|
+
color = culori.parse(valueComponent.text);
|
|
53
|
+
}
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
// check if rgba is valid
|
|
57
|
+
if (color) {
|
|
58
|
+
const rgbaColor = color.mode !== 'rgb' ? culori.converter('rgb')(color) : color;
|
|
59
|
+
colorInformations.push({
|
|
60
|
+
range: {
|
|
61
|
+
start: document.positionAt(startOffset),
|
|
62
|
+
end: document.positionAt(startOffset + valueComponentTokenLength)
|
|
63
|
+
},
|
|
64
|
+
color: {
|
|
65
|
+
red: rgbaColor.r,
|
|
66
|
+
green: rgbaColor.g,
|
|
67
|
+
blue: rgbaColor.b,
|
|
68
|
+
alpha: rgbaColor.alpha === undefined ? 1 : rgbaColor.alpha
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
currentLength += valueComponentTokenLength || 0;
|
|
73
|
+
};
|
|
74
|
+
rule.valueComponents.forEach(resolveValueComponent);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
const colorIndexSet = new Set();
|
|
78
|
+
return colorInformations.filter((item)=>{
|
|
79
|
+
if (colorIndexSet.has(item.range.start)) {
|
|
80
|
+
return false;
|
|
81
|
+
} else {
|
|
82
|
+
colorIndexSet.add(item.range.start);
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
module.exports = renderSyntaxColors;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ColorInformation } from 'vscode-languageserver-protocol';
|
|
2
|
+
import CSSLanguageService from '../core';
|
|
3
|
+
import type { TextDocument } from 'vscode-languageserver-textdocument';
|
|
4
|
+
export default function renderSyntaxColors(this: CSSLanguageService, document: TextDocument): Promise<ColorInformation[] | undefined>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { instancePattern } from '../utils/regex.mjs';
|
|
2
|
+
import { parse, converter } from 'culori';
|
|
3
|
+
import { Layer } from '@master/css';
|
|
4
|
+
|
|
5
|
+
async function renderSyntaxColors(document) {
|
|
6
|
+
const text = document.getText() ?? '';
|
|
7
|
+
const colorInformations = [];
|
|
8
|
+
for (const instanceMatch of text.matchAll(instancePattern)){
|
|
9
|
+
if (instanceMatch.index === undefined) break;
|
|
10
|
+
const instanceStartIndex = instanceMatch.index;
|
|
11
|
+
const syntax = instanceMatch[0];
|
|
12
|
+
const rule = this.css.generate(syntax)[0];
|
|
13
|
+
if (rule && rule.layer !== Layer.Utility) {
|
|
14
|
+
const keyTokenLength = rule.keyToken?.length ?? 0;
|
|
15
|
+
let currentLength = 0;
|
|
16
|
+
const resolveValueComponent = (valueComponent)=>{
|
|
17
|
+
if (valueComponent.text === undefined) return; // text is always existing, just for type
|
|
18
|
+
const startOffset = instanceStartIndex + keyTokenLength + currentLength;
|
|
19
|
+
// TODO: check number mt:30
|
|
20
|
+
const valueComponentTokenLength = valueComponent.token.length;
|
|
21
|
+
let color;
|
|
22
|
+
switch(valueComponent.type){
|
|
23
|
+
case 'function':
|
|
24
|
+
if ([
|
|
25
|
+
'rgb',
|
|
26
|
+
'rgba',
|
|
27
|
+
'hsl',
|
|
28
|
+
'hsla',
|
|
29
|
+
'hwb',
|
|
30
|
+
'lab',
|
|
31
|
+
'lch',
|
|
32
|
+
'oklab',
|
|
33
|
+
'oklch',
|
|
34
|
+
'color'
|
|
35
|
+
].includes(valueComponent.name)) {
|
|
36
|
+
color = parse(valueComponent.text);
|
|
37
|
+
} else if (valueComponent.children.length) {
|
|
38
|
+
currentLength += valueComponent.name.length + 1 // function name + '('
|
|
39
|
+
;
|
|
40
|
+
valueComponent.children.forEach(resolveValueComponent);
|
|
41
|
+
}
|
|
42
|
+
break;
|
|
43
|
+
case 'variable':
|
|
44
|
+
if (valueComponent.variable?.type === 'color') {
|
|
45
|
+
color = parse(valueComponent.text);
|
|
46
|
+
}
|
|
47
|
+
break;
|
|
48
|
+
case 'string':
|
|
49
|
+
if (valueComponent.text !== '#' && valueComponent.text?.startsWith('#')) {
|
|
50
|
+
color = parse(valueComponent.text);
|
|
51
|
+
}
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
// check if rgba is valid
|
|
55
|
+
if (color) {
|
|
56
|
+
const rgbaColor = color.mode !== 'rgb' ? converter('rgb')(color) : color;
|
|
57
|
+
colorInformations.push({
|
|
58
|
+
range: {
|
|
59
|
+
start: document.positionAt(startOffset),
|
|
60
|
+
end: document.positionAt(startOffset + valueComponentTokenLength)
|
|
61
|
+
},
|
|
62
|
+
color: {
|
|
63
|
+
red: rgbaColor.r,
|
|
64
|
+
green: rgbaColor.g,
|
|
65
|
+
blue: rgbaColor.b,
|
|
66
|
+
alpha: rgbaColor.alpha === undefined ? 1 : rgbaColor.alpha
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
currentLength += valueComponentTokenLength || 0;
|
|
71
|
+
};
|
|
72
|
+
rule.valueComponents.forEach(resolveValueComponent);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
const colorIndexSet = new Set();
|
|
76
|
+
return colorInformations.filter((item)=>{
|
|
77
|
+
if (colorIndexSet.has(item.range.start)) {
|
|
78
|
+
return false;
|
|
79
|
+
} else {
|
|
80
|
+
colorIndexSet.add(item.range.start);
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export { renderSyntaxColors as default };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var querySyntaxCompletions = require('../utils/query-syntax-completions.cjs');
|
|
4
|
+
|
|
5
|
+
function suggestSyntax(document, position, context) {
|
|
6
|
+
const classPosition = this.getClassPosition(document, position);
|
|
7
|
+
if (classPosition !== undefined) {
|
|
8
|
+
const q = context?.triggerCharacter === ' ' ? '' : document.getText({
|
|
9
|
+
start: document.positionAt(classPosition.range.start),
|
|
10
|
+
end: position
|
|
11
|
+
});
|
|
12
|
+
return querySyntaxCompletions(q, this.css);
|
|
13
|
+
}
|
|
14
|
+
// todo
|
|
15
|
+
// else if (isInstance === true && checkConfigColorsBlock(document, position) === true) {
|
|
16
|
+
// return getColorCompletionItems(this.css)
|
|
17
|
+
// }
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
module.exports = suggestSyntax;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CompletionItem, CompletionParams } from 'vscode-languageserver-protocol';
|
|
2
|
+
import type { TextDocument } from 'vscode-languageserver-textdocument';
|
|
3
|
+
import CSSLanguageService from '../core';
|
|
4
|
+
export default function suggestSyntax(this: CSSLanguageService, document: TextDocument, position: CompletionParams['position'], context: CompletionParams['context']): CompletionItem[] | undefined;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import querySyntaxCompletions from '../utils/query-syntax-completions.mjs';
|
|
2
|
+
|
|
3
|
+
function suggestSyntax(document, position, context) {
|
|
4
|
+
const classPosition = this.getClassPosition(document, position);
|
|
5
|
+
if (classPosition !== undefined) {
|
|
6
|
+
const q = context?.triggerCharacter === ' ' ? '' : document.getText({
|
|
7
|
+
start: document.positionAt(classPosition.range.start),
|
|
8
|
+
end: position
|
|
9
|
+
});
|
|
10
|
+
return querySyntaxCompletions(q, this.css);
|
|
11
|
+
}
|
|
12
|
+
// todo
|
|
13
|
+
// else if (isInstance === true && checkConfigColorsBlock(document, position) === true) {
|
|
14
|
+
// return getColorCompletionItems(this.css)
|
|
15
|
+
// }
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { suggestSyntax as default };
|
package/dist/index.cjs
CHANGED
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var positionCheck = require('./position-check.cjs');
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var core = require('./core.cjs');
|
|
7
6
|
var settings = require('./settings.cjs');
|
|
7
|
+
var common = require('./common.cjs');
|
|
8
|
+
var inspectSyntax = require('./features/inspect-syntax.cjs');
|
|
9
|
+
var renderSyntaxColors = require('./features/render-syntax-colors.cjs');
|
|
10
|
+
var editSyntaxColors = require('./features/edit-syntax-colors.cjs');
|
|
11
|
+
var suggestSyntax = require('./features/suggest-syntax.cjs');
|
|
8
12
|
|
|
9
13
|
|
|
10
14
|
|
|
11
|
-
exports.
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
14
|
-
exports.
|
|
15
|
-
exports.
|
|
16
|
-
exports.
|
|
17
|
-
exports.
|
|
18
|
-
exports.
|
|
19
|
-
exports.
|
|
20
|
-
exports.
|
|
21
|
-
exports.
|
|
15
|
+
exports.CSSLanguageService = core;
|
|
16
|
+
exports.default = core;
|
|
17
|
+
exports.settings = settings;
|
|
18
|
+
exports.AT_TRIGGER_CHARACTER = common.AT_TRIGGER_CHARACTER;
|
|
19
|
+
exports.DECLARATION_SEPARATOR_TRIGGER_CHARACTER = common.DECLARATION_SEPARATOR_TRIGGER_CHARACTER;
|
|
20
|
+
exports.GROUP_TRIGGER_CHARACTER = common.GROUP_TRIGGER_CHARACTER;
|
|
21
|
+
exports.INVOKED_TRIGGER_CHARACTERS = common.INVOKED_TRIGGER_CHARACTERS;
|
|
22
|
+
exports.QUERY_TRIGGER_CHARACTERS = common.QUERY_TRIGGER_CHARACTERS;
|
|
23
|
+
exports.SELECTOR_TRIGGER_CHARACTERS = common.SELECTOR_TRIGGER_CHARACTERS;
|
|
24
|
+
exports.SERVER_CAPABILITIES = common.SERVER_CAPABILITIES;
|
|
25
|
+
exports.VALUE_TRIGGER_CHARACTERS = common.VALUE_TRIGGER_CHARACTERS;
|
|
26
|
+
exports.inspectSyntax = inspectSyntax;
|
|
27
|
+
exports.renderSyntaxColors = renderSyntaxColors;
|
|
28
|
+
exports.editSyntaxColors = editSyntaxColors;
|
|
29
|
+
exports.suggestSyntax = suggestSyntax;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export * from './
|
|
4
|
-
export
|
|
5
|
-
export
|
|
1
|
+
export { default, default as CSSLanguageService } from './core';
|
|
2
|
+
export { default as settings, type Settings } from './settings';
|
|
3
|
+
export * from './common';
|
|
4
|
+
export { default as inspectSyntax } from './features/inspect-syntax';
|
|
5
|
+
export { default as renderSyntaxColors } from './features/render-syntax-colors';
|
|
6
|
+
export { default as editSyntaxColors } from './features/edit-syntax-colors';
|
|
7
|
+
export { default as suggestSyntax } from './features/suggest-syntax';
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
1
|
+
export { default as CSSLanguageService, default } from './core.mjs';
|
|
2
|
+
export { default as settings } from './settings.mjs';
|
|
3
|
+
export { AT_TRIGGER_CHARACTER, DECLARATION_SEPARATOR_TRIGGER_CHARACTER, GROUP_TRIGGER_CHARACTER, INVOKED_TRIGGER_CHARACTERS, QUERY_TRIGGER_CHARACTERS, SELECTOR_TRIGGER_CHARACTERS, SERVER_CAPABILITIES, VALUE_TRIGGER_CHARACTERS } from './common.mjs';
|
|
4
|
+
export { default as inspectSyntax } from './features/inspect-syntax.mjs';
|
|
5
|
+
export { default as renderSyntaxColors } from './features/render-syntax-colors.mjs';
|
|
6
|
+
export { default as editSyntaxColors } from './features/edit-syntax-colors.mjs';
|
|
7
|
+
export { default as suggestSyntax } from './features/suggest-syntax.mjs';
|
package/dist/settings.cjs
CHANGED
|
@@ -1,37 +1,138 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
/* eslint-disable quotes */ /**
|
|
4
|
+
* @example styles https://regex101.com/r/HLPdsw/1
|
|
5
|
+
**/ const settings = {
|
|
6
|
+
includedLanguages: [
|
|
7
|
+
"html",
|
|
8
|
+
"php",
|
|
9
|
+
"javascript",
|
|
10
|
+
"typescript",
|
|
11
|
+
"javascriptreact",
|
|
12
|
+
"typescriptreact",
|
|
13
|
+
"vue",
|
|
14
|
+
"svelte",
|
|
15
|
+
"rust",
|
|
16
|
+
"astro",
|
|
17
|
+
"markdown",
|
|
18
|
+
"mdx",
|
|
19
|
+
"astro"
|
|
14
20
|
],
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
classStrings: [
|
|
22
|
+
[
|
|
23
|
+
"\\sclass=",
|
|
24
|
+
"\""
|
|
25
|
+
],
|
|
26
|
+
[
|
|
27
|
+
"\\sclass=",
|
|
28
|
+
"'"
|
|
29
|
+
],
|
|
30
|
+
[
|
|
31
|
+
"\\sclassName=",
|
|
32
|
+
"\""
|
|
33
|
+
],
|
|
34
|
+
[
|
|
35
|
+
"\\sclassName=",
|
|
36
|
+
"'"
|
|
37
|
+
],
|
|
38
|
+
[
|
|
39
|
+
"\\sstyled(?:\\s+)?(?:\\.\\w+)?",
|
|
40
|
+
"`"
|
|
41
|
+
],
|
|
42
|
+
[
|
|
43
|
+
"\\sstyles(?:\\s+)?(?::|=)(?:\\s+)?",
|
|
44
|
+
"\""
|
|
45
|
+
],
|
|
46
|
+
[
|
|
47
|
+
"\\sstyles(?:\\s+)?(?::|=)(?:\\s+)?",
|
|
48
|
+
"'"
|
|
49
|
+
],
|
|
50
|
+
[
|
|
51
|
+
"\\sstyles(?:\\s+)?(?::|=)(?:\\s+)?",
|
|
52
|
+
"`"
|
|
53
|
+
]
|
|
54
|
+
],
|
|
55
|
+
classAssignments: [
|
|
56
|
+
[
|
|
57
|
+
"\\sclassName=",
|
|
58
|
+
"{",
|
|
59
|
+
"}"
|
|
60
|
+
],
|
|
61
|
+
[
|
|
62
|
+
"\\sclass=",
|
|
63
|
+
"{",
|
|
64
|
+
"}"
|
|
65
|
+
],
|
|
66
|
+
[
|
|
67
|
+
"\\sclass:list=",
|
|
68
|
+
"{",
|
|
69
|
+
"}"
|
|
70
|
+
],
|
|
71
|
+
[
|
|
72
|
+
"\\sstyles(?:\\s+)?(?::|=)(?:\\s+)?",
|
|
73
|
+
"{",
|
|
74
|
+
"}"
|
|
75
|
+
],
|
|
76
|
+
[
|
|
77
|
+
"\\s:class=",
|
|
78
|
+
"\"",
|
|
79
|
+
"\""
|
|
80
|
+
],
|
|
81
|
+
[
|
|
82
|
+
"\\sv-bind:class=",
|
|
83
|
+
"\"",
|
|
84
|
+
"\""
|
|
85
|
+
],
|
|
86
|
+
[
|
|
87
|
+
"\\s[class]=",
|
|
88
|
+
"\"",
|
|
89
|
+
"\""
|
|
90
|
+
],
|
|
91
|
+
[
|
|
92
|
+
"\\s[className]=",
|
|
93
|
+
"\"",
|
|
94
|
+
"\""
|
|
95
|
+
],
|
|
96
|
+
[
|
|
97
|
+
"\\s[ngClass]=",
|
|
98
|
+
"\"",
|
|
99
|
+
"\""
|
|
100
|
+
],
|
|
101
|
+
[
|
|
102
|
+
"\\sclsx",
|
|
103
|
+
"(",
|
|
104
|
+
")"
|
|
105
|
+
],
|
|
106
|
+
[
|
|
107
|
+
"\\scva",
|
|
108
|
+
"(",
|
|
109
|
+
")"
|
|
110
|
+
],
|
|
111
|
+
[
|
|
112
|
+
"\\.class",
|
|
113
|
+
"(",
|
|
114
|
+
")"
|
|
115
|
+
],
|
|
116
|
+
[
|
|
117
|
+
"\\sstyled(?:\\s+)?(?:\\.\\w+)?",
|
|
118
|
+
"(",
|
|
119
|
+
")"
|
|
120
|
+
],
|
|
121
|
+
[
|
|
122
|
+
"\\.classList(?:\\s+)?(?:\\.(add|remove|toggle|replace))",
|
|
123
|
+
"(",
|
|
124
|
+
")"
|
|
125
|
+
]
|
|
25
126
|
],
|
|
26
127
|
exclude: [
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
128
|
+
"**/.git/**",
|
|
129
|
+
"**/node_modules/**",
|
|
130
|
+
"**/.hg/**"
|
|
30
131
|
],
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
132
|
+
suggestSyntax: true,
|
|
133
|
+
inspectSyntax: true,
|
|
134
|
+
renderSyntaxColors: true,
|
|
135
|
+
editSyntaxColors: true
|
|
35
136
|
};
|
|
36
137
|
|
|
37
|
-
exports
|
|
138
|
+
module.exports = settings;
|
package/dist/settings.d.ts
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { Config } from '@master/css';
|
|
2
|
+
/**
|
|
3
|
+
* @example styles https://regex101.com/r/HLPdsw/1
|
|
4
|
+
**/
|
|
5
|
+
declare const settings: Settings;
|
|
6
|
+
export default settings;
|
|
7
|
+
export declare type Settings = {
|
|
8
|
+
includedLanguages?: string[];
|
|
9
|
+
classStrings?: [string, string][];
|
|
10
|
+
classAssignments?: [string, string, string][];
|
|
11
|
+
exclude?: string[];
|
|
12
|
+
config?: Config;
|
|
13
|
+
suggestSyntax?: boolean;
|
|
14
|
+
inspectSyntax?: boolean;
|
|
15
|
+
renderSyntaxColors?: boolean;
|
|
16
|
+
editSyntaxColors?: boolean;
|
|
9
17
|
};
|