dot-language-support 2.0.0 → 2.0.5
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/.github/workflows/CD.yml +5 -6
- package/.github/workflows/CI.yml +5 -6
- package/README.md +0 -2
- package/lib/cjs/service/colorProvider.d.ts +2 -3
- package/lib/cjs/service/colorProvider.js +4 -9
- package/lib/cjs/service/languageFacts.d.ts +679 -679
- package/lib/cjs/service/service.d.ts +1 -1
- package/lib/esm/service/colorProvider.d.ts +2 -3
- package/lib/esm/service/colorProvider.js +4 -9
- package/lib/esm/service/languageFacts.d.ts +679 -679
- package/lib/esm/service/service.d.ts +1 -1
- package/package.json +7 -8
- package/lib/cjs/service/polyfill.d.ts +0 -16
- package/lib/cjs/service/polyfill.js +0 -3
- package/lib/esm/service/polyfill.d.ts +0 -16
- package/lib/esm/service/polyfill.js +0 -2
package/.github/workflows/CD.yml
CHANGED
|
@@ -9,25 +9,24 @@ on:
|
|
|
9
9
|
|
|
10
10
|
jobs:
|
|
11
11
|
build:
|
|
12
|
-
|
|
13
12
|
runs-on: ubuntu-latest
|
|
14
13
|
|
|
15
14
|
steps:
|
|
16
|
-
- uses: actions/checkout@
|
|
15
|
+
- uses: actions/checkout@v3
|
|
17
16
|
|
|
18
|
-
- name: Use Node.js 18
|
|
17
|
+
- name: Use Node.js 18
|
|
19
18
|
uses: actions/setup-node@v1
|
|
20
19
|
with:
|
|
21
|
-
node-version: 18
|
|
20
|
+
node-version: 18
|
|
22
21
|
|
|
23
|
-
- uses: actions/cache@
|
|
22
|
+
- uses: actions/cache@v3
|
|
24
23
|
with:
|
|
25
24
|
path: ~/.npm
|
|
26
25
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
27
26
|
restore-keys: |
|
|
28
27
|
${{ runner.os }}-node-
|
|
29
28
|
|
|
30
|
-
- run: npm ci
|
|
29
|
+
- run: npm ci --legacy-peer-deps
|
|
31
30
|
- run: npm run compile
|
|
32
31
|
- run: npm test
|
|
33
32
|
env:
|
package/.github/workflows/CI.yml
CHANGED
|
@@ -4,29 +4,28 @@ on: [push]
|
|
|
4
4
|
|
|
5
5
|
jobs:
|
|
6
6
|
build:
|
|
7
|
-
|
|
8
7
|
runs-on: ubuntu-latest
|
|
9
8
|
|
|
10
9
|
strategy:
|
|
11
10
|
matrix:
|
|
12
|
-
node-version: [
|
|
11
|
+
node-version: [16.x, 18.x]
|
|
13
12
|
|
|
14
13
|
steps:
|
|
15
|
-
- uses: actions/checkout@
|
|
14
|
+
- uses: actions/checkout@v3
|
|
16
15
|
|
|
17
16
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
18
|
-
uses: actions/setup-node@
|
|
17
|
+
uses: actions/setup-node@v3
|
|
19
18
|
with:
|
|
20
19
|
node-version: ${{ matrix.node-version }}
|
|
21
20
|
|
|
22
|
-
- uses: actions/cache@
|
|
21
|
+
- uses: actions/cache@v3
|
|
23
22
|
with:
|
|
24
23
|
path: ~/.npm
|
|
25
24
|
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
|
|
26
25
|
restore-keys: |
|
|
27
26
|
${{ runner.os }}-node-${{ matrix.node-version }}-
|
|
28
27
|
|
|
29
|
-
- run: npm ci
|
|
28
|
+
- run: npm ci --legacy-peer-deps
|
|
30
29
|
- run: npm run compile
|
|
31
30
|
- run: npm test
|
|
32
31
|
env:
|
package/README.md
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
# dot-language-support [](https://github.com/nikeee/dot-language-support/actions/workflows/CD.yml) [](https://github.com/nikeee/dot-language-support/actions/workflows/CI.yml)  [](https://www.npmjs.com/package/dot-language-support)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
3
|
A language service library, written in TypeScript. Used by [dot-language-server](https://github.com/nikeee/dot-language-server) and [edotor.net](https://edotor.net).
|
|
6
4
|
|
|
7
5
|
## Features
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { ColorInformation, Color, ColorPresentation } from "./polyfill.js";
|
|
1
|
+
import type { ColorInformation, ColorPresentation, Range, Color } from "vscode-languageserver-types";
|
|
3
2
|
import { SourceFile } from "../types.js";
|
|
4
3
|
import { DocumentLike } from "../index.js";
|
|
5
4
|
export declare function getDocumentColors(doc: DocumentLike, sourceFile: SourceFile): ColorInformation[] | undefined;
|
|
6
|
-
export declare function getColorRepresentations(_doc: DocumentLike, _sourceFile: SourceFile, color: Color, range:
|
|
5
|
+
export declare function getColorRepresentations(_doc: DocumentLike, _sourceFile: SourceFile, color: Color, range: Range): ColorPresentation[] | undefined;
|
|
@@ -35,14 +35,9 @@ function getDocumentColors(doc, sourceFile) {
|
|
|
35
35
|
}
|
|
36
36
|
exports.getDocumentColors = getDocumentColors;
|
|
37
37
|
function getColorRepresentations(_doc, _sourceFile, color, range) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return [
|
|
42
|
-
{
|
|
43
|
-
label: '"' + hexColor + '"',
|
|
44
|
-
}
|
|
45
|
-
];
|
|
38
|
+
return !color || !range
|
|
39
|
+
? undefined
|
|
40
|
+
: [{ label: '"' + getColorStringFromColor(color) + '"', }];
|
|
46
41
|
}
|
|
47
42
|
exports.getColorRepresentations = getColorRepresentations;
|
|
48
43
|
function colorTableToColorInformation(doc, sf, colors) {
|
|
@@ -65,7 +60,7 @@ function colorTableToColorInformation(doc, sf, colors) {
|
|
|
65
60
|
function getColorFromName(name) {
|
|
66
61
|
if (name.charAt(0) === "#")
|
|
67
62
|
return getHexCodeColor(name);
|
|
68
|
-
const colorAlias = colorMap[name];
|
|
63
|
+
const colorAlias = colorMap[name.toLowerCase()];
|
|
69
64
|
return colorAlias
|
|
70
65
|
? getHexCodeColor(colorAlias)
|
|
71
66
|
: undefined;
|