-
Notifications
You must be signed in to change notification settings - Fork 196
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
Add FullyQualifiedNameProvider #465
Conversation
4566c8c
to
3dc6afe
Compare
Codecov Report
@@ Coverage Diff @@
## master #465 +/- ##
==========================================
+ Coverage 94.62% 94.65% +0.02%
==========================================
Files 236 236
Lines 22800 22902 +102
==========================================
+ Hits 21575 21677 +102
Misses 1225 1225
Continue to review full report at Codecov.
|
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.
Please add FullyQualifiedNameProvider to sphinx doc.
https://raw.githubusercontent.com/Instagram/LibCST/6731aa5d2940ce82dd221963b64a496955bfd07a/docs/source/metadata.rst
).get(file_path, "") | ||
}, | ||
) | ||
return set().union(*wrapper.resolve(FullyQualifiedNameProvider).values()) |
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.
To make it simpler.
return set().union(*wrapper.resolve(FullyQualifiedNameProvider).values()) | |
return set(wrapper.resolve(FullyQualifiedNameProvider).values()) |
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.
That's what I started with but unfortunately
TypeError: unhashable type: 'set'
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.
>>> a = [[1, 2, 3], [4, 5, 6]]
>>> set(itertools.chain(*a))
{1, 2, 3, 4, 5, 6}
>>> set(y for x in a for y in x)
{1, 2, 3, 4, 5, 6}
ea442b4
to
09d9cef
Compare
I've updated the PR with changes :) |
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.
Something wrong in the doc. The FullyQualifiedNameProvider docstring wasn't found in the generated doc and FullyQualifiedNameProvider is not clickable.
https://9659-200896124-gh.circle-artifacts.com/0/doc/metadata.html
Please double check.
Otherwise, looks good.
Will do tomorrow |
Summary
This new provider resolves names to their fully qualified versions, and is capable of dealing with relative imports, addressing the same issue as #461.
Closes #460, closes #282.
This PR depends on #464
Test Plan
Added unit tests.