forked from microsoft/vscode-languageserver-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvscode-proposed.d.ts
More file actions
129 lines (111 loc) · 3.45 KB
/
vscode-proposed.d.ts
File metadata and controls
129 lines (111 loc) · 3.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
declare module 'vscode' {
export interface CompletionItem {
/**
* Will be merged into CompletionItem#label
*/
label2?: CompletionItemLabel;
}
export interface CompletionItemLabel {
/**
* The function or variable. Rendered leftmost.
*/
name: string;
/**
* The parameters without the return type. Render after `name`.
*/
parameters?: string;
/**
* The fully qualified name, like package name or file path. Rendered after `signature`.
*/
qualifier?: string;
/**
* The return-type of a function or type of a property/variable. Rendered rightmost.
*/
type?: string;
}
export interface OpenEditorInfo {
name: string;
resource: Uri;
}
export namespace window {
export const openEditors: ReadonlyArray<OpenEditorInfo>;
// todo@API proper event type
export const onDidChangeOpenEditors: Event<void>;
}
//#region https://github.com/microsoft/vscode/issues/16221
// todo@API Split between Inlay- and OverlayHints (InlayHint are for a position, OverlayHints for a non-empty range)
// todo@API add "mini-markdown" for links and styles
// (done) remove description
// (done) rename to InlayHint
// (done) add InlayHintKind with type, argument, etc
export namespace languages {
/**
* Register a inlay hints provider.
*
* Multiple providers can be registered for a language. In that case providers are asked in
* parallel and the results are merged. A failing provider (rejected promise or exception) will
* not cause a failure of the whole operation.
*
* @param selector A selector that defines the documents this provider is applicable to.
* @param provider An inlay hints provider.
* @return A {@link Disposable} that unregisters this provider when being disposed.
*/
export function registerInlayHintsProvider(selector: DocumentSelector, provider: InlayHintsProvider): Disposable;
}
export enum InlayHintKind {
Other = 0,
Type = 1,
Parameter = 2,
}
/**
* Inlay hint information.
*/
export class InlayHint {
/**
* The text of the hint.
*/
text: string;
/**
* The position of this hint.
*/
position: Position;
/**
* The kind of this hint.
*/
kind?: InlayHintKind;
/**
* Whitespace before the hint.
*/
whitespaceBefore?: boolean;
/**
* Whitespace after the hint.
*/
whitespaceAfter?: boolean;
// todo@API make range first argument
constructor(text: string, position: Position, kind?: InlayHintKind);
}
/**
* The inlay hints provider interface defines the contract between extensions and
* the inlay hints feature.
*/
export interface InlayHintsProvider {
/**
* An optional event to signal that inlay hints have changed.
* @see {@link EventEmitter}
*/
onDidChangeInlayHints?: Event<void>;
/**
*
* @param model The document in which the command was invoked.
* @param range The range for which inlay hints should be computed.
* @param token A cancellation token.
* @return A list of inlay hints or a thenable that resolves to such.
*/
provideInlayHints(model: TextDocument, range: Range, token: CancellationToken): ProviderResult<InlayHint[]>;
}
//#endregion
}