-
Notifications
You must be signed in to change notification settings - Fork 36
[interop] Add support for modules #446
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a draft, so some of my comments may not apply. :)
Set<TSNode> get nodes; | ||
|
||
final Set<ParentDeclaration> namespaceDeclarations; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this not be Set<NamespaceDeclaration>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would there be a reason for it to be null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be missing something. :) I meant that this says "namespaceDeclarations" but the type of the Set
isn't more specific. If this also encompasses module declarations I'd rename the field to represent both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh my bad, VSCode made it look like you were writing the question mark as a nullable symbol rather than the entirety as a question.
|
||
for (final decl in topLevelDeclarations) { | ||
if (decl case final VariableDeclaration variable) { | ||
if (variable.modifier == VariableModifier.$const) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd avoid the code duplication and let emit
handle this check and then just type-check the result before adding it to the lists, even if it means an extra type-check.
Fixes #424
Fixes #431
This PR adds support for TypeScript Modules, as well as TS Preprocessing, reference modules, and more!