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.
@@ -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@v2
15
+ - uses: actions/checkout@v3
17
16
 
18
- - name: Use Node.js 18.x
17
+ - name: Use Node.js 18
19
18
  uses: actions/setup-node@v1
20
19
  with:
21
- node-version: 18.x
20
+ node-version: 18
22
21
 
23
- - uses: actions/cache@v2
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:
@@ -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: [14.x, 16.x, 18.x]
11
+ node-version: [16.x, 18.x]
13
12
 
14
13
  steps:
15
- - uses: actions/checkout@v2
14
+ - uses: actions/checkout@v3
16
15
 
17
16
  - name: Use Node.js ${{ matrix.node-version }}
18
- uses: actions/setup-node@v1
17
+ uses: actions/setup-node@v3
19
18
  with:
20
19
  node-version: ${{ matrix.node-version }}
21
20
 
22
- - uses: actions/cache@v2
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 [![CD](https://github.com/nikeee/dot-language-support/actions/workflows/CD.yml/badge.svg)](https://github.com/nikeee/dot-language-support/actions/workflows/CD.yml) [![CI](https://github.com/nikeee/dot-language-support/actions/workflows/CI.yml/badge.svg)](https://github.com/nikeee/dot-language-support/actions/workflows/CI.yml) ![Dependencies](https://img.shields.io/librariesio/release/npm/dot-language-support) [![npm version](https://img.shields.io/npm/v/dot-language-support)](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 * as lst from "vscode-languageserver-types";
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: lst.Range): ColorPresentation[] | undefined;
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
- if (!color || !range)
39
- return undefined;
40
- const hexColor = getColorStringFromColor(color);
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;