@master/css-language-service 2.0.0-rc.8 → 2.0.0-rc.81
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/LICENSE +21 -0
- package/README.md +129 -0
- package/dist/common.d.ts +2 -0
- package/dist/common.js +2 -0
- package/dist/core.d.ts +39 -0
- package/dist/core.js +111 -0
- package/dist/features/edit-syntax-colors.d.ts +8 -0
- package/dist/features/edit-syntax-colors.js +16 -0
- package/dist/features/format-directives.d.ts +7 -0
- package/dist/features/format-directives.js +72 -0
- package/dist/features/inspect-syntax.d.ts +8 -0
- package/dist/features/inspect-syntax.js +37 -0
- package/dist/features/render-semantic-tokens.d.ts +9 -0
- package/dist/features/render-semantic-tokens.js +10 -0
- package/dist/features/render-syntax-colors.d.ts +8 -0
- package/dist/features/render-syntax-colors.js +93 -0
- package/dist/features/suggest-syntax.d.ts +9 -0
- package/dist/features/suggest-syntax.js +11 -0
- package/dist/index.d.ts +8 -5
- package/dist/index.js +8 -0
- package/dist/settings.d.ts +20 -9
- package/dist/settings.js +59 -0
- package/dist/utils/beautify-css.d.ts +4 -0
- package/dist/utils/beautify-css.js +10 -0
- package/dist/utils/completion-index.d.ts +43 -0
- package/dist/utils/completion-index.js +196 -0
- package/dist/utils/convert-color-token.d.ts +8 -0
- package/dist/utils/convert-color-token.js +47 -0
- package/dist/utils/create-css-markdown-documentation.d.ts +8 -0
- package/dist/utils/create-css-markdown-documentation.js +13 -0
- package/dist/utils/create-doc.d.ts +20 -0
- package/dist/utils/create-doc.js +21 -0
- package/dist/utils/get-class-completion-items.d.ts +8 -0
- package/dist/utils/get-class-completion-items.js +15 -0
- package/dist/utils/get-color-completion-items.d.ts +7 -0
- package/dist/utils/get-color-completion-items.js +22 -0
- package/dist/utils/get-position.d.ts +4 -0
- package/dist/utils/get-position.js +9 -0
- package/dist/utils/get-pseudo-class-completion-items.d.ts +8 -0
- package/dist/utils/get-pseudo-class-completion-items.js +64 -0
- package/dist/utils/get-pseudo-element-completion-items.d.ts +8 -0
- package/dist/utils/get-pseudo-element-completion-items.js +39 -0
- package/dist/utils/get-query-completion-items.d.ts +8 -0
- package/dist/utils/get-query-completion-items.js +62 -0
- package/dist/utils/get-range.d.ts +6 -0
- package/dist/utils/get-range.js +21 -0
- package/dist/utils/get-utility-info.d.ts +8 -0
- package/dist/utils/get-utility-info.js +16 -0
- package/dist/utils/get-value-completion-items.d.ts +8 -0
- package/dist/utils/get-value-completion-items.js +165 -0
- package/dist/utils/query-syntax-completions.d.ts +8 -0
- package/dist/utils/query-syntax-completions.js +78 -0
- package/dist/utils/regex.d.ts +4 -1
- package/dist/utils/regex.js +4 -0
- package/dist/utils/sort-completion-items.d.ts +6 -0
- package/dist/utils/sort-completion-items.js +10 -0
- package/package.json +61 -1
- package/dist/constant.d.ts +0 -33
- package/dist/index.bundle.js +0 -33
- package/dist/position-check.d.ts +0 -20
- package/dist/providers/color.d.ts +0 -5
- package/dist/providers/completion.d.ts +0 -14
- package/dist/providers/hover.d.ts +0 -2
- package/dist/settings.bundle.js +0 -1
- package/dist/utils/get-css-entry-markdown-description.d.ts +0 -1
- package/dist/utils/hex-to-rgb.d.ts +0 -2
- package/dist/utils/oklab-to-rgb.d.ts +0 -1
- package/dist/utils/oklch-to-oklab.d.ts +0 -1
- package/dist/utils/to-two-digit-hex.d.ts +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Aoyue Design LLC.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<br>
|
|
2
|
+
<div align="center">
|
|
3
|
+
|
|
4
|
+
<p align="center">
|
|
5
|
+
<a href="https://css.master.co">
|
|
6
|
+
<picture>
|
|
7
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/33840671/201701649-3bb7d698-abec-4d5f-ac30-ccc4d7bafcd4.svg">
|
|
8
|
+
<source media="(prefers-color-scheme: light)" srcset="https://user-images.githubusercontent.com/33840671/201703010-77bf2373-9899-40cc-98f5-30cf9b546941.svg">
|
|
9
|
+
<img alt="Master CSS" src="https://user-images.githubusercontent.com/33840671/201703010-77bf2373-9899-40cc-98f5-30cf9b546941.svg" width="100%">
|
|
10
|
+
</picture>
|
|
11
|
+
</a>
|
|
12
|
+
</p>
|
|
13
|
+
<p align="center">Language Service for Master CSS</p>
|
|
14
|
+
|
|
15
|
+
<p align="center">
|
|
16
|
+
<a aria-label="GitHub release (latest by date including pre-releases)" href="https://github.com/master-co/css/releases">
|
|
17
|
+
<picture>
|
|
18
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/v/release/master-co/css?include_prereleases&color=212022&label=&style=for-the-badge&logo=github&logoColor=fff">
|
|
19
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/github/v/release/master-co/css?include_prereleases&color=f6f7f8&label=&style=for-the-badge&logo=github&logoColor=%23000">
|
|
20
|
+
<img alt="NPM Version" src="https://img.shields.io/github/v/release/master-co/css?include_prereleases&color=f6f7f8&label=&style=for-the-badge&logo=github">
|
|
21
|
+
</picture>
|
|
22
|
+
</a>
|
|
23
|
+
<a aria-label="NPM Package" href="https://www.npmjs.com/package/@master/css-language-service">
|
|
24
|
+
<picture>
|
|
25
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/dm/@master/css-language-service?color=212022&label=%20&logo=npm&style=for-the-badge">
|
|
26
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/npm/dm/@master/css-language-service?color=f6f7f8&label=%20&logo=npm&style=for-the-badge">
|
|
27
|
+
<img alt="NPM package ( download / month )" src="https://img.shields.io/npm/dm/@master/css-language-service?color=f6f7f8&label=%20&logo=npm&style=for-the-badge">
|
|
28
|
+
</picture>
|
|
29
|
+
</a>
|
|
30
|
+
<a aria-label="JSDelivr" href="https://www.jsdelivr.com/package/npm/@master/css-language-service">
|
|
31
|
+
<picture>
|
|
32
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/jsdelivr/npm/hm/@master/css-language-service?color=212022&label=%20&logo=jsdelivr&style=for-the-badge">
|
|
33
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/jsdelivr/npm/hm/@master/css-language-service?color=f6f7f8&label=%20&logo=jsdelivr&style=for-the-badge">
|
|
34
|
+
<img alt="JSDelivr hits (npm scoped)" src="https://img.shields.io/jsdelivr/npm/hm/@master/css-language-service?color=f6f7f8&label=%20&logo=jsdelivr&style=for-the-badge">
|
|
35
|
+
</picture>
|
|
36
|
+
</a>
|
|
37
|
+
<a aria-label="Discord Community" href="https://discord.gg/sZNKpAAAw6">
|
|
38
|
+
<picture>
|
|
39
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/discord/917780624314613760?color=212022&label=%20&logo=discord&style=for-the-badge">
|
|
40
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/discord/917780624314613760?color=f6f7f8&label=%20&logo=discord&style=for-the-badge">
|
|
41
|
+
<img alt="Discord online" src="https://img.shields.io/discord/917780624314613760?color=f6f7f8&label=%20&logo=discord&style=for-the-badge">
|
|
42
|
+
</picture>
|
|
43
|
+
</a>
|
|
44
|
+
<a aria-label="Follow @mastercorg" href="https://twitter.com/mastercorg">
|
|
45
|
+
<picture>
|
|
46
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/static/v1?label=%20&message=twitter&color=212022&logo=twitter&style=for-the-badge">
|
|
47
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/static/v1?label=%20&message=twitter&color=f6f7f8&logo=twitter&style=for-the-badge">
|
|
48
|
+
<img alt="Follow @mastercorg" src="https://img.shields.io/static/v1?label=%20&message=twitter&color=f6f7f8&logo=twitter&style=for-the-badge">
|
|
49
|
+
</picture>
|
|
50
|
+
</a>
|
|
51
|
+
<a aria-label="Github Actions" href="https://github.com/master-co/css/actions/workflows/ci-release.yml">
|
|
52
|
+
<picture>
|
|
53
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/actions/workflow/status/master-co/css/ci-release.yml?branch=rc&label=%20&message=twitter&color=212022&logo=githubactions&style=for-the-badge">
|
|
54
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/github/actions/workflow/status/master-co/css/ci-release.yml?branch=rc&label=%20&message=twitter&color=f6f7f8&logo=githubactions&style=for-the-badge&logoColor=%23000">
|
|
55
|
+
<img alt="Github release actions" src="https://img.shields.io/github/actions/workflow/status/master-co/css/ci-release.yml?branch=rc&label=%20&message=twitter&color=f6f7f8&logo=githubactions&style=for-the-badge&logoColor=%23000">
|
|
56
|
+
</picture>
|
|
57
|
+
</a>
|
|
58
|
+
</p>
|
|
59
|
+
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
## Installation
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
npm install @master/css-language-service
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Usage
|
|
69
|
+
|
|
70
|
+
```js
|
|
71
|
+
import CSSLanguageService from '@master/css-language-service'
|
|
72
|
+
|
|
73
|
+
const languageService = new CSSLanguageService(customSettings)
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
`CSSLanguageService` provides stateful completion, hover, color, color presentation, and semantic token features around the editor-neutral primitives in `@master/css-language`.
|
|
77
|
+
|
|
78
|
+
### Semantic tokens
|
|
79
|
+
|
|
80
|
+
```ts
|
|
81
|
+
const semanticTokens = languageService.renderSemanticTokens(textDocument)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Semantic tokens are generated with the project manifest, so custom variables, components, utilities, modes, and other manifest-dependent tokens can be classified after the caller loads the manifest.
|
|
85
|
+
|
|
86
|
+
Use `renderSemanticTokensAtPosition()` when a client wants active-only highlighting for the embedded class context at the current editor position.
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
const semanticTokens = languageService.renderSemanticTokensAtPosition(textDocument, position)
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
CSS directive syntax in CSS-family documents is highlighted by the shared TextMate grammar. Semantic tokens are only added for directive class-list spans such as bare `@compose` preludes and quoted `@safelist` strings.
|
|
93
|
+
|
|
94
|
+
### Directive formatting
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
const edits = languageService.formatDirectives(textDocument)
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Directive formatting returns LSP text edits for Master CSS directive source. It supports CSS, SCSS, and LESS documents, plus CSS-family `<style>` blocks in Vue, Svelte, and Astro documents. The formatter repairs directive class-list important markers such as `bg:transparent !` to `bg:transparent!` and does not change compiler semantics or generated CSS.
|
|
101
|
+
|
|
102
|
+
Pass an LSP range as the second argument for range formatting:
|
|
103
|
+
|
|
104
|
+
```ts
|
|
105
|
+
const edits = languageService.formatDirectives(textDocument, range)
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Settings
|
|
109
|
+
|
|
110
|
+
```js
|
|
111
|
+
import { settings } from '@master/css-language-service'
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
| Setting | Type | Default | Description |
|
|
115
|
+
| --- | --- | --- | --- |
|
|
116
|
+
| `includedLanguages` | `string[]` | Common web and template languages | Language IDs that receive language-service features. |
|
|
117
|
+
| `exclude` | `string[]` | `["**/.git/**", "**/node_modules/**", "**/.hg/**"]` | Glob patterns excluded from all features. |
|
|
118
|
+
| `classAttributes` | `string[]` | `["class", "className"]` | Quoted markup attributes that contain Master CSS class strings. |
|
|
119
|
+
| `classAttributeBindings` | `Record<string, [string, string] \| false>` | Framework binding defaults | Bound attributes such as `:class`, `[ngClass]`, and `class:list`. |
|
|
120
|
+
| `classFunctions` | `string[]` | Common class helpers | Functions and methods whose string arguments contain classes, such as `clsx()` and `classList.add()`. |
|
|
121
|
+
| `classDeclarations` | `string[]` | `[]` | Variable declarations or object properties whose string values contain classes. |
|
|
122
|
+
| `suggestSyntax` | `boolean` | `true` | Enables syntax suggestions. |
|
|
123
|
+
| `inspectSyntax` | `boolean` | `true` | Enables hover inspection and generated CSS previews. |
|
|
124
|
+
| `renderSyntaxColors` | `boolean` | `true` | Enables color rendering. |
|
|
125
|
+
| `editSyntaxColors` | `boolean` | `true` | Enables color editing. |
|
|
126
|
+
| `formatDirectives` | `boolean` | `true` | Enables Master CSS directive formatting. |
|
|
127
|
+
| `embeddedSyntaxHighlighting` | `'active' \| 'always' \| 'off'` | `'active'` | Controls embedded semantic token highlighting. |
|
|
128
|
+
|
|
129
|
+
Use `@master/css-language` directly for browser helpers, Shiki integration, TextMate grammar assets, and raw class-position scanning.
|
package/dist/common.d.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { AT_TRIGGER_CHARACTER, DECLARATION_SEPARATOR_TRIGGER_CHARACTER, GROUP_TRIGGER_CHARACTER, INVOKED_TRIGGER_CHARACTERS, QUERY_TRIGGER_CHARACTERS, SELECTOR_TRIGGER_CHARACTERS, VALUE_TRIGGER_CHARACTERS } from "@master/css-language";
|
|
2
|
+
export { AT_TRIGGER_CHARACTER, DECLARATION_SEPARATOR_TRIGGER_CHARACTER, GROUP_TRIGGER_CHARACTER, INVOKED_TRIGGER_CHARACTERS, QUERY_TRIGGER_CHARACTERS, SELECTOR_TRIGGER_CHARACTERS, VALUE_TRIGGER_CHARACTERS };
|
package/dist/common.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { AT_TRIGGER_CHARACTER, DECLARATION_SEPARATOR_TRIGGER_CHARACTER, GROUP_TRIGGER_CHARACTER, INVOKED_TRIGGER_CHARACTERS, QUERY_TRIGGER_CHARACTERS, SELECTOR_TRIGGER_CHARACTERS, VALUE_TRIGGER_CHARACTERS } from "@master/css-language";
|
|
2
|
+
export { AT_TRIGGER_CHARACTER, DECLARATION_SEPARATOR_TRIGGER_CHARACTER, GROUP_TRIGGER_CHARACTER, INVOKED_TRIGGER_CHARACTERS, QUERY_TRIGGER_CHARACTERS, SELECTOR_TRIGGER_CHARACTERS, VALUE_TRIGGER_CHARACTERS };
|
package/dist/core.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { CSSLanguageRuntime, ClassPosition, MasterCSS } from "@master/css-language";
|
|
2
|
+
import EventEmitter from "node:events";
|
|
3
|
+
import { Position } from "vscode-languageserver-protocol";
|
|
4
|
+
import { TextDocument } from "vscode-languageserver-textdocument";
|
|
5
|
+
import { Settings } from "./settings.js";
|
|
6
|
+
import inspectSyntax from "./features/inspect-syntax.js";
|
|
7
|
+
import renderSyntaxColors from "./features/render-syntax-colors.js";
|
|
8
|
+
import editSyntaxColors from "./features/edit-syntax-colors.js";
|
|
9
|
+
import formatDirectives from "./features/format-directives.js";
|
|
10
|
+
import renderSemanticTokens$1, { renderSemanticTokensAtPosition as renderSemanticTokensAtPosition$1 } from "./features/render-semantic-tokens.js";
|
|
11
|
+
import suggestSyntax from "./features/suggest-syntax.js";
|
|
12
|
+
|
|
13
|
+
//#region src/core.d.ts
|
|
14
|
+
interface CSSLanguageServiceOptions {
|
|
15
|
+
runtime?: CSSLanguageRuntime;
|
|
16
|
+
}
|
|
17
|
+
declare class CSSLanguageService extends EventEmitter {
|
|
18
|
+
customSettings?: Settings | undefined;
|
|
19
|
+
css: MasterCSS;
|
|
20
|
+
runtime: CSSLanguageRuntime;
|
|
21
|
+
settings: Settings;
|
|
22
|
+
private completionIndex?;
|
|
23
|
+
private classPositionCache;
|
|
24
|
+
constructor(customSettings?: Settings | undefined, options?: CSSLanguageServiceOptions);
|
|
25
|
+
private getCompletionIndex;
|
|
26
|
+
inspectSyntax(...params: Parameters<typeof inspectSyntax>): import("vscode-languageserver-protocol").Hover | undefined;
|
|
27
|
+
renderSyntaxColors(...params: Parameters<typeof renderSyntaxColors>): Promise<import("vscode-languageserver-protocol").ColorInformation[] | undefined> | undefined;
|
|
28
|
+
editSyntaxColors(...params: Parameters<typeof editSyntaxColors>): import("vscode-languageserver-protocol").ColorPresentation[] | undefined;
|
|
29
|
+
formatDirectives(...params: Parameters<typeof formatDirectives>): import("vscode-languageserver-protocol").TextEdit[] | undefined;
|
|
30
|
+
renderSemanticTokens(...params: Parameters<typeof renderSemanticTokens$1>): import("vscode-languageserver-protocol").SemanticTokens | undefined;
|
|
31
|
+
renderSemanticTokensAtPosition(...params: Parameters<typeof renderSemanticTokensAtPosition$1>): import("vscode-languageserver-protocol").SemanticTokens | undefined;
|
|
32
|
+
suggestSyntax(document: Parameters<typeof suggestSyntax>[0], position: Parameters<typeof suggestSyntax>[1], context: Parameters<typeof suggestSyntax>[2]): import("vscode-languageserver-protocol").CompletionItem[] | undefined;
|
|
33
|
+
getClassPositions(textDocument: TextDocument): ClassPosition[];
|
|
34
|
+
getClassPosition(textDocument: TextDocument, position: Position): ClassPosition | undefined;
|
|
35
|
+
getClassContextPositions(textDocument: TextDocument, position: Position): ClassPosition[];
|
|
36
|
+
isDocumentAccepted(doc: TextDocument): boolean;
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
export { CSSLanguageServiceOptions, type ClassPosition, CSSLanguageService as default };
|
package/dist/core.js
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import settings from "./settings.js";
|
|
2
|
+
import inspectSyntax from "./features/inspect-syntax.js";
|
|
3
|
+
import renderSyntaxColors from "./features/render-syntax-colors.js";
|
|
4
|
+
import editSyntaxColors from "./features/edit-syntax-colors.js";
|
|
5
|
+
import formatDirectives from "./features/format-directives.js";
|
|
6
|
+
import renderSemanticTokens$1, { renderSemanticTokensAtPosition as renderSemanticTokensAtPosition$1 } from "./features/render-semantic-tokens.js";
|
|
7
|
+
import { createCompletionIndex } from "./utils/completion-index.js";
|
|
8
|
+
import suggestSyntax from "./features/suggest-syntax.js";
|
|
9
|
+
import { ClassPositionCache, defaultCSSLanguageRuntime, getClassPositions } from "@master/css-language";
|
|
10
|
+
import { defu } from "defu";
|
|
11
|
+
import EventEmitter from "node:events";
|
|
12
|
+
import { minimatch } from "minimatch";
|
|
13
|
+
//#region src/core.ts
|
|
14
|
+
var CSSLanguageService = class extends EventEmitter {
|
|
15
|
+
customSettings;
|
|
16
|
+
css;
|
|
17
|
+
runtime;
|
|
18
|
+
settings;
|
|
19
|
+
completionIndex;
|
|
20
|
+
classPositionCache = new ClassPositionCache();
|
|
21
|
+
constructor(customSettings, options = {}) {
|
|
22
|
+
super();
|
|
23
|
+
this.customSettings = customSettings;
|
|
24
|
+
this.runtime = options.runtime ?? defaultCSSLanguageRuntime;
|
|
25
|
+
this.settings = defu(customSettings, settings);
|
|
26
|
+
this.css = this.runtime.MasterCSS.create({
|
|
27
|
+
manifest: this.settings.manifest || this.runtime.defaultManifest,
|
|
28
|
+
nativeDeclarationMatcher: this.runtime.nativeDeclarationMatcher
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
getCompletionIndex() {
|
|
32
|
+
this.completionIndex ??= createCompletionIndex(this.css, this.runtime);
|
|
33
|
+
return this.completionIndex;
|
|
34
|
+
}
|
|
35
|
+
inspectSyntax(...params) {
|
|
36
|
+
if (this.settings.inspectSyntax && this.isDocumentAccepted(params[0])) return inspectSyntax?.call(this, ...params);
|
|
37
|
+
}
|
|
38
|
+
renderSyntaxColors(...params) {
|
|
39
|
+
if (this.settings.renderSyntaxColors && this.isDocumentAccepted(params[0])) return renderSyntaxColors?.call(this, ...params);
|
|
40
|
+
}
|
|
41
|
+
editSyntaxColors(...params) {
|
|
42
|
+
if (this.settings.editSyntaxColors && this.isDocumentAccepted(params[0])) return editSyntaxColors?.call(this, ...params);
|
|
43
|
+
}
|
|
44
|
+
formatDirectives(...params) {
|
|
45
|
+
if (this.settings.formatDirectives && this.isDocumentAccepted(params[0])) return formatDirectives?.call(this, ...params);
|
|
46
|
+
}
|
|
47
|
+
renderSemanticTokens(...params) {
|
|
48
|
+
if (this.isDocumentAccepted(params[0])) return renderSemanticTokens$1?.call(this, ...params);
|
|
49
|
+
}
|
|
50
|
+
renderSemanticTokensAtPosition(...params) {
|
|
51
|
+
if (this.isDocumentAccepted(params[0])) return renderSemanticTokensAtPosition$1?.call(this, ...params);
|
|
52
|
+
}
|
|
53
|
+
suggestSyntax(document, position, context) {
|
|
54
|
+
if (this.settings.suggestSyntax && this.isDocumentAccepted(document)) return suggestSyntax?.call(this, document, position, context, this.getCompletionIndex());
|
|
55
|
+
}
|
|
56
|
+
getClassPositions(textDocument) {
|
|
57
|
+
return getClassPositions(textDocument, this.settings, { cache: this.classPositionCache });
|
|
58
|
+
}
|
|
59
|
+
getClassPosition(textDocument, position) {
|
|
60
|
+
const cachedOxcClassPosition = getClassPositions(textDocument, this.settings, {
|
|
61
|
+
position,
|
|
62
|
+
includeEmpty: true,
|
|
63
|
+
provider: "oxc",
|
|
64
|
+
oxcMode: "cache-only",
|
|
65
|
+
cache: this.classPositionCache
|
|
66
|
+
})[0];
|
|
67
|
+
if (cachedOxcClassPosition) return cachedOxcClassPosition;
|
|
68
|
+
const regexClassPosition = getClassPositions(textDocument, this.settings, {
|
|
69
|
+
position,
|
|
70
|
+
includeEmpty: true,
|
|
71
|
+
provider: "regex"
|
|
72
|
+
})[0];
|
|
73
|
+
if (regexClassPosition && !regexClassPosition.raw.includes("${")) return regexClassPosition;
|
|
74
|
+
return getClassPositions(textDocument, this.settings, {
|
|
75
|
+
position,
|
|
76
|
+
includeEmpty: true,
|
|
77
|
+
provider: "oxc",
|
|
78
|
+
cache: this.classPositionCache
|
|
79
|
+
})[0] ?? regexClassPosition;
|
|
80
|
+
}
|
|
81
|
+
getClassContextPositions(textDocument, position) {
|
|
82
|
+
const cachedOxcClassPositions = getClassPositions(textDocument, this.settings, {
|
|
83
|
+
position,
|
|
84
|
+
provider: "oxc",
|
|
85
|
+
oxcMode: "cache-only",
|
|
86
|
+
positionMatch: "context",
|
|
87
|
+
cache: this.classPositionCache
|
|
88
|
+
});
|
|
89
|
+
if (cachedOxcClassPositions.length) return cachedOxcClassPositions;
|
|
90
|
+
const regexClassPositions = getClassPositions(textDocument, this.settings, {
|
|
91
|
+
position,
|
|
92
|
+
provider: "regex",
|
|
93
|
+
positionMatch: "context"
|
|
94
|
+
});
|
|
95
|
+
if (regexClassPositions.length && regexClassPositions.every(({ raw }) => !raw.includes("${"))) return regexClassPositions;
|
|
96
|
+
const oxcClassPositions = getClassPositions(textDocument, this.settings, {
|
|
97
|
+
position,
|
|
98
|
+
provider: "oxc",
|
|
99
|
+
positionMatch: "context",
|
|
100
|
+
cache: this.classPositionCache
|
|
101
|
+
});
|
|
102
|
+
return oxcClassPositions.length ? oxcClassPositions : regexClassPositions;
|
|
103
|
+
}
|
|
104
|
+
isDocumentAccepted(doc) {
|
|
105
|
+
if (!this.settings.exclude) return true;
|
|
106
|
+
for (const exclude of this.settings.exclude) if (minimatch(doc.uri, exclude)) return false;
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
//#endregion
|
|
111
|
+
export { CSSLanguageService as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ColorPresentation, ColorPresentationParams } from "vscode-languageserver-protocol";
|
|
2
|
+
import { TextDocument } from "vscode-languageserver-textdocument";
|
|
3
|
+
import CSSLanguageService from "../core.js";
|
|
4
|
+
|
|
5
|
+
//#region src/features/edit-syntax-colors.d.ts
|
|
6
|
+
declare function editSyntaxColors(this: CSSLanguageService, document: TextDocument, color: ColorPresentationParams['color'], range: ColorPresentationParams['range']): ColorPresentation[];
|
|
7
|
+
//#endregion
|
|
8
|
+
export { editSyntaxColors as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import convertColorByToken from "../utils/convert-color-token.js";
|
|
2
|
+
//#region src/features/edit-syntax-colors.ts
|
|
3
|
+
function editSyntaxColors(document, color, range) {
|
|
4
|
+
const colorPresentations = [];
|
|
5
|
+
const targetColorToken = convertColorByToken(color, document.getText(range), this.css);
|
|
6
|
+
if (targetColorToken) colorPresentations.push({
|
|
7
|
+
label: targetColorToken,
|
|
8
|
+
textEdit: {
|
|
9
|
+
range,
|
|
10
|
+
newText: targetColorToken
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
return colorPresentations;
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { editSyntaxColors as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Range, TextEdit } from "vscode-languageserver-protocol";
|
|
2
|
+
import { TextDocument } from "vscode-languageserver-textdocument";
|
|
3
|
+
|
|
4
|
+
//#region src/features/format-directives.d.ts
|
|
5
|
+
declare function formatDirectives(document: TextDocument, range?: Range): TextEdit[] | undefined;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { formatDirectives as default };
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { formatMasterCSSDirectives } from "@master/css-language";
|
|
2
|
+
//#region src/features/format-directives.ts
|
|
3
|
+
const CSS_FORMAT_LANGUAGE_IDS = /* @__PURE__ */ new Set([
|
|
4
|
+
"css",
|
|
5
|
+
"scss",
|
|
6
|
+
"less"
|
|
7
|
+
]);
|
|
8
|
+
const SFC_FORMAT_LANGUAGE_IDS = /* @__PURE__ */ new Set([
|
|
9
|
+
"vue",
|
|
10
|
+
"svelte",
|
|
11
|
+
"astro"
|
|
12
|
+
]);
|
|
13
|
+
const STYLE_BLOCK_RE = /<style\b([^>]*)>([\s\S]*?)<\/style>/gi;
|
|
14
|
+
function getSFCStyleLanguage(attributes) {
|
|
15
|
+
const match = /\blang\s*=\s*(?:"([^"]+)"|'([^']+)'|([^\s>]+))/i.exec(attributes);
|
|
16
|
+
return (match?.[1] || match?.[2] || match?.[3] || "css").toLowerCase();
|
|
17
|
+
}
|
|
18
|
+
function toOffsetRange(document, range) {
|
|
19
|
+
if (!range) return;
|
|
20
|
+
return {
|
|
21
|
+
start: document.offsetAt(range.start),
|
|
22
|
+
end: document.offsetAt(range.end)
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function intersects(a, b) {
|
|
26
|
+
return a.start < b.end && b.start < a.end;
|
|
27
|
+
}
|
|
28
|
+
function toTextEdit(document, edit) {
|
|
29
|
+
return {
|
|
30
|
+
range: {
|
|
31
|
+
start: document.positionAt(edit.start),
|
|
32
|
+
end: document.positionAt(edit.end)
|
|
33
|
+
},
|
|
34
|
+
newText: edit.newText
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function collectCSSDocumentFormatEdits(document, range) {
|
|
38
|
+
return formatMasterCSSDirectives(document.getText(), { range: toOffsetRange(document, range) }).map(toTextEdit.bind(void 0, document));
|
|
39
|
+
}
|
|
40
|
+
function collectSFCFormatEdits(document, range) {
|
|
41
|
+
const source = document.getText();
|
|
42
|
+
const offsetRange = toOffsetRange(document, range);
|
|
43
|
+
const edits = [];
|
|
44
|
+
STYLE_BLOCK_RE.lastIndex = 0;
|
|
45
|
+
for (const match of source.matchAll(STYLE_BLOCK_RE)) {
|
|
46
|
+
const styleLanguage = getSFCStyleLanguage(match[1]);
|
|
47
|
+
if (!CSS_FORMAT_LANGUAGE_IDS.has(styleLanguage)) continue;
|
|
48
|
+
const styleText = match[2];
|
|
49
|
+
const styleStart = (match.index || 0) + match[0].indexOf(styleText);
|
|
50
|
+
const styleEnd = styleStart + styleText.length;
|
|
51
|
+
if (offsetRange && !intersects(offsetRange, {
|
|
52
|
+
start: styleStart,
|
|
53
|
+
end: styleEnd
|
|
54
|
+
})) continue;
|
|
55
|
+
const relativeRange = offsetRange ? {
|
|
56
|
+
start: Math.max(offsetRange.start, styleStart) - styleStart,
|
|
57
|
+
end: Math.min(offsetRange.end, styleEnd) - styleStart
|
|
58
|
+
} : void 0;
|
|
59
|
+
for (const edit of formatMasterCSSDirectives(styleText, { range: relativeRange })) edits.push({
|
|
60
|
+
start: styleStart + edit.start,
|
|
61
|
+
end: styleStart + edit.end,
|
|
62
|
+
newText: edit.newText
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return edits.map(toTextEdit.bind(void 0, document));
|
|
66
|
+
}
|
|
67
|
+
function formatDirectives(document, range) {
|
|
68
|
+
if (CSS_FORMAT_LANGUAGE_IDS.has(document.languageId)) return collectCSSDocumentFormatEdits(document, range);
|
|
69
|
+
if (SFC_FORMAT_LANGUAGE_IDS.has(document.languageId)) return collectSFCFormatEdits(document, range);
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
export { formatDirectives as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Hover, HoverParams } from "vscode-languageserver-protocol";
|
|
2
|
+
import { TextDocument } from "vscode-languageserver-textdocument";
|
|
3
|
+
import CSSLanguageService from "../core.js";
|
|
4
|
+
|
|
5
|
+
//#region src/features/inspect-syntax.d.ts
|
|
6
|
+
declare function inspectSyntax(this: CSSLanguageService, document: TextDocument, position: HoverParams['position']): Hover | undefined;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { inspectSyntax as default };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import createCSSMarkdownDocumentation from "../utils/create-css-markdown-documentation.js";
|
|
2
|
+
import { generateCSS } from "@master/css-language";
|
|
3
|
+
//#region src/features/inspect-syntax.ts
|
|
4
|
+
function inspectSyntax(document, position) {
|
|
5
|
+
const classPosition = this.getClassPosition(document, position);
|
|
6
|
+
if (!classPosition) return;
|
|
7
|
+
const { token } = classPosition;
|
|
8
|
+
const range = {
|
|
9
|
+
start: document.positionAt(classPosition.range.start),
|
|
10
|
+
end: document.positionAt(classPosition.range.end)
|
|
11
|
+
};
|
|
12
|
+
const utilities = this.css.generate(token);
|
|
13
|
+
if (utilities.find((utility) => utility.type === this.runtime.UtilityType.Semantic && utility.layerName === "components")) {
|
|
14
|
+
const documentation = createCSSMarkdownDocumentation(generateCSS([token], this.css, this.runtime));
|
|
15
|
+
if (documentation) return { contents: {
|
|
16
|
+
kind: documentation.kind,
|
|
17
|
+
value: `(components) ` + documentation.value
|
|
18
|
+
} };
|
|
19
|
+
} else {
|
|
20
|
+
const utility = utilities[0];
|
|
21
|
+
if (utility) if (utility.type === this.runtime.UtilityType.Semantic) {
|
|
22
|
+
const documentation = createCSSMarkdownDocumentation(generateCSS([token], this.css, this.runtime));
|
|
23
|
+
if (documentation) return {
|
|
24
|
+
contents: documentation,
|
|
25
|
+
range
|
|
26
|
+
};
|
|
27
|
+
} else {
|
|
28
|
+
const documentation = createCSSMarkdownDocumentation(generateCSS([token], this.css, this.runtime));
|
|
29
|
+
if (documentation) return {
|
|
30
|
+
contents: documentation,
|
|
31
|
+
range
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { inspectSyntax as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SemanticTokens } from "vscode-languageserver-protocol";
|
|
2
|
+
import { TextDocument } from "vscode-languageserver-textdocument";
|
|
3
|
+
import CSSLanguageService from "../core.js";
|
|
4
|
+
|
|
5
|
+
//#region src/features/render-semantic-tokens.d.ts
|
|
6
|
+
declare function renderSemanticTokensAtPosition(this: CSSLanguageService, document: TextDocument, position: Parameters<CSSLanguageService['getClassPosition']>[1]): SemanticTokens | undefined;
|
|
7
|
+
declare function renderSemanticTokens(this: CSSLanguageService, document: TextDocument): SemanticTokens | undefined;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { renderSemanticTokens as default, renderSemanticTokensAtPosition };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { renderSemanticTokens as renderSemanticTokens$1, renderSemanticTokensAtPosition as renderSemanticTokensAtPosition$1 } from "@master/css-language";
|
|
2
|
+
//#region src/features/render-semantic-tokens.ts
|
|
3
|
+
function renderSemanticTokensAtPosition(document, position) {
|
|
4
|
+
return renderSemanticTokensAtPosition$1(this.css, document, this.getClassContextPositions(document, position), position, this.settings);
|
|
5
|
+
}
|
|
6
|
+
function renderSemanticTokens(document) {
|
|
7
|
+
return renderSemanticTokens$1(this.css, document, this.getClassPositions(document), this.settings);
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { renderSemanticTokens as default, renderSemanticTokensAtPosition };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ColorInformation } from "vscode-languageserver-protocol";
|
|
2
|
+
import { TextDocument } from "vscode-languageserver-textdocument";
|
|
3
|
+
import CSSLanguageService from "../core.js";
|
|
4
|
+
|
|
5
|
+
//#region src/features/render-syntax-colors.d.ts
|
|
6
|
+
declare function renderSyntaxColors(this: CSSLanguageService, document: TextDocument): Promise<ColorInformation[] | undefined>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { renderSyntaxColors as default };
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { instancePattern } from "../utils/regex.js";
|
|
2
|
+
import Color from "colorjs.io";
|
|
3
|
+
//#region src/features/render-syntax-colors.ts
|
|
4
|
+
function resolveVariableColorValue(variable, variables) {
|
|
5
|
+
let current = variable;
|
|
6
|
+
for (let i = 0; i < 8; i++) {
|
|
7
|
+
const value = current?.value;
|
|
8
|
+
if (value === void 0) return;
|
|
9
|
+
const text = String(value);
|
|
10
|
+
const alias = /^\$([a-zA-Z0-9-]+)(?: ?\/ ?.+?)?$|^var\(--([_a-zA-Z0-9-]+)\)$/.exec(text);
|
|
11
|
+
const aliasName = alias?.[1] ?? alias?.[2];
|
|
12
|
+
if (!aliasName) return text;
|
|
13
|
+
current = variables.get(aliasName);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
async function renderSyntaxColors(document) {
|
|
17
|
+
const text = document.getText() ?? "";
|
|
18
|
+
const colorInformations = [];
|
|
19
|
+
try {
|
|
20
|
+
for (const instanceMatch of text.matchAll(instancePattern)) {
|
|
21
|
+
if (instanceMatch.index === void 0) break;
|
|
22
|
+
const instanceStartIndex = instanceMatch.index;
|
|
23
|
+
const syntax = instanceMatch[0];
|
|
24
|
+
const rule = this.css.generate(syntax)[0];
|
|
25
|
+
if (rule && rule.type !== this.runtime.UtilityType.Semantic) {
|
|
26
|
+
const keyTokenLength = rule.keyToken?.length ?? 0;
|
|
27
|
+
let currentLength = 0;
|
|
28
|
+
const resolveValueComponent = (valueComponent) => {
|
|
29
|
+
if (valueComponent.text === void 0) return;
|
|
30
|
+
const startOffset = instanceStartIndex + keyTokenLength + currentLength;
|
|
31
|
+
const valueComponentTokenLength = valueComponent.token.length;
|
|
32
|
+
let color;
|
|
33
|
+
switch (valueComponent.type) {
|
|
34
|
+
case "function":
|
|
35
|
+
if ([
|
|
36
|
+
"rgb",
|
|
37
|
+
"rgba",
|
|
38
|
+
"hsl",
|
|
39
|
+
"hsla",
|
|
40
|
+
"hwb",
|
|
41
|
+
"lab",
|
|
42
|
+
"lch",
|
|
43
|
+
"oklab",
|
|
44
|
+
"oklch",
|
|
45
|
+
"color"
|
|
46
|
+
].includes(valueComponent.name)) color = new Color(valueComponent.text);
|
|
47
|
+
else if (valueComponent.children.length) {
|
|
48
|
+
currentLength += valueComponent.name.length + 1;
|
|
49
|
+
valueComponent.children.forEach(resolveValueComponent);
|
|
50
|
+
}
|
|
51
|
+
break;
|
|
52
|
+
case "variable":
|
|
53
|
+
if (valueComponent.variable?.namespace?.startsWith("color") && valueComponent.variable.value !== void 0) {
|
|
54
|
+
color = new Color(resolveVariableColorValue(valueComponent.variable, this.css.variables) || String(valueComponent.variable.value));
|
|
55
|
+
if (valueComponent.alpha !== void 0) color.alpha *= valueComponent.alpha;
|
|
56
|
+
}
|
|
57
|
+
break;
|
|
58
|
+
case "string":
|
|
59
|
+
if (valueComponent.text !== "#" && valueComponent.text?.startsWith("#")) color = new Color(valueComponent.text);
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
if (color) {
|
|
63
|
+
const rgbaColor = color.to("srgb");
|
|
64
|
+
colorInformations.push({
|
|
65
|
+
range: {
|
|
66
|
+
start: document.positionAt(startOffset),
|
|
67
|
+
end: document.positionAt(startOffset + valueComponentTokenLength)
|
|
68
|
+
},
|
|
69
|
+
color: {
|
|
70
|
+
red: rgbaColor.r ?? 0,
|
|
71
|
+
green: rgbaColor.g ?? 0,
|
|
72
|
+
blue: rgbaColor.b ?? 0,
|
|
73
|
+
alpha: Number(rgbaColor.alpha)
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
currentLength += valueComponentTokenLength || 0;
|
|
78
|
+
};
|
|
79
|
+
rule.valueComponents.forEach(resolveValueComponent);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
} catch (e) {}
|
|
83
|
+
const colorIndexSet = /* @__PURE__ */ new Set();
|
|
84
|
+
return colorInformations.filter((item) => {
|
|
85
|
+
if (colorIndexSet.has(item.range.start)) return false;
|
|
86
|
+
else {
|
|
87
|
+
colorIndexSet.add(item.range.start);
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
//#endregion
|
|
93
|
+
export { renderSyntaxColors as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CompletionItem, CompletionParams } from "vscode-languageserver-protocol";
|
|
2
|
+
import { TextDocument } from "vscode-languageserver-textdocument";
|
|
3
|
+
import CSSLanguageService from "../core.js";
|
|
4
|
+
import { CompletionIndex } from "../utils/completion-index.js";
|
|
5
|
+
|
|
6
|
+
//#region src/features/suggest-syntax.d.ts
|
|
7
|
+
declare function suggestSyntax(this: CSSLanguageService, document: TextDocument, position: CompletionParams['position'], context: CompletionParams['context'], completionIndex?: CompletionIndex): CompletionItem[] | undefined;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { suggestSyntax as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import querySyntaxCompletions from "../utils/query-syntax-completions.js";
|
|
2
|
+
//#region src/features/suggest-syntax.ts
|
|
3
|
+
function suggestSyntax(document, position, context, completionIndex) {
|
|
4
|
+
const classPosition = this.getClassPosition(document, position);
|
|
5
|
+
if (classPosition !== void 0) return querySyntaxCompletions(context?.triggerCharacter === " " ? "" : document.getText({
|
|
6
|
+
start: document.positionAt(classPosition.range.start),
|
|
7
|
+
end: position
|
|
8
|
+
}), this.css, completionIndex);
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { suggestSyntax as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import settings, { Settings } from "./settings.js";
|
|
2
|
+
import inspectSyntax from "./features/inspect-syntax.js";
|
|
3
|
+
import renderSyntaxColors from "./features/render-syntax-colors.js";
|
|
4
|
+
import editSyntaxColors from "./features/edit-syntax-colors.js";
|
|
5
|
+
import suggestSyntax from "./features/suggest-syntax.js";
|
|
6
|
+
import CSSLanguageService, { CSSLanguageServiceOptions, default as core_default } from "./core.js";
|
|
7
|
+
export * from "./common.js";
|
|
8
|
+
export { CSSLanguageService, type CSSLanguageServiceOptions, type Settings, core_default as default, editSyntaxColors, inspectSyntax, renderSyntaxColors, settings, suggestSyntax };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AT_TRIGGER_CHARACTER, DECLARATION_SEPARATOR_TRIGGER_CHARACTER, GROUP_TRIGGER_CHARACTER, INVOKED_TRIGGER_CHARACTERS, QUERY_TRIGGER_CHARACTERS, SELECTOR_TRIGGER_CHARACTERS, VALUE_TRIGGER_CHARACTERS } from "./common.js";
|
|
2
|
+
import settings from "./settings.js";
|
|
3
|
+
import inspectSyntax from "./features/inspect-syntax.js";
|
|
4
|
+
import renderSyntaxColors from "./features/render-syntax-colors.js";
|
|
5
|
+
import editSyntaxColors from "./features/edit-syntax-colors.js";
|
|
6
|
+
import suggestSyntax from "./features/suggest-syntax.js";
|
|
7
|
+
import CSSLanguageService from "./core.js";
|
|
8
|
+
export { AT_TRIGGER_CHARACTER, CSSLanguageService, DECLARATION_SEPARATOR_TRIGGER_CHARACTER, GROUP_TRIGGER_CHARACTER, INVOKED_TRIGGER_CHARACTERS, QUERY_TRIGGER_CHARACTERS, SELECTOR_TRIGGER_CHARACTERS, VALUE_TRIGGER_CHARACTERS, CSSLanguageService as default, editSyntaxColors, inspectSyntax, renderSyntaxColors, settings, suggestSyntax };
|