aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/commands')
-rw-r--r--helix-term/src/commands/lsp.rs17
1 files changed, 16 insertions, 1 deletions
diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs
index 0b0d1db4..f8e83a46 100644
--- a/helix-term/src/commands/lsp.rs
+++ b/helix-term/src/commands/lsp.rs
@@ -1221,10 +1221,25 @@ pub fn signature_help_impl(cx: &mut Context, invoked: SignatureHelpInvoked) {
contents.set_active_param_range(active_param_range());
let old_popup = compositor.find_id::<Popup<SignatureHelp>>(SignatureHelp::ID);
- let popup = Popup::new(SignatureHelp::ID, contents)
+ let mut popup = Popup::new(SignatureHelp::ID, contents)
.position(old_popup.and_then(|p| p.get_position()))
.position_bias(Open::Above)
.ignore_escape_key(true);
+
+ // Don't create a popup if it intersects the auto-complete menu.
+ let size = compositor.size();
+ if compositor
+ .find::<ui::EditorView>()
+ .unwrap()
+ .completion
+ .as_mut()
+ .map(|completion| completion.area(size, editor))
+ .filter(|area| area.intersects(popup.area(size, editor)))
+ .is_some()
+ {
+ return;
+ }
+
compositor.replace_or_push(SignatureHelp::ID, popup);
},
);