Skip to content

Commit

Permalink
[FurqanSoftware#32] Explicit completion request at any location is ig…
Browse files Browse the repository at this point in the history
…nored
  • Loading branch information
yblanken committed Oct 22, 2024
1 parent 4d46cf9 commit ee0c633
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -519,20 +519,13 @@ export function languageServerWithTransport(options: LanguageServerOptions) {
let trigKind: CompletionTriggerKind =
CompletionTriggerKind.Invoked;
let trigChar: string | undefined;
if (
!explicit &&
plugin.client.capabilities?.completionProvider?.triggerCharacters?.includes(
line.text[pos - line.from - 1]
)
) {
trigKind = CompletionTriggerKind.TriggerCharacter;
trigChar = line.text[pos - line.from - 1];
}
if (
trigKind === CompletionTriggerKind.Invoked &&
!context.matchBefore(/\w+$/)
) {
return null;
if (!explicit) {
if (plugin.client.capabilities?.completionProvider?.triggerCharacters?.includes(
line.text[pos - line.from - 1])
) {
trigKind = CompletionTriggerKind.TriggerCharacter;
trigChar = line.text[pos - line.from - 1];
} else if (!context.matchBefore(/\w+$/)) return null;
}
return await plugin.requestCompletion(
context,
Expand Down

0 comments on commit ee0c633

Please sign in to comment.