Skip to content

Commit 8fbd1b4

Browse files
committed
[Autocompletion] Send triggerCharacter to tsserver
1 parent 66324f5 commit 8fbd1b4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/main/atom/autoCompleteProvider.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export class AutocompleteProvider implements ACP.AutocompleteProvider {
150150
}
151151

152152
const client = await this.getClient(location.file)
153-
const suggestions = await getSuggestionsInternal(client, location, prefix)
153+
const suggestions = await getSuggestionsInternal(client, location, prefix, activatedManually)
154154

155155
this.lastSuggestions = {
156156
client,
@@ -168,13 +168,15 @@ async function getSuggestionsInternal(
168168
client: TSClient,
169169
location: FileLocationQuery,
170170
prefix: string,
171+
activatedManually: boolean,
171172
) {
172173
if (parseInt(client.version.split(".")[0], 10) >= 3) {
173174
// use completionInfo
174175
const completions = await client.execute("completionInfo", {
175176
prefix,
176177
includeExternalModuleExports: false,
177178
includeInsertTextCompletions: true,
179+
triggerCharacter: activatedManually ? undefined : (prefix.slice(-1) as any),
178180
...location,
179181
})
180182
return completions.body!.entries.map(

0 commit comments

Comments
 (0)