From 0e6d066a2940c65af9171dff52304590cac4b95e Mon Sep 17 00:00:00 2001 From: Veetaha Date: Sat, 29 Feb 2020 19:27:52 +0200 Subject: vscode: extract Type and Param hint cases of InlayHint at type level (needed further) --- editors/code/src/rust-analyzer-api.ts | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/editors/code/src/rust-analyzer-api.ts b/editors/code/src/rust-analyzer-api.ts index c5a010e94..6a7aeb602 100644 --- a/editors/code/src/rust-analyzer-api.ts +++ b/editors/code/src/rust-analyzer-api.ts @@ -86,14 +86,20 @@ export interface Runnable { export const runnables = request>("runnables"); -export const enum InlayKind { - TypeHint = "TypeHint", - ParameterHint = "ParameterHint", -} -export interface InlayHint { - range: lc.Range; - kind: InlayKind; - label: string; + +export type InlayHint = InlayHint.TypeHint | InlayHint.ParamHint; + +export namespace InlayHint { + export const enum Kind { + TypeHint = "TypeHint", + ParamHint = "ParameterHint", + } + interface Common { + range: lc.Range; + label: string; + } + export type TypeHint = Common & { kind: Kind.TypeHint; } + export type ParamHint = Common & { kind: Kind.ParamHint; } } export interface InlayHintsParams { textDocument: lc.TextDocumentIdentifier; -- cgit v1.2.3