UNPKG

5.61 kBTypeScriptView Raw
1import * as code from 'vscode';
2import * as proto from 'vscode-languageserver-protocol';
3export interface FileFormattingOptions {
4 trimTrailingWhitespace?: boolean;
5 trimFinalNewlines?: boolean;
6 insertFinalNewline?: boolean;
7}
8export interface Converter {
9 asUri(uri: code.Uri): string;
10 asTextDocumentItem(textDocument: code.TextDocument): proto.TextDocumentItem;
11 asTextDocumentIdentifier(textDocument: code.TextDocument): proto.TextDocumentIdentifier;
12 asVersionedTextDocumentIdentifier(textDocument: code.TextDocument): proto.VersionedTextDocumentIdentifier;
13 asOpenTextDocumentParams(textDocument: code.TextDocument): proto.DidOpenTextDocumentParams;
14 asChangeTextDocumentParams(textDocument: code.TextDocument): proto.DidChangeTextDocumentParams;
15 asChangeTextDocumentParams(event: code.TextDocumentChangeEvent, uri: code.Uri, version: number): proto.DidChangeTextDocumentParams;
16 asCloseTextDocumentParams(textDocument: code.TextDocument): proto.DidCloseTextDocumentParams;
17 asSaveTextDocumentParams(textDocument: code.TextDocument, includeContent?: boolean): proto.DidSaveTextDocumentParams;
18 asWillSaveTextDocumentParams(event: code.TextDocumentWillSaveEvent): proto.WillSaveTextDocumentParams;
19 asDidCreateFilesParams(event: code.FileCreateEvent): proto.CreateFilesParams;
20 asDidRenameFilesParams(event: code.FileRenameEvent): proto.RenameFilesParams;
21 asDidDeleteFilesParams(event: code.FileDeleteEvent): proto.DeleteFilesParams;
22 asWillCreateFilesParams(event: code.FileCreateEvent): proto.CreateFilesParams;
23 asWillRenameFilesParams(event: code.FileRenameEvent): proto.RenameFilesParams;
24 asWillDeleteFilesParams(event: code.FileDeleteEvent): proto.DeleteFilesParams;
25 asTextDocumentPositionParams(textDocument: code.TextDocument, position: code.Position): proto.TextDocumentPositionParams;
26 asCompletionParams(textDocument: code.TextDocument, position: code.Position, context: code.CompletionContext): proto.CompletionParams;
27 asSignatureHelpParams(textDocument: code.TextDocument, position: code.Position, context: code.SignatureHelpContext): proto.SignatureHelpParams;
28 asWorkerPosition(position: code.Position): proto.Position;
29 asPosition(value: null): null;
30 asPosition(value: undefined): undefined;
31 asPosition(value: code.Position): proto.Position;
32 asPosition(value: code.Position | undefined | null): proto.Position | undefined | null;
33 asPositions(value: readonly code.Position[], token?: code.CancellationToken): Promise<proto.Position[]>;
34 asPositionsSync(value: readonly code.Position[], token?: code.CancellationToken): proto.Position[];
35 asRange(value: null): null;
36 asRange(value: undefined): undefined;
37 asRange(value: code.Range): proto.Range;
38 asRange(value: code.Range | undefined | null): proto.Range | undefined | null;
39 asRanges(values: readonly code.Range[]): proto.Range[];
40 asLocation(value: null): null;
41 asLocation(value: undefined): undefined;
42 asLocation(value: code.Location): proto.Location;
43 asLocation(value: code.Location | undefined | null): proto.Location | undefined | null;
44 asDiagnosticSeverity(value: code.DiagnosticSeverity): number;
45 asDiagnosticTag(value: code.DiagnosticTag): number | undefined;
46 asDiagnostic(item: code.Diagnostic): proto.Diagnostic;
47 asDiagnostics(items: code.Diagnostic[], token?: code.CancellationToken): Promise<proto.Diagnostic[]>;
48 asDiagnosticsSync(items: code.Diagnostic[]): proto.Diagnostic[];
49 asCompletionItem(item: code.CompletionItem, labelDetailsSupport?: boolean): proto.CompletionItem;
50 asSymbolKind(item: code.SymbolKind): proto.SymbolKind;
51 asSymbolTag(item: code.SymbolTag): proto.SymbolTag;
52 asSymbolTags(items: ReadonlyArray<code.SymbolTag>): proto.SymbolTag[];
53 asTextEdit(edit: code.TextEdit): proto.TextEdit;
54 asReferenceParams(textDocument: code.TextDocument, position: code.Position, options: {
55 includeDeclaration: boolean;
56 }): proto.ReferenceParams;
57 asCodeAction(item: code.CodeAction, token?: code.CancellationToken): Promise<proto.CodeAction>;
58 asCodeActionSync(item: code.CodeAction): proto.CodeAction;
59 asCodeActionContext(context: code.CodeActionContext, token?: code.CancellationToken): Promise<proto.CodeActionContext>;
60 asCodeActionContextSync(context: code.CodeActionContext): proto.CodeActionContext;
61 asInlineValueContext(context: code.InlineValueContext): proto.InlineValueContext;
62 asCommand(item: code.Command): proto.Command;
63 asCodeLens(item: code.CodeLens): proto.CodeLens;
64 asFormattingOptions(options: code.FormattingOptions, fileOptions: FileFormattingOptions): proto.FormattingOptions;
65 asDocumentSymbolParams(textDocument: code.TextDocument): proto.DocumentSymbolParams;
66 asCodeLensParams(textDocument: code.TextDocument): proto.CodeLensParams;
67 asDocumentLink(item: code.DocumentLink): proto.DocumentLink;
68 asDocumentLinkParams(textDocument: code.TextDocument): proto.DocumentLinkParams;
69 asCallHierarchyItem(value: code.CallHierarchyItem): proto.CallHierarchyItem;
70 asTypeHierarchyItem(value: code.TypeHierarchyItem): proto.TypeHierarchyItem;
71 asWorkspaceSymbol(item: code.SymbolInformation): proto.WorkspaceSymbol;
72 asInlayHint(value: code.InlayHint): proto.InlayHint;
73 asInlineCompletionParams(document: code.TextDocument, position: code.Position, context: code.InlineCompletionContext): proto.InlineCompletionParams;
74}
75export interface URIConverter {
76 (value: code.Uri): string;
77}
78export declare function createConverter(uriConverter?: URIConverter): Converter;