Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isolated declarations enums #118

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

dragomirtitian
Copy link

@dragomirtitian dragomirtitian commented Nov 25, 2023

No description provided.

Copy link

@h-joo h-joo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with some nits

@@ -122,13 +118,39 @@ export function createEmitDeclarationResolver(file: SourceFile): IsolatedEmitRes
}
return undefined;
}

function resolveEntityName(location: Node, node: Expression, meaning: SymbolFlags): EmitDeclarationSymbol | undefined {
Copy link

@h-joo h-joo Nov 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be resolveEntityName(location: EnumDeclaration, ... ?
And on the same point, I feel using a specific name for the variable would make more sense (e.g. enumDecl).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will actually be moved in #120 and be used in the more generic sense of resolving any entity name in any location.

return undefined;
}
}
function isTargetEnumDeclaration(target: Expression, location: EnumDeclaration) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Technically you're checking whether the target expression is an enum member, not a declaration.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isExpressionMemberOfEnum is more descriptive I think

Signed-off-by: Titian Cernicova-Dragomir <tcernicovad1@bloomberg.net>
@dragomirtitian dragomirtitian merged commit 24d8a3c into isolated-declarations Nov 27, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants