Skip to content

Commit 0e6d066

Browse files
author
Veetaha
committed
vscode: extract Type and Param hint cases of InlayHint at type level (needed further)
1 parent 013e908 commit 0e6d066

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

editors/code/src/rust-analyzer-api.ts

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,20 @@ export interface Runnable {
8686
export const runnables = request<RunnablesParams, Vec<Runnable>>("runnables");
8787

8888

89-
export const enum InlayKind {
90-
TypeHint = "TypeHint",
91-
ParameterHint = "ParameterHint",
92-
}
93-
export interface InlayHint {
94-
range: lc.Range;
95-
kind: InlayKind;
96-
label: string;
89+
90+
export type InlayHint = InlayHint.TypeHint | InlayHint.ParamHint;
91+
92+
export namespace InlayHint {
93+
export const enum Kind {
94+
TypeHint = "TypeHint",
95+
ParamHint = "ParameterHint",
96+
}
97+
interface Common {
98+
range: lc.Range;
99+
label: string;
100+
}
101+
export type TypeHint = Common & { kind: Kind.TypeHint; }
102+
export type ParamHint = Common & { kind: Kind.ParamHint; }
97103
}
98104
export interface InlayHintsParams {
99105
textDocument: lc.TextDocumentIdentifier;

0 commit comments

Comments
 (0)