-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TriggerKind::Auto
violates lsp
spec
#9656
Comments
Incomplete completions are not currently implemented but I believe @pascalkuthe was interested in looking at adding that since it's widely used. |
From the spec: /**
* Contains additional information about the context in which a completion
* request is triggered.
*/
export interface CompletionContext {
/**
* How the completion was triggered.
*/
triggerKind: CompletionTriggerKind;
/**
* The trigger character (a single character) that has trigger code
* complete. Is undefined if
* `triggerKind !== CompletionTriggerKind.TriggerCharacter`
*/
triggerCharacter?: string;
} This doesn't explicitly imply that The definition of /**
* How a completion was triggered
*/
export namespace CompletionTriggerKind {
/**
* Completion was triggered by typing an identifier (24x7 code
* complete), manual invocation (e.g Ctrl+Space) or via API.
*/
export const Invoked: 1 = 1;
/**
* Completion was triggered by a trigger character specified by
* the `triggerCharacters` properties of the
* `CompletionRegistrationOptions`.
*/
export const TriggerCharacter: 2 = 2;
/**
* Completion was re-triggered as the current completion list is incomplete.
*/
export const TriggerForIncompleteCompletions: 3 = 3;
}
export type CompletionTriggerKind = 1 | 2 | 3; Using |
Yes, it was an interpolation.
Cool, raised a PR at #9660 |
I actually am not sure what the spec meant. The current behavior was intentional. We should check what vscode does and mirror that behavior. I was under the impression it behaves the same way helix does |
For autocomplete triggers due to actions like Change mode to Insert, Idle Timeout etc, we send wrong CompletionTriggerKind to language servers. And following that CompletionContext is also invalid.
According to spec, these should be the values of
CompletionContext
:Violation by
helix
For Auto Triggers (like after typing non-trigger characters) we send
triggerKind: 2
instead oftriggerKind: 1
. Due to this we also end up sendingtriggerKind: 2
without atriggerCharacter
.Sidenote: We don't seem to use
triggerKind: 3
. Ideally this should be used for incomplete completions but I don't understand this part quiet well so not sure if this a violation or not.Asciinema
svelteserver
, resulting in no completion. And logs showing that we send invalidCompletionContext = {triggerKind: 2}
{triggerKind: 1}
, which results in completion list bysvelteserver
.{
is not a trigger character ofsvelteserver
, the autocomplete was triggered after I typed 2 characters.copilot
completions in the recording.Helix code responsible for handling this
helix/helix-term/src/handlers/completion.rs
Lines 207 to 228 in 78c3419
The text was updated successfully, but these errors were encountered: