Skip to content

Fix completion filtering for multi-character prefixes - #5164

Open
germtb wants to merge 1 commit into
dense-analysis:masterfrom
germtb:fix-completion-multichar-prefixes
Open

Fix completion filtering for multi-character prefixes#5164
germtb wants to merge 1 commit into
dense-analysis:masterfrom
germtb:fix-completion-multichar-prefixes

Conversation

@germtb

@germtb germtb commented Aug 15, 2026

Copy link
Copy Markdown

Fix a bug where ALE was filtering completions after multi-character prefixes (e.g. "::").

rust-analyzer advertises single-characters triggers (this is correct for in the LSP spec: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#completionContext), but some prefixes are not single characters.

Root cause

  • rust-analyzer advertises :
  • ALE identifies the prefix as ::
  • ALE’s exact comparison fails

Fix

ALE accepts a trigger if it matches the end of a prefix.

Test

I added a regression two assertions to two existing tests that passes now and fail without the fix.

@germtb
germtb requested a review from w0rp as a code owner August 15, 2026 22:09
@hsanson
hsanson requested a balanced review from Copilot August 19, 2026 01:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes completion filtering when a multi-character prefix ends with an LSP trigger character.

Changes:

  • Matches advertised triggers against prefix suffixes.
  • Adds Rust :: regression coverage.
  • Reuses trigger detection during filtering.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
autoload/ale/completion.vim Adds suffix-based trigger matching and filtering.
test/completion/test_completion_filtering.vader Tests :: with rust-analyzer’s : trigger.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread autoload/ale/completion.vim
@germtb
germtb force-pushed the fix-completion-multichar-prefixes branch from 8d375ce to f503898 Compare August 24, 2026 09:53
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.

2 participants