dot-language-support 2.0.0 → 2.0.2

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.
@@ -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) {
@@ -1,6 +1,6 @@
1
1
  import type * as lst from "vscode-languageserver-types";
2
+ import type { ColorInformation, Color, ColorPresentation } from "vscode-languageserver-types";
2
3
  import type { TextDocument } from "vscode-languageserver-textdocument";
3
- import { ColorInformation, Color, ColorPresentation } from "./polyfill.js";
4
4
  import { SourceFile, Omit } from "../types.js";
5
5
  export interface DocumentLike {
6
6
  positionAt(offset: number): lst.Position;
@@ -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;
@@ -8,14 +8,9 @@ export function getDocumentColors(doc, sourceFile) {
8
8
  : undefined;
9
9
  }
10
10
  export function getColorRepresentations(_doc, _sourceFile, color, range) {
11
- if (!color || !range)
12
- return undefined;
13
- const hexColor = getColorStringFromColor(color);
14
- return [
15
- {
16
- label: '"' + hexColor + '"',
17
- }
18
- ];
11
+ return !color || !range
12
+ ? undefined
13
+ : [{ label: '"' + getColorStringFromColor(color) + '"', }];
19
14
  }
20
15
  function colorTableToColorInformation(doc, sf, colors) {
21
16
  if (!colors || colors.size === 0)
@@ -1,6 +1,6 @@
1
1
  import type * as lst from "vscode-languageserver-types";
2
+ import type { ColorInformation, Color, ColorPresentation } from "vscode-languageserver-types";
2
3
  import type { TextDocument } from "vscode-languageserver-textdocument";
3
- import { ColorInformation, Color, ColorPresentation } from "./polyfill.js";
4
4
  import { SourceFile, Omit } from "../types.js";
5
5
  export interface DocumentLike {
6
6
  positionAt(offset: number): lst.Position;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dot-language-support",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "Parser and language service for graphviz (dot) files",
5
5
  "author": "Niklas Mollenhauer",
6
6
  "license": "MIT",
@@ -36,7 +36,6 @@
36
36
  "jest": "^28.0.3",
37
37
  "rimraf": "^3.0.2",
38
38
  "ts-jest": "^28.0.1",
39
- "ts-node": "^10.7.0",
40
39
  "typescript": "^4.6.4"
41
40
  },
42
41
  "engines": {
@@ -1,16 +0,0 @@
1
- import type { Range, TextEdit } from "vscode-languageserver-types";
2
- export interface ColorInformation {
3
- range: Range;
4
- color: Color;
5
- }
6
- export interface Color {
7
- readonly red: number;
8
- readonly green: number;
9
- readonly blue: number;
10
- readonly alpha: number;
11
- }
12
- export interface ColorPresentation {
13
- label: string;
14
- textEdit?: TextEdit;
15
- additionalTextEdits?: TextEdit[];
16
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=polyfill.js.map
@@ -1,16 +0,0 @@
1
- import type { Range, TextEdit } from "vscode-languageserver-types";
2
- export interface ColorInformation {
3
- range: Range;
4
- color: Color;
5
- }
6
- export interface Color {
7
- readonly red: number;
8
- readonly green: number;
9
- readonly blue: number;
10
- readonly alpha: number;
11
- }
12
- export interface ColorPresentation {
13
- label: string;
14
- textEdit?: TextEdit;
15
- additionalTextEdits?: TextEdit[];
16
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=polyfill.js.map