From 3ac9732ca3bb34bfdda723d4eeed3040db7b1542 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Fri, 28 Aug 2020 21:55:24 +0300 Subject: [PATCH 1/2] Fix some typos --- crates/rust-analyzer/src/handlers.rs | 2 +- crates/rust-analyzer/src/to_proto.rs | 2 +- editors/code/src/lsp_ext.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/rust-analyzer/src/handlers.rs b/crates/rust-analyzer/src/handlers.rs index 8568f7b0507..d62dd058985 100644 --- a/crates/rust-analyzer/src/handlers.rs +++ b/crates/rust-analyzer/src/handlers.rs @@ -1075,7 +1075,7 @@ pub(crate) fn handle_inlay_hints( .analysis .inlay_hints(file_id, &snap.config.inlay_hints)? .into_iter() - .map(|it| to_proto::inlay_int(&line_index, it)) + .map(|it| to_proto::inlay_hint(&line_index, it)) .collect()) } diff --git a/crates/rust-analyzer/src/to_proto.rs b/crates/rust-analyzer/src/to_proto.rs index a5191c16e7e..a8173a338e4 100644 --- a/crates/rust-analyzer/src/to_proto.rs +++ b/crates/rust-analyzer/src/to_proto.rs @@ -294,7 +294,7 @@ pub(crate) fn signature_help( } } -pub(crate) fn inlay_int(line_index: &LineIndex, inlay_hint: InlayHint) -> lsp_ext::InlayHint { +pub(crate) fn inlay_hint(line_index: &LineIndex, inlay_hint: InlayHint) -> lsp_ext::InlayHint { lsp_ext::InlayHint { label: inlay_hint.label.to_string(), range: range(line_index, inlay_hint.range), diff --git a/editors/code/src/lsp_ext.ts b/editors/code/src/lsp_ext.ts index 8663737a684..f280bba3d21 100644 --- a/editors/code/src/lsp_ext.ts +++ b/editors/code/src/lsp_ext.ts @@ -1,5 +1,5 @@ /** - * This file mirrors `crates/rust-analyzer/src/req.rs` declarations. + * This file mirrors `crates/rust-analyzer/src/lsp_ext.rs` declarations. */ import * as lc from "vscode-languageclient"; From de2324d9e6aa378d28799aaaa3336e6efb7a06b7 Mon Sep 17 00:00:00 2001 From: Veetaha Date: Sat, 29 Aug 2020 02:05:42 +0300 Subject: [PATCH 2/2] Remove fixme from inlay_hints.ts I have reevaluated the fixme and it doesn't seem necessary to pass an array of files to the inlay hints request. This will (a) make the request more compilcated (b), make us wait for inlay hints for `all` active editors resolve at once before rendering and (c) doesn't seem required because 99% of the time there is a single active editor in the IDE --- editors/code/src/inlay_hints.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/editors/code/src/inlay_hints.ts b/editors/code/src/inlay_hints.ts index 7b481fc72f6..30ade9b986c 100644 --- a/editors/code/src/inlay_hints.ts +++ b/editors/code/src/inlay_hints.ts @@ -111,7 +111,6 @@ class HintsUpdater implements Disposable { } syncCacheAndRenderHints() { - // FIXME: make inlayHints request pass an array of files? this.sourceFiles.forEach((file, uri) => this.fetchHints(file).then(hints => { if (!hints) return;