Skip to content

Commit 7e27619

Browse files
committed
fix: fix toString patching out of the box
1 parent 4ab7111 commit 7e27619

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

typescript/src/completionsAtPosition.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,10 @@ export const getCompletionsAtPosition = (
223223
// )
224224
const indexToPatch = prior.entries.findIndex(({ name, kind }) => name === 'toString' && kind !== ts.ScriptElementKind.warning)
225225
if (indexToPatch !== -1) {
226-
prior.entries[indexToPatch]!.insertText = `${prior.entries[indexToPatch]!.insertText ?? prior.entries[indexToPatch]!.name}()`
227-
prior.entries[indexToPatch]!.kind = ts.ScriptElementKind.constElement
228-
// prior.entries[indexToPatch]!.isSnippet = true
226+
const entryToPatch = prior.entries[indexToPatch]!
227+
entryToPatch.insertText = `${entryToPatch.insertText ?? entryToPatch.name}()`
228+
entryToPatch.isSnippet = true
229+
entryToPatch.kind = ts.ScriptElementKind.constElement
229230
}
230231
}
231232

0 commit comments

Comments
 (0)