From 791bf7e50a19bcf7612788deb7514847089cb976 Mon Sep 17 00:00:00 2001 From: Gokul Soumya Date: Tue, 19 Jul 2022 07:58:24 +0530 Subject: Add lsp signature help (#1755) * Add lsp signature help * Do not move signature help popup on multiple triggers * Highlight current parameter in signature help * Auto close signature help * Position signature help above to not block completion * Update signature help on backspace/insert mode delete * Add lsp.auto-signature-help config option * Add serde default annotation for LspConfig * Show LSP inactive message only if signature help is invoked manually * Do not assume valid signature help response from LSP Malformed LSP responses are common, and these should not crash the editor. * Check signature help capability before sending request * Reuse Open enum for PositionBias in popup * Close signature popup and exit insert mode on escape * Add config to control signature help docs display * Use new Margin api in signature help * Invoke signature help on changing to insert mode--- helix-view/src/editor.rs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'helix-view/src') diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index babb5c43..0178d399 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -167,10 +167,25 @@ pub struct Config { pub color_modes: bool, } -#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)] -#[serde(rename_all = "kebab-case", deny_unknown_fields)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(default, rename_all = "kebab-case", deny_unknown_fields)] pub struct LspConfig { + /// Display LSP progress messages below statusline pub display_messages: bool, + /// Enable automatic pop up of signature help (parameter hints) + pub auto_signature_help: bool, + /// Display docs under signature help popup + pub display_signature_help_docs: bool, +} + +impl Default for LspConfig { + fn default() -> Self { + Self { + display_messages: false, + auto_signature_help: true, + display_signature_help_docs: true, + } + } } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -- cgit v1.2.3-70-g09d2