Repository: helix-editor/helix
File: helix-term/src/ui/lsp.rs (Rust)

Code before:
        let active_param_span = signature.active_param_range.map(|(start, end)| {
            vec![(
                cx.editor
                    .theme
                    .find_scope_index_exact("ui.selection")
                    .unwrap(),
                start..end,
            )]
        });

        let sig = &self.signatures[self.active_signature];
        let sig_text = crate::ui::markdown::highlighted_code_block(
            sig.signature.as_str(),
            &self.language,
            Some(&cx.editor.theme),
            Arc::clone(&self.config_loader),
            active_param_span,
        );

        if self.signatures.len() > 1 {
            let signature_index =
                format!("[{}/{}]", self.active_signature + 1, self.signatures.len());
            let sig_index = Markdown::new(signature_index, self.config_loader.clone());
            let sig_index = sig_index.parse(Some(&cx.editor.theme));
            let sig_index_para = Paragraph::new(&sig_index);
            sig_index_para.render(area.with_height(1).clip_left(1), surface);
        }

        let (_, sig_text_height) = crate::ui::text::required_size(&sig_text, area.width);
        let sig_text_area = area.clip_top(1).with_height(sig_text_height);
        let sig_text_area = sig_text_area.inner(&margin).intersection(surface.area);
        let sig_text_para = Paragraph::new(&sig_text).wrap(Wrap { trim: false });
        sig_text_para.render(sig_text_area, surface);

        if sig.signature_doc.is_none() {
            return;
        }

        let sep_style = Style::default();
        let borders = BorderType::line_symbols(BorderType::Plain);
        for x in sig_text_area.left()..sig_text_area.right() {
            if let Some(cell) = surface.get_mut(x, sig_text_area.bottom()) {
                cell.set_symbol(borders.horizontal).set_style(sep_style);
            }
        }

        let sig_doc = match &sig.signature_doc {
            None => return,
            Some(doc) => Markdown::new(doc.clone(), Arc::clone(&self.config_loader)),
        };
        let sig_doc = sig_doc.parse(Some(&cx.editor.theme));

Review comment (suggestion):
Could we put this on the same line as the signature itself, right-aligned? The display being right above the signature right now seems very compact. Also minor nit but I think I would prefer regular parens here: `(1/2)` rather than `[1/2]`

Code after:

        let active_param_span = signature.active_param_range.map(|(start, end)| {
            vec![(
                cx.editor
                    .theme
                    .find_scope_index_exact("ui.selection")
                    .unwrap(),
                start..end,
            )]
        });

        let sig = &self.signatures[self.active_signature];
        let sig_text = crate::ui::markdown::highlighted_code_block(
            sig.signature.as_str(),
            &self.language,
            Some(&cx.editor.theme),
            Arc::clone(&self.config_loader),
            active_param_span,
        );

        if self.signatures.len() > 1 {
            let signature_index = self.signature_index();
            let text = Text::from(signature_index);
            let paragraph = Paragraph::new(&text).alignment(Alignment::Right);
            paragraph.render(area.clip_top(1).with_height(1).clip_right(1), surface);
        }

        let (_, sig_text_height) = crate::ui::text::required_size(&sig_text, area.width);
        let sig_text_area = area.clip_top(1).with_height(sig_text_height);
        let sig_text_area = sig_text_area.inner(&margin).intersection(surface.area);
        let sig_text_para = Paragraph::new(&sig_text).wrap(Wrap { trim: false });
        sig_text_para.render(sig_text_area, surface);

        if sig.signature_doc.is_none() {
            return;
        }

        let sep_style = Style::default();
        let borders = BorderType::line_symbols(BorderType::Plain);
        for x in sig_text_area.left()..sig_text_area.right() {
            if let Some(cell) = surface.get_mut(x, sig_text_area.bottom()) {
                cell.set_symbol(borders.horizontal).set_style(sep_style);
            }
        }

        let sig_doc = match &sig.signature_doc {
            None => return,
            Some(doc) => Markdown::new(doc.clone(), Arc::clone(&self.config_loader)),
        };
        let sig_doc = sig_doc.parse(Some(&cx.editor.theme));
        let sig_doc_area = area