dot-language-support 1.6.1 → 1.6.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.
package/lib/error.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { ErrorCode } from "./types";
1
+ import type { ErrorCode } from "./types";
2
2
  export declare const diagnosicSource = "DOT";
3
3
  export declare function formatError(error: ErrorCode): string;
package/lib/index.d.ts CHANGED
@@ -3,4 +3,3 @@ export * from "./scanner";
3
3
  export * from "./parser";
4
4
  export * from "./visitor";
5
5
  export * from "./service/service";
6
- export * from "./service/interop";
package/lib/index.js CHANGED
@@ -19,5 +19,4 @@ __exportStar(require("./scanner"), exports);
19
19
  __exportStar(require("./parser"), exports);
20
20
  __exportStar(require("./visitor"), exports);
21
21
  __exportStar(require("./service/service"), exports);
22
- __exportStar(require("./service/interop"), exports);
23
22
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import * as lst from "vscode-languageserver-types";
1
+ import type * as lst from "vscode-languageserver-types";
2
2
  import { DocumentLike, SourceFile, CommandApplication } from "../";
3
3
  import { ExecutableCommand } from "./command/common";
4
4
  export declare function getCodeActions(doc: DocumentLike, sourceFile: SourceFile, range: lst.Range, context?: lst.CodeActionContext): lst.Command[] | undefined;
@@ -1,4 +1,4 @@
1
- import * as lst from "vscode-languageserver-types";
1
+ import type * as lst from "vscode-languageserver-types";
2
2
  import { ColorInformation, Color, ColorPresentation } from "./polyfill";
3
3
  import { SourceFile } from "../types";
4
4
  import { DocumentLike } from "../";
@@ -1,4 +1,4 @@
1
- import * as lst from "vscode-languageserver-types";
1
+ import type * as lst from "vscode-languageserver-types";
2
2
  import { SourceFile } from "../types";
3
3
  import { DocumentLike } from "../";
4
4
  export declare function hover(doc: DocumentLike, sourceFile: SourceFile, position: lst.Position): lst.Hover | undefined;
@@ -1,6 +1,6 @@
1
- import * as lst from "vscode-languageserver-types";
1
+ import type { Range, TextEdit } from "vscode-languageserver-types";
2
2
  export interface ColorInformation {
3
- range: lst.Range;
3
+ range: Range;
4
4
  color: Color;
5
5
  }
6
6
  export interface Color {
@@ -11,6 +11,6 @@ export interface Color {
11
11
  }
12
12
  export interface ColorPresentation {
13
13
  label: string;
14
- textEdit?: lst.TextEdit;
15
- additionalTextEdits?: lst.TextEdit[];
14
+ textEdit?: TextEdit;
15
+ additionalTextEdits?: TextEdit[];
16
16
  }
@@ -1,5 +1,5 @@
1
- import * as lst from "vscode-languageserver-types";
2
- import { SourceFile } from "../types";
3
- import { DocumentLike } from "../";
4
- export declare function findReferences(doc: DocumentLike, sourceFile: SourceFile, position: lst.Position, context: lst.ReferenceContext): lst.Location[];
5
- export declare function findDefinition(doc: DocumentLike, sourceFile: SourceFile, position: lst.Position): lst.Location | undefined;
1
+ import type { Position, ReferenceContext, Location } from "vscode-languageserver-types";
2
+ import type { SourceFile } from "../types";
3
+ import { type DocumentLike } from "../";
4
+ export declare function findReferences(doc: DocumentLike, sourceFile: SourceFile, position: Position, context: ReferenceContext): Location[];
5
+ export declare function findDefinition(doc: DocumentLike, sourceFile: SourceFile, position: Position): Location | undefined;
@@ -1,4 +1,4 @@
1
- import * as lst from "vscode-languageserver-types";
1
+ import { Position, WorkspaceEdit } from "vscode-languageserver-types";
2
2
  import { SourceFile } from "../types";
3
3
  import { DocumentLike } from "../";
4
- export declare function renameSymbol(doc: DocumentLike, sourceFile: SourceFile, position: lst.Position, newName: string): lst.WorkspaceEdit | undefined;
4
+ export declare function renameSymbol(doc: DocumentLike, sourceFile: SourceFile, position: Position, newName: string): WorkspaceEdit | undefined;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.renameSymbol = void 0;
4
- const lst = require("vscode-languageserver-types");
4
+ const vscode_languageserver_types_1 = require("vscode-languageserver-types");
5
5
  const types_1 = require("../types");
6
6
  const checker_1 = require("../checker");
7
7
  const __1 = require("../");
@@ -29,7 +29,7 @@ function renameSymbol(doc, sourceFile, position, newName) {
29
29
  const uri = doc.uri;
30
30
  const res = {
31
31
  changes: {
32
- [uri]: ranges.map(r => lst.TextEdit.replace(r, newName)),
32
+ [uri]: ranges.map(r => vscode_languageserver_types_1.TextEdit.replace(r, newName)),
33
33
  }
34
34
  };
35
35
  return res;
@@ -1,4 +1,5 @@
1
- import * as lst from "vscode-languageserver-types";
1
+ import type * as lst from "vscode-languageserver-types";
2
+ import type { TextDocument } from "vscode-languageserver-textdocument";
2
3
  import { ColorInformation, Color, ColorPresentation } from "./polyfill";
3
4
  import { SourceFile, Omit } from "../types";
4
5
  export interface DocumentLike {
@@ -11,7 +12,7 @@ export interface CommandApplication {
11
12
  edit: lst.WorkspaceEdit;
12
13
  }
13
14
  export interface LanguageService {
14
- parseDocument(doc: lst.TextDocument | string): SourceFile;
15
+ parseDocument(doc: TextDocument | string): SourceFile;
15
16
  validateDocument(doc: DocumentLike, sourceFile: SourceFile): lst.Diagnostic[];
16
17
  hover(doc: DocumentLike, sourceFile: SourceFile, position: lst.Position): lst.Hover | undefined;
17
18
  findReferences(doc: DocumentLike, sourceFile: SourceFile, position: lst.Position, context: lst.ReferenceContext): lst.Location[];
@@ -1,6 +1,6 @@
1
1
  import * as lst from "vscode-languageserver-types";
2
2
  import { SourceFile, SyntaxNode } from "../types";
3
- import { DocumentLike } from "../";
3
+ import type { DocumentLike } from "../";
4
4
  export declare function getStart(sourceFile: SourceFile, node: SyntaxNode): number;
5
5
  export declare function syntaxNodesToRanges(doc: DocumentLike, sourceFile: SourceFile, nodes: SyntaxNode[]): lst.Range[];
6
6
  export declare function syntaxNodeToRange(doc: DocumentLike, sourceFile: SourceFile, node: SyntaxNode): {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dot-language-support",
3
- "version": "1.6.1",
3
+ "version": "1.6.2",
4
4
  "description": "Parser and language service for graphviz (dot) files",
5
5
  "author": "Niklas Mollenhauer",
6
6
  "license": "MIT",
@@ -25,6 +25,7 @@
25
25
  "url": "https://github.com/nikeee/dot-language-support.git"
26
26
  },
27
27
  "dependencies": {
28
+ "vscode-languageserver-textdocument": "^1.0.4",
28
29
  "vscode-languageserver-types": "^3.16.0"
29
30
  },
30
31
  "devDependencies": {
@@ -1,15 +0,0 @@
1
- import * as lst from "vscode-languageserver-types";
2
- import { DiagnosticMessage } from "../types";
3
- import { DocumentLike } from "../";
4
- export interface IMarkerData {
5
- code?: string;
6
- severity: number;
7
- message: string;
8
- source?: string;
9
- startLineNumber: number;
10
- startColumn: number;
11
- endLineNumber: number;
12
- endColumn: number;
13
- }
14
- export declare function getDiagnosticMarkerData(doc: DocumentLike, source: DiagnosticMessage): IMarkerData;
15
- export declare function getMarkerDataDiagnostic(m: IMarkerData): lst.Diagnostic;
@@ -1,56 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getMarkerDataDiagnostic = exports.getDiagnosticMarkerData = void 0;
4
- const lst = require("vscode-languageserver-types");
5
- const types_1 = require("../types");
6
- function getDiagnosticMarkerData(doc, source) {
7
- const start = doc.positionAt(source.start);
8
- const end = doc.positionAt(source.end);
9
- return {
10
- message: source.message,
11
- severity: source.category ? convertToMonacoSeverity(source.category) : 0,
12
- startLineNumber: start.line,
13
- startColumn: start.character,
14
- endLineNumber: end.line,
15
- endColumn: end.character,
16
- };
17
- }
18
- exports.getDiagnosticMarkerData = getDiagnosticMarkerData;
19
- function getMarkerDataDiagnostic(m) {
20
- return {
21
- message: m.message,
22
- range: {
23
- start: {
24
- line: m.startLineNumber,
25
- character: m.startColumn,
26
- },
27
- end: {
28
- line: m.endLineNumber,
29
- character: m.endColumn,
30
- }
31
- },
32
- code: m.code,
33
- severity: m.severity ? convertToLspSeverity(m.severity) : types_1.DiagnosticCategory.Suggestion,
34
- source: m.source,
35
- };
36
- }
37
- exports.getMarkerDataDiagnostic = getMarkerDataDiagnostic;
38
- const lspToMonacoSeverityMap = {
39
- [lst.DiagnosticSeverity.Error]: 3,
40
- [lst.DiagnosticSeverity.Warning]: 2,
41
- [lst.DiagnosticSeverity.Information]: 1,
42
- [lst.DiagnosticSeverity.Hint]: 0,
43
- };
44
- const monacoToLspSeverityMap = {
45
- [3]: lst.DiagnosticSeverity.Error,
46
- [2]: lst.DiagnosticSeverity.Warning,
47
- [1]: lst.DiagnosticSeverity.Information,
48
- [0]: lst.DiagnosticSeverity.Hint,
49
- };
50
- function convertToMonacoSeverity(s) {
51
- return lspToMonacoSeverityMap[s];
52
- }
53
- function convertToLspSeverity(n) {
54
- return monacoToLspSeverityMap[n];
55
- }
56
- //# sourceMappingURL=interop.js.map