Skip to content

Commit 0fbf3ca

Browse files
committed
fix(object-literal-completions): TypeScript completion got frozen #123
1 parent b23baeb commit 0fbf3ca

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- run: pnpm lint
2929
- run: pnpm vscode-utils prepareFrameworkBuild
3030
- run: pnpm build
31-
- run: pnpm test-plugin
31+
- run: timeout 60 pnpm test-plugin
3232
- uses: GabrielBB/[email protected]
3333
with:
3434
run: pnpm integration-test

typescript/src/completions/objectLiteralCompletions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ export default (
2121
const nextChar = node.getSourceFile().getFullText()[position]
2222
if (!ts.isObjectLiteralExpression(node) || nextChar === ':') return
2323

24-
entries = [...entries]
2524
const typeChecker = languageService.getProgram()!.getTypeChecker()!
2625
const objType = typeChecker.getContextualType(node)
2726
let oldProperties: ts.Symbol[] | undefined
2827
if (!isTs5()) {
2928
if (!objType) return
3029
oldProperties = getAllPropertiesOfType(objType, typeChecker)
3130
}
32-
for (const entry of entries) {
31+
// eslint-disable-next-line unicorn/no-useless-spread
32+
for (const entry of [...entries]) {
3333
let type: ts.Type | undefined
3434
if (!isTs5()) {
3535
const property = oldProperties!.find(property => property.name === entry.name)

typescript/test/completions.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ test('Additional types suggestions', () => {
534534
})
535535
})
536536

537-
test.skip('Object Literal Completions', () => {
537+
test('Object Literal Completions', () => {
538538
const [_positivePositions, _negativePositions, numPositions] = fileContentsSpecialPositions(/* ts */ `
539539
interface Options {
540540
usedOption

0 commit comments

Comments
 (0)