-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Enable member completions for import types #23085
Conversation
src/services/completions.ts
Outdated
return typeChecker.isValidPropertyAccess(<PropertyAccessExpression>(node.parent), symbol.name); | ||
} | ||
else { | ||
if (!(node as ImportTypeNode).isTypeOf) return false; |
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.
Use a && b
instead of if (!a) return false; return b;
src/services/completions.ts
Outdated
return typeChecker.isValidPropertyAccess(<PropertyAccessExpression>(node.parent), symbol.name); | ||
} | ||
else { | ||
return !(node as ImportTypeNode).isTypeOf && !!(symbol.flags & SymbolFlags.Value); |
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.
Dont you still need typeChecker.isValidPropertyAccess
especially checkPropertyAccessibility
needs to be done to avoid not showing non exported stuff?
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.
Non-exported symbols aren't returned by getExportsOfModule
- except for class statics! I'll add a test.
f570a8f
to
01ea0a6
Compare
@sheetalkamat Can I get a rereview? |
Fixes one of the points brought up in this comment.