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(-) (limited to 'editors/code/src/rust-analyzer-api.ts') 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 From 6441988d84cc1f9d347d72a48d2b67b19dcb8cc9 Mon Sep 17 00:00:00 2001 From: Veetaha Date: Sat, 29 Feb 2020 19:28:26 +0200 Subject: vscode: redesign inlay hints to be capable of handling multiple editors --- editors/code/src/rust-analyzer-api.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'editors/code/src/rust-analyzer-api.ts') diff --git a/editors/code/src/rust-analyzer-api.ts b/editors/code/src/rust-analyzer-api.ts index 6a7aeb602..bd6e3ada0 100644 --- a/editors/code/src/rust-analyzer-api.ts +++ b/editors/code/src/rust-analyzer-api.ts @@ -98,8 +98,8 @@ export namespace InlayHint { range: lc.Range; label: string; } - export type TypeHint = Common & { kind: Kind.TypeHint; } - export type ParamHint = Common & { kind: Kind.ParamHint; } + export type TypeHint = Common & { kind: Kind.TypeHint }; + export type ParamHint = Common & { kind: Kind.ParamHint }; } export interface InlayHintsParams { textDocument: lc.TextDocumentIdentifier; -- cgit v1.2.3