Skip to content

Enable member completions for import types #23085

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

Merged
merged 6 commits into from
Apr 3, 2018

Conversation

weswigham
Copy link
Member

Fixes one of the points brought up in this comment.

@weswigham weswigham requested review from mhegazy, sheetalkamat and a user April 2, 2018 20:16
return typeChecker.isValidPropertyAccess(<PropertyAccessExpression>(node.parent), symbol.name);
}
else {
if (!(node as ImportTypeNode).isTypeOf) return false;
Copy link

@ghost ghost Apr 2, 2018

Choose a reason for hiding this comment

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

Use a && b instead of if (!a) return false; return b;

return typeChecker.isValidPropertyAccess(<PropertyAccessExpression>(node.parent), symbol.name);
}
else {
return !(node as ImportTypeNode).isTypeOf && !!(symbol.flags & SymbolFlags.Value);
Copy link
Member

Choose a reason for hiding this comment

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

Dont you still need typeChecker.isValidPropertyAccess especially checkPropertyAccessibility needs to be done to avoid not showing non exported stuff?

Copy link
Member Author

Choose a reason for hiding this comment

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

Non-exported symbols aren't returned by getExportsOfModule - except for class statics! I'll add a test.

@weswigham weswigham force-pushed the import-types-completions branch from f570a8f to 01ea0a6 Compare April 3, 2018 01:15
@weswigham
Copy link
Member Author

@sheetalkamat Can I get a rereview?

@weswigham weswigham merged commit a81a645 into microsoft:master Apr 3, 2018
@microsoft microsoft locked and limited conversation to collaborators Jul 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants