Skip to content

Commit 709c225

Browse files
committed
fix: fix completion crash by switchCaseExclude
1 parent c4d2ee5 commit 709c225

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

typescript/src/completions/switchCaseExcludeCovered.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { cleanupEntryName } from '../utils'
33

44
// implementation not even ideal, but it just works for string & enums, which are used in 99% cases
55
export default (entries: ts.CompletionEntry[], position: number, sourceFile: ts.SourceFile, leftNode: ts.Node) => {
6+
if (!leftNode.parent?.parent) return
67
let nodeComp = leftNode
78
let enumAccessExpr: string | null | undefined
89
if (ts.isStringLiteral(leftNode)) enumAccessExpr = null

0 commit comments

Comments
 (0)