Read trigger characters from LSP initialize responses#5121
Open
Firehed wants to merge 8 commits intodense-analysis:masterfrom
Open
Read trigger characters from LSP initialize responses#5121Firehed wants to merge 8 commits intodense-analysis:masterfrom
Firehed wants to merge 8 commits intodense-analysis:masterfrom
Conversation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
GetTriggerCharacter now accepts optional conn_id parameter to prefer LSP-provided trigger characters over the hardcoded map. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
GetPrefix now checks if the line ends with any trigger character from LSPs active for the current buffer, enabling automatic completion for LSP-provided triggers like > for PHP. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
Author
|
I tested this out locally as well while co-developing an LSP server (which prompted me to look into this in the first place) and saw it prefer the LSP trigger characters over some hardcoded set. I use |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1764
Summary
ALE already reads and stores LSP-provided
triggerCharactersfrom server capabilities, but never actually uses them. This PR wires them up so that:s:trigger_character_mapwhen LSP doesn't provide triggersChanges
ale#lsp#GetCompletionTriggerCharacters(conn_id)to retrieve stored trigger charactersale#lsp#GetAllCompletionTriggerCharactersForBuffer(buffer)to get triggers from all active LSPs for a buffers:GetTriggerCharacters(filetype, conn_id)helper that prefers LSP triggers over hardcodedale#completion#GetTriggerCharacter()to accept optionalconn_idparameterale#completion#GetPrefix()to check LSP trigger charactersale#completion#Filter()to use LSP trigger charactersTest plan
ale#lsp#GetCompletionTriggerCharactersale#lsp#GetAllCompletionTriggerCharactersForBufferale#completion#GetTriggerCharacterwith LSP triggersale#completion#Filterwith LSP triggers🤖 Generated with Claude Code