aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/editor.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-view/src/editor.rs')
-rw-r--r--helix-view/src/editor.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs
index 41aa707f..bbed58d6 100644
--- a/helix-view/src/editor.rs
+++ b/helix-view/src/editor.rs
@@ -345,6 +345,8 @@ pub struct LspConfig {
pub auto_signature_help: bool,
/// Display docs under signature help popup
pub display_signature_help_docs: bool,
+ /// Display inlay hints
+ pub display_inlay_hints: bool,
}
impl Default for LspConfig {
@@ -354,6 +356,7 @@ impl Default for LspConfig {
display_messages: false,
auto_signature_help: true,
display_signature_help_docs: true,
+ display_inlay_hints: false,
}
}
}
@@ -1133,6 +1136,19 @@ impl Editor {
fn _refresh(&mut self) {
let config = self.config();
+
+ // Reset the inlay hints annotations *before* updating the views, that way we ensure they
+ // will disappear during the `.sync_change(doc)` call below.
+ //
+ // We can't simply check this config when rendering because inlay hints are only parts of
+ // the possible annotations, and others could still be active, so we need to selectively
+ // drop the inlay hints.
+ if !config.lsp.display_inlay_hints {
+ for doc in self.documents_mut() {
+ doc.reset_all_inlay_hints();
+ }
+ }
+
for (view, _) in self.tree.views_mut() {
let doc = doc_mut!(self, &view.doc);
view.sync_changes(doc);