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

Handle string annotations in ScopeProvider #373

Merged
merged 1 commit into from
Aug 14, 2020
Merged

Conversation

Kronuz
Copy link
Contributor

@Kronuz Kronuz commented Aug 14, 2020

Summary

This adds support for string annotations to ScopeProvider

Test Plan

Run tests

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 14, 2020
Copy link
Contributor

@jimmylai jimmylai left a comment

Choose a reason for hiding this comment

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

Other than the missing return False, LGTM.

@Kronuz Kronuz merged commit c935fcb into master Aug 14, 2020
@Kronuz Kronuz deleted the annotation-access branch August 14, 2020 22:06
value = node.evaluated_value
if value:
mod = cst.parse_module(value)
mod.visit(self)
Copy link
Member

Choose a reason for hiding this comment

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

There's a subtle problem with this approach that I only just discovered. Running self on another module will mean we'll collect CST nodes that don't appear in the original CST. That means anyone using these collected nodes will not be able to meaningfully use them (for example to look up other metadata for them, like position). I'll open a separate issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants