Skip to content

Commit

Permalink
Inline completer should run anywhere when invoked (#16298)
Browse files Browse the repository at this point in the history
The inline completer prevents aitomatic running of the completer
when not at the end of a line of code, but it is also applying this
when invoked manually, which was unintended. This addresses that bug.

Signed-off-by: Alex Bozarth <ajbozart@us.ibm.com>
  • Loading branch information
ajbozarth committed May 8, 2024
1 parent 393d80f commit a5f9207
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/completer/src/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,10 @@ export class CompletionHandler implements IDisposable {
}

const line = editor.getLine(position.line);
if (typeof line === 'undefined' || position.column < line.length) {
if (
trigger === InlineCompletionTriggerKind.Automatic &&
(typeof line === 'undefined' || position.column < line.length)
) {
// only auto-trigger on end of line
return;
}
Expand Down

0 comments on commit a5f9207

Please sign in to comment.