Repository navigation
Conversation
There was a problem hiding this comment.
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.
8d375ce to
f503898
Compare
|
Thanks for your pull-request! If I understand things correctly, one way to reproduce this bug would be to run first run: mkdir /tmp/pr5164
cd /tmp/5164
cargo init
vim src/main.rsThen enter insert mode and type at the very top of the file: use std::Right? On current master (422c0e8) this will not bring up any completions for me. However on the branch of this pull-request it will. In other words, the fix appears to be working. However I do not exactly understand how. If going through the description above:
The LSP communicates: {
"jsonrpc": "2.0",
"id": 1,
"result": {
"capabilities": {
…
"completionProvider": {
"triggerCharacters": [
":",
".",
"'",
"("
],
…
},
…
"serverInfo": {
"name": "rust-analyzer",
"version": "2026-06-08"
}
}
}A single character
Does this refer to the second value of
Precisely how does it fail? What I would want to understand is how ale fails, and how the bug fix works. Until I'm there, I can't vouch for this addressing the core problem. I might be completely off, but it feels a bit odd that hard-coded trigger characters should matter at all when the LSP provides values for them. Maybe that is not what is being claimed? or patched? Unless someone beats me to it, I intend to look at this again another day. |
Fix a bug where ALE was filtering completions after multi-character prefixes (e.g. "::").
rust-analyzeradvertises 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-analyzeradvertises :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.