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

JS-280 Support unknown nodes in AST protobuf file #4786

Merged
merged 9 commits into from
Aug 29, 2024
Merged

Conversation

vdiez
Copy link
Contributor

@vdiez vdiez commented Aug 28, 2024

@@ -467,3 +469,7 @@ message FunctionExpression {
optional bool generator = 4;
optional bool async = 5;
}

message UnknownNode {
string astNodeType = 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

WDYT?

Suggested change
string astNodeType = 1;
string rawType = 1;

Copy link
Contributor

Choose a reason for hiding this comment

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

if you accept this change, you will have to adapt the other estree.proto files

Copy link
Contributor Author

Choose a reason for hiding this comment

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

btw, why so many repeated proto files? I think one should be source of truth

Copy link
Contributor

Choose a reason for hiding this comment

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

they are repeated because we didn't want to create coupling between the different modules. If we can find a better solution, it would be nice. See https://sonarsource.atlassian.net/browse/JS-197

Copy link
Contributor

Choose a reason for hiding this comment

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

As discussed, we will remove the deprecated scripts in tools/estree and only keep a script similar to copy-to-lib.js, named copy-to-plugin.js that copies the original in the bridge to the copy in the plugin.

We should also adapt the header comments in the protofile to identify:

  • which one is the original
  • which one the copy
  • by what script they are maintained in sync

Copy link
Contributor

@ilia-kebets-sonarsource ilia-kebets-sonarsource left a comment

Choose a reason for hiding this comment

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

LGTM

@vdiez vdiez merged commit caa3a3c into master Aug 29, 2024
22 of 23 checks passed
@vdiez vdiez deleted the support-unknown-node branch August 29, 2024 09:40
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.

3 participants