Skip to content

Commit 0b36769

Browse files
committed
return undefined instead of an empty array to avoid creating code action that can't be executed
1 parent 114414a commit 0b36769

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/services/codefixes/fixPropertyOverrideAccessor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ function doChange(file: SourceFile, start: number, length: number, code: number,
6868
if (!baseTypeNode) return;
6969
const expression = skipParentheses(baseTypeNode.expression);
7070
const base = isClassExpression(expression) ? expression.symbol : checker.getSymbolAtLocation(expression);
71-
if (!base) return [];
71+
if (!base) return;
7272
const baseType = checker.getDeclaredTypeOfSymbol(base);
7373
const baseProp = checker.getPropertyOfType(baseType, unescapeLeadingUnderscores(getTextOfPropertyName(node.name)));
74-
if (!baseProp || !baseProp.valueDeclaration) return [];
74+
if (!baseProp || !baseProp.valueDeclaration) return;
7575

7676
startPosition = baseProp.valueDeclaration.pos;
7777
endPosition = baseProp.valueDeclaration.end;

0 commit comments

Comments
 (0)