mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-22 12:03:44 -05:00
fix(56733): Auto fix "add missing properties" of enums does not correct namespace of enum (#56739)
This commit is contained in:
@@ -674,7 +674,7 @@ function tryGetValueFromType(context: CodeFixContextBase, checker: TypeChecker,
|
||||
}
|
||||
if (type.flags & TypeFlags.EnumLike) {
|
||||
const enumMember = type.symbol.exports ? firstOrUndefinedIterator(type.symbol.exports.values()) : type.symbol;
|
||||
const name = checker.symbolToExpression(type.symbol.parent ? type.symbol.parent : type.symbol, SymbolFlags.Value, /*enclosingDeclaration*/ undefined, /*flags*/ undefined);
|
||||
const name = checker.symbolToExpression(type.symbol.parent ? type.symbol.parent : type.symbol, SymbolFlags.Value, /*enclosingDeclaration*/ undefined, /*flags*/ NodeBuilderFlags.UseFullyQualifiedType);
|
||||
return enumMember === undefined || name === undefined ? factory.createNumericLiteral(0) : factory.createPropertyAccessExpression(name, checker.symbolToString(enumMember));
|
||||
}
|
||||
if (type.flags & TypeFlags.NumberLiteral) {
|
||||
|
||||
Reference in New Issue
Block a user