Skip to content

Commit

Permalink
fix: fix completion crash by switchCaseExclude
Browse files Browse the repository at this point in the history
  • Loading branch information
zardoy committed Oct 8, 2022
1 parent c4d2ee5 commit 709c225
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions typescript/src/completions/switchCaseExcludeCovered.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { cleanupEntryName } from '../utils'

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

0 comments on commit 709c225

Please sign in to comment.