-
Notifications
You must be signed in to change notification settings - Fork 240
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
Autocomplete: Don't trigger on closing characters #1218
Conversation
@@ -183,6 +183,11 @@ async function doGetInlineCompletions(params: InlineCompletionsParams): Promise< | |||
return null | |||
} | |||
|
|||
// Do not trigger when the last character is a closing symbol | |||
if (triggerKind !== TriggerKind.Manual && /[)\]}]$/.test(docContext.prefix.trim())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if I'm in the middle of a function body and expect a single-line completion?
function whatever() {
const data = {
value: true
}
█
}
There are multiple similar cases where I would like to see completions being generated. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair, let's not look at the prefix but the sameLinePrefix instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think looking at the current line only is a closer approximation to the cursor: "}"
metric we were seeing anyways. I think right now this triggers pretty often because inserting a completion will trigger a new completion request
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blissful
Test plan
Test added