UNPKG

16.7 kBTypeScriptView Raw
1import * as code from 'vscode';
2import * as ls from 'vscode-languageserver-protocol';
3import ProtocolCompletionItem from './protocolCompletionItem';
4export interface Converter {
5 asUri(value: string): code.Uri;
6 asDocumentSelector(value: ls.DocumentSelector): code.DocumentSelector;
7 asPosition(value: undefined | null): undefined;
8 asPosition(value: ls.Position): code.Position;
9 asPosition(value: ls.Position | undefined | null): code.Position | undefined;
10 asRange(value: undefined | null): undefined;
11 asRange(value: ls.Range): code.Range;
12 asRange(value: ls.Range | undefined | null): code.Range | undefined;
13 asRanges(items: ReadonlyArray<ls.Range>, token?: code.CancellationToken): Promise<code.Range[]>;
14 asDiagnostic(diagnostic: ls.Diagnostic): code.Diagnostic;
15 asDiagnostics(diagnostics: ls.Diagnostic[], token?: code.CancellationToken): Promise<code.Diagnostic[]>;
16 asDiagnosticSeverity(value: number | undefined | null): code.DiagnosticSeverity;
17 asDiagnosticTag(tag: ls.DiagnosticTag): code.DiagnosticTag | undefined;
18 asHover(hover: undefined | null): undefined;
19 asHover(hover: ls.Hover): code.Hover;
20 asHover(hover: ls.Hover | undefined | null): code.Hover | undefined;
21 asCompletionResult(value: undefined | null, allCommitCharacters?: string[], token?: code.CancellationToken): Promise<undefined>;
22 asCompletionResult(value: ls.CompletionList, allCommitCharacters?: string[], token?: code.CancellationToken): Promise<code.CompletionList>;
23 asCompletionResult(value: ls.CompletionItem[], allCommitCharacters?: string[], token?: code.CancellationToken): Promise<code.CompletionItem[]>;
24 asCompletionResult(value: ls.CompletionItem[] | ls.CompletionList | undefined | null, allCommitCharacters?: string[], token?: code.CancellationToken): Promise<code.CompletionItem[] | code.CompletionList | undefined>;
25 asCompletionItem(item: ls.CompletionItem, defaultCommitCharacters?: string[]): ProtocolCompletionItem;
26 asTextEdit(edit: undefined | null): undefined;
27 asTextEdit(edit: ls.TextEdit): code.TextEdit;
28 asTextEdit(edit: ls.TextEdit | undefined | null): code.TextEdit | undefined;
29 asTextEdits(items: undefined | null, token?: code.CancellationToken): Promise<undefined>;
30 asTextEdits(items: ls.TextEdit[], token?: code.CancellationToken): Promise<code.TextEdit[]>;
31 asTextEdits(items: ls.TextEdit[] | undefined | null, token?: code.CancellationToken): Promise<code.TextEdit[] | undefined>;
32 asSignatureHelp(item: undefined | null, token?: code.CancellationToken): Promise<undefined>;
33 asSignatureHelp(item: ls.SignatureHelp, token?: code.CancellationToken): Promise<code.SignatureHelp>;
34 asSignatureHelp(item: ls.SignatureHelp | undefined | null, token?: code.CancellationToken): Promise<code.SignatureHelp | undefined>;
35 asSignatureInformation(item: ls.SignatureInformation, token?: code.CancellationToken): Promise<code.SignatureInformation>;
36 asSignatureInformations(items: ls.SignatureInformation[], token?: code.CancellationToken): Promise<code.SignatureInformation[]>;
37 asParameterInformation(item: ls.ParameterInformation): code.ParameterInformation;
38 asParameterInformations(item: ls.ParameterInformation[], token?: code.CancellationToken): Promise<code.ParameterInformation[]>;
39 asLocation(item: ls.Location): code.Location;
40 asLocation(item: undefined | null): undefined;
41 asLocation(item: ls.Location | undefined | null): code.Location | undefined;
42 asDeclarationResult(item: undefined | null, token?: code.CancellationToken): Promise<undefined>;
43 asDeclarationResult(item: ls.Declaration, token?: code.CancellationToken): Promise<code.Location | code.Location[]>;
44 asDeclarationResult(item: ls.DeclarationLink[], token?: code.CancellationToken): Promise<code.LocationLink[]>;
45 asDeclarationResult(item: ls.Declaration | ls.DeclarationLink[] | undefined | null, token?: code.CancellationToken): Promise<code.Declaration | undefined>;
46 asDefinitionResult(item: undefined | null, token?: code.CancellationToken): Promise<undefined>;
47 asDefinitionResult(item: ls.Definition, token?: code.CancellationToken): Promise<code.Definition>;
48 asDefinitionResult(item: ls.DefinitionLink[], token?: code.CancellationToken): Promise<code.DefinitionLink[]>;
49 asDefinitionResult(item: ls.Definition | ls.DefinitionLink[] | undefined | null, token?: code.CancellationToken): Promise<code.Definition | code.DefinitionLink[] | undefined>;
50 asReferences(values: undefined | null, token?: code.CancellationToken): Promise<undefined>;
51 asReferences(values: ls.Location[], token?: code.CancellationToken): Promise<code.Location[]>;
52 asReferences(values: ls.Location[] | undefined | null, token?: code.CancellationToken): Promise<code.Location[] | undefined>;
53 asDocumentHighlightKind(item: number): code.DocumentHighlightKind;
54 asDocumentHighlight(item: ls.DocumentHighlight): code.DocumentHighlight;
55 asDocumentHighlights(values: undefined | null, token?: code.CancellationToken): Promise<undefined>;
56 asDocumentHighlights(values: ls.DocumentHighlight[], token?: code.CancellationToken): Promise<code.DocumentHighlight[]>;
57 asDocumentHighlights(values: ls.DocumentHighlight[] | undefined | null, token?: code.CancellationToken): Promise<code.DocumentHighlight[] | undefined>;
58 asSymbolKind(item: ls.SymbolKind): code.SymbolKind;
59 asSymbolTag(item: ls.SymbolTag): code.SymbolTag | undefined;
60 asSymbolTags(items: undefined | null): undefined;
61 asSymbolTags(items: ReadonlyArray<ls.SymbolTag>): code.SymbolTag[];
62 asSymbolTags(items: ReadonlyArray<ls.SymbolTag> | undefined | null): code.SymbolTag[] | undefined;
63 asSymbolInformation(item: ls.SymbolInformation | ls.WorkspaceSymbol): code.SymbolInformation;
64 asSymbolInformations(values: undefined | null, token?: code.CancellationToken): Promise<undefined>;
65 asSymbolInformations(values: ls.SymbolInformation[] | ls.WorkspaceSymbol[], token?: code.CancellationToken): Promise<code.SymbolInformation[]>;
66 asSymbolInformations(values: ls.SymbolInformation[] | ls.WorkspaceSymbol[] | undefined | null, token?: code.CancellationToken): Promise<code.SymbolInformation[] | undefined>;
67 asDocumentSymbol(value: ls.DocumentSymbol, token?: code.CancellationToken): code.DocumentSymbol;
68 asDocumentSymbols(value: undefined | null, token?: code.CancellationToken): Promise<undefined>;
69 asDocumentSymbols(value: ls.DocumentSymbol[], token?: code.CancellationToken): Promise<code.DocumentSymbol[]>;
70 asDocumentSymbols(value: ls.DocumentSymbol[] | undefined | null, token?: code.CancellationToken): Promise<code.DocumentSymbol[] | undefined>;
71 asCommand(item: ls.Command): code.Command;
72 asCommands(items: undefined | null, token?: code.CancellationToken): Promise<undefined>;
73 asCommands(items: ls.Command[], token?: code.CancellationToken): Promise<code.Command[]>;
74 asCommands(items: ls.Command[] | undefined | null, token?: code.CancellationToken): Promise<code.Command[] | undefined>;
75 asCodeAction(item: undefined | null, token?: code.CancellationToken): Promise<undefined>;
76 asCodeAction(item: ls.CodeAction, token?: code.CancellationToken): Promise<code.CodeAction>;
77 asCodeAction(item: ls.CodeAction | undefined | null, token?: code.CancellationToken): Promise<code.CodeAction | undefined>;
78 asCodeActionKind(item: null | undefined): undefined;
79 asCodeActionKind(item: ls.CodeActionKind): code.CodeActionKind;
80 asCodeActionKind(item: ls.CodeActionKind | null | undefined): code.CodeActionKind | undefined;
81 asCodeActionKinds(item: null | undefined): undefined;
82 asCodeActionKinds(items: ls.CodeActionKind[]): code.CodeActionKind[];
83 asCodeActionKinds(item: ls.CodeActionKind[] | null | undefined): code.CodeActionKind[] | undefined;
84 asCodeActionResult(items: (ls.Command | ls.CodeAction)[], token?: code.CancellationToken): Promise<(code.Command | code.CodeAction)[]>;
85 asCodeLens(item: ls.CodeLens): code.CodeLens;
86 asCodeLens(item: undefined | null): undefined;
87 asCodeLens(item: ls.CodeLens | undefined | null): code.CodeLens | undefined;
88 asCodeLenses(items: undefined | null, token?: code.CancellationToken): Promise<undefined>;
89 asCodeLenses(items: ls.CodeLens[], token?: code.CancellationToken): Promise<code.CodeLens[]>;
90 asCodeLenses(items: ls.CodeLens[] | undefined | null, token?: code.CancellationToken): Promise<code.CodeLens[] | undefined>;
91 asWorkspaceEdit(item: undefined | null, token?: code.CancellationToken): Promise<undefined>;
92 asWorkspaceEdit(item: ls.WorkspaceEdit, token?: code.CancellationToken): Promise<code.WorkspaceEdit>;
93 asWorkspaceEdit(item: ls.WorkspaceEdit | undefined | null, token?: code.CancellationToken): Promise<code.WorkspaceEdit | undefined>;
94 asDocumentLink(item: ls.DocumentLink): code.DocumentLink;
95 asDocumentLinks(items: undefined | null, token?: code.CancellationToken): Promise<undefined>;
96 asDocumentLinks(items: ls.DocumentLink[], token?: code.CancellationToken): Promise<code.DocumentLink[]>;
97 asDocumentLinks(items: ls.DocumentLink[] | undefined | null, token?: code.CancellationToken): Promise<code.DocumentLink[] | undefined>;
98 asColor(color: ls.Color): code.Color;
99 asColorInformation(ci: ls.ColorInformation): code.ColorInformation;
100 asColorInformations(colorPresentations: undefined | null, token?: code.CancellationToken): Promise<undefined>;
101 asColorInformations(colorPresentations: ls.ColorInformation[], token?: code.CancellationToken): Promise<code.ColorInformation[]>;
102 asColorInformations(colorInformation: ls.ColorInformation[] | undefined | null, token?: code.CancellationToken): Promise<code.ColorInformation[]>;
103 asColorPresentation(cp: ls.ColorPresentation): code.ColorPresentation;
104 asColorPresentations(colorPresentations: undefined | null, token?: code.CancellationToken): Promise<undefined>;
105 asColorPresentations(colorPresentations: ls.ColorPresentation[], token?: code.CancellationToken): Promise<code.ColorPresentation[]>;
106 asColorPresentations(colorPresentations: ls.ColorPresentation[] | undefined | null, token?: code.CancellationToken): Promise<code.ColorPresentation[] | undefined>;
107 asFoldingRangeKind(kind: string | undefined): code.FoldingRangeKind | undefined;
108 asFoldingRange(r: ls.FoldingRange): code.FoldingRange;
109 asFoldingRanges(foldingRanges: undefined | null, token?: code.CancellationToken): Promise<undefined>;
110 asFoldingRanges(foldingRanges: ls.FoldingRange[], token?: code.CancellationToken): Promise<code.FoldingRange[]>;
111 asFoldingRanges(foldingRanges: ls.FoldingRange[] | undefined | null, token?: code.CancellationToken): Promise<code.FoldingRange[] | undefined>;
112 asSelectionRange(selectionRange: ls.SelectionRange): code.SelectionRange;
113 asSelectionRanges(selectionRanges: undefined | null, token?: code.CancellationToken): Promise<undefined>;
114 asSelectionRanges(selectionRanges: ls.SelectionRange[], token?: code.CancellationToken): Promise<code.SelectionRange[]>;
115 asSelectionRanges(selectionRanges: ls.SelectionRange[] | undefined | null, token?: code.CancellationToken): Promise<code.SelectionRange[] | undefined>;
116 asInlineValue(value: ls.InlineValue): code.InlineValue;
117 asInlineValues(values: undefined | null, token?: code.CancellationToken): Promise<undefined>;
118 asInlineValues(values: ls.InlineValue[], token?: code.CancellationToken): Promise<code.InlineValue[]>;
119 asInlineValues(values: ls.InlineValue[] | undefined | null, token?: code.CancellationToken): Promise<code.InlineValue[] | undefined>;
120 asInlayHint(value: ls.InlayHint, token?: code.CancellationToken): Promise<code.InlayHint>;
121 asInlayHints(values: undefined | null, token?: code.CancellationToken): Promise<undefined>;
122 asInlayHints(values: ls.InlayHint[], token?: code.CancellationToken): Promise<code.InlayHint[]>;
123 asInlayHints(values: ls.InlayHint[] | undefined | null, token?: code.CancellationToken): Promise<code.InlayHint[] | undefined>;
124 asSemanticTokensLegend(value: ls.SemanticTokensLegend): code.SemanticTokensLegend;
125 asSemanticTokens(value: undefined | null, token?: code.CancellationToken): Promise<undefined>;
126 asSemanticTokens(value: ls.SemanticTokens, token?: code.CancellationToken): Promise<code.SemanticTokens>;
127 asSemanticTokens(value: ls.SemanticTokens | undefined | null, token?: code.CancellationToken): Promise<code.SemanticTokens | undefined>;
128 asSemanticTokensEdit(value: ls.SemanticTokensEdit): code.SemanticTokensEdit;
129 asSemanticTokensEdits(value: undefined | null, token?: code.CancellationToken): Promise<undefined>;
130 asSemanticTokensEdits(value: ls.SemanticTokensDelta, token?: code.CancellationToken): Promise<code.SemanticTokensEdits>;
131 asSemanticTokensEdits(value: ls.SemanticTokensDelta | undefined | null, token?: code.CancellationToken): Promise<code.SemanticTokensEdits | undefined>;
132 asCallHierarchyItem(item: null): undefined;
133 asCallHierarchyItem(item: ls.CallHierarchyItem): code.CallHierarchyItem;
134 asCallHierarchyItem(item: ls.CallHierarchyItem | null): code.CallHierarchyItem | undefined;
135 asCallHierarchyItems(items: null, token?: code.CancellationToken): Promise<undefined>;
136 asCallHierarchyItems(items: ls.CallHierarchyItem[], token?: code.CancellationToken): Promise<code.CallHierarchyItem[]>;
137 asCallHierarchyItems(items: ls.CallHierarchyItem[] | null, token?: code.CancellationToken): Promise<code.CallHierarchyItem[] | undefined>;
138 asCallHierarchyIncomingCall(item: ls.CallHierarchyIncomingCall, token?: code.CancellationToken): Promise<code.CallHierarchyIncomingCall>;
139 asCallHierarchyIncomingCalls(items: null, token?: code.CancellationToken): Promise<undefined>;
140 asCallHierarchyIncomingCalls(items: ReadonlyArray<ls.CallHierarchyIncomingCall>, token?: code.CancellationToken): Promise<code.CallHierarchyIncomingCall[]>;
141 asCallHierarchyIncomingCalls(items: ReadonlyArray<ls.CallHierarchyIncomingCall> | null, token?: code.CancellationToken): Promise<code.CallHierarchyIncomingCall[] | undefined>;
142 asCallHierarchyOutgoingCall(item: ls.CallHierarchyOutgoingCall, token?: code.CancellationToken): Promise<code.CallHierarchyOutgoingCall>;
143 asCallHierarchyOutgoingCalls(items: null, token?: code.CancellationToken): Promise<undefined>;
144 asCallHierarchyOutgoingCalls(items: ReadonlyArray<ls.CallHierarchyOutgoingCall>, token?: code.CancellationToken): Promise<code.CallHierarchyOutgoingCall[]>;
145 asCallHierarchyOutgoingCalls(items: ReadonlyArray<ls.CallHierarchyOutgoingCall> | null, token?: code.CancellationToken): Promise<code.CallHierarchyOutgoingCall[] | undefined>;
146 asLinkedEditingRanges(value: null | undefined, token?: code.CancellationToken): Promise<undefined>;
147 asLinkedEditingRanges(value: ls.LinkedEditingRanges, token?: code.CancellationToken): Promise<code.LinkedEditingRanges>;
148 asLinkedEditingRanges(value: ls.LinkedEditingRanges | null | undefined, token?: code.CancellationToken): Promise<code.LinkedEditingRanges | undefined>;
149 asTypeHierarchyItem(item: null): undefined;
150 asTypeHierarchyItem(item: ls.TypeHierarchyItem): code.TypeHierarchyItem;
151 asTypeHierarchyItem(item: ls.TypeHierarchyItem | null): code.TypeHierarchyItem | undefined;
152 asTypeHierarchyItems(items: null, token?: code.CancellationToken): Promise<undefined>;
153 asTypeHierarchyItems(items: ls.TypeHierarchyItem[], token?: code.CancellationToken): Promise<code.TypeHierarchyItem[]>;
154 asTypeHierarchyItems(items: ls.TypeHierarchyItem[] | null, token?: code.CancellationToken): Promise<code.TypeHierarchyItem[] | undefined>;
155 asGlobPattern(pattern: ls.GlobPattern): code.GlobPattern | undefined;
156 asInlineCompletionResult(value: undefined | null, token?: code.CancellationToken): Promise<undefined>;
157 asInlineCompletionResult(value: ls.InlineCompletionList, token?: code.CancellationToken): Promise<code.InlineCompletionList>;
158 asInlineCompletionResult(value: ls.InlineCompletionItem[], token?: code.CancellationToken): Promise<code.InlineCompletionItem[]>;
159 asInlineCompletionResult(value: ls.InlineCompletionItem[] | ls.InlineCompletionList | undefined | null, token?: code.CancellationToken): Promise<code.InlineCompletionItem[] | code.InlineCompletionList | undefined>;
160 asInlineCompletionItem(item: ls.InlineCompletionItem): code.InlineCompletionItem;
161}
162export interface URIConverter {
163 (value: string): code.Uri;
164}
165export declare function createConverter(uriConverter: URIConverter | undefined, trustMarkdown: boolean | {
166 readonly enabledCommands: readonly string[];
167}, supportHtml: boolean): Converter;