Skip to content

Commit 82a7ed0

Browse files
committed
types
1 parent 72df5f8 commit 82a7ed0

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

src/cm/lsp/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,13 @@ export type {
2121
ClientState,
2222
FileMetadata,
2323
FormattingOptions,
24+
LSPDiagnostic,
25+
LSPFormattingOptions,
2426
LspDiagnostic,
2527
LspServerDefinition,
28+
Position,
29+
Range,
30+
TextEdit,
2631
TransportDescriptor,
2732
TransportHandle,
2833
WorkspaceOptions,

src/cm/lsp/types.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ import type {
88
} from "@codemirror/lsp-client";
99
import type { ChangeSet, Extension, Text } from "@codemirror/state";
1010
import type { EditorView } from "@codemirror/view";
11+
import type {
12+
Diagnostic as LSPDiagnostic,
13+
FormattingOptions as LSPFormattingOptions,
14+
Position,
15+
Range,
16+
TextEdit,
17+
} from "vscode-languageserver-types";
1118

1219
export type {
1320
LSPClient,
@@ -16,6 +23,11 @@ export type {
1623
Transport,
1724
Workspace,
1825
WorkspaceFile,
26+
TextEdit,
27+
LSPFormattingOptions,
28+
LSPDiagnostic,
29+
Range,
30+
Position,
1931
};
2032

2133
export interface WorkspaceFileUpdate {
@@ -243,10 +255,7 @@ export interface PublishDiagnosticsParams {
243255
}
244256

245257
export interface RawDiagnostic {
246-
range: {
247-
start: { line: number; character: number };
248-
end: { line: number; character: number };
249-
};
258+
range: Range;
250259
severity?: number;
251260
code?: number | string;
252261
source?: string;
@@ -266,15 +275,6 @@ export interface AcodeApi {
266275
) => void;
267276
}
268277

269-
// LSP Text Edit
270-
export interface TextEdit {
271-
range: {
272-
start: { line: number; character: number };
273-
end: { line: number; character: number };
274-
};
275-
newText: string;
276-
}
277-
278278
/**
279279
* Uri utility interface
280280
*/

0 commit comments

Comments
 (0)