Skip to content

fix(lsp-ui-doc): prevent filling of markdown code blocks#799

Open
tempdragon wants to merge 1 commit intoemacs-lsp:masterfrom
tempdragon:rust-long-sig-md-render
Open

fix(lsp-ui-doc): prevent filling of markdown code blocks#799
tempdragon wants to merge 1 commit intoemacs-lsp:masterfrom
tempdragon:rust-long-sig-md-render

Conversation

@tempdragon
Copy link

Problem Description

The function signatures in Rust, if containing a signature with lengthy parameter names, may fail to show the markdown newlines.
Here is a demonstration:

/// An preprocessing pipeline to serialize each step of handling.
/// # Arguments
/// * `df`:
/// * `config`:
/// * `classification`:
/// * `is_update`:
/// * `per_info_max_ts`:
/// * `force_recalculate_methods`:
/// * `force_recalculate_stats`:
/// * `no_main_regen`:
/// * `no_aux_regen`:
fn my_test() {}
/// An preprocessing pipeline to serialize each step of handling.
/// # Arguments
/// * `df`:
/// * `config`:
/// * `classification`:
/// * `is_update`:
/// * `per_info_max_ts`:
/// * `force_recalculate_methods`:
/// * `force_recalculate_stats`:
/// * `no_main_regen`:
/// * `no_aux_regen`:
#[allow(clippy::too_many_arguments)]
pub async fn process_pipeline(
    mut df: DataFrame,
    config: &Config,
    classification: &Classification,
    is_update: bool,
    per_info_max_ts: Option<FxHashMap<(u8, u32), u32>>,
    force_recalculate_methods: bool,
    force_recalculate_stats: bool,
    no_main_regen: bool,
    no_aux_regen: bool,
) -> Result<usize> {
}

The result of two different functions as a comparison

2026-01-18-084526_1920x1080_scrot 2026-01-18-084529_1920x1080_scrot

Solution

I refactor lsp-ui-doc--fill-document to skip fenced code blocks and add lsp-ui-doc--fill-check-and-fill for safer paragraph wrapping. This prevents aggressive reflowing of code signatures while maintaining proper text wrapping for prose.
2026-01-18-085009_1920x1080_scrot

- [lsp-ui-doc.el]: refactor `lsp-ui-doc--fill-document` to skip fenced code blocks and add `lsp-ui-doc--fill-check-and-fill` for safer paragraph wrapping. This prevents aggressive reflowing of code signatures while maintaining proper text wrapping for prose.
@tempdragon tempdragon changed the title fix(doc): prevent filling of markdown code blocks fix(lsp-ui-doc): prevent filling of markdown code blocks Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant