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

Improve isPossiblyTypeArgumentPosition #25043

Merged
5 commits merged into from
Jul 11, 2018
Merged

Conversation

ghost
Copy link

@ghost ghost commented Jun 18, 2018

Fixes #23631

We will no longer return type completions at x < where x is not a generic function.

@ghost ghost requested a review from sheetalkamat June 18, 2018 16:29

export function getPossibleGenericSignatures(called: Expression, typeArgumentCount: number, checker: TypeChecker): ReadonlyArray<Signature> {
const type = checker.getTypeAtLocation(called)!; // TODO: GH#18217
const signatures = isNewExpression(called.parent) ? type.getConstructSignatures() : type.getCallSignatures();
Copy link
Member

Choose a reason for hiding this comment

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

the whole purpose of this function was to do syntactic scan on tokens since the tree cant be guaranteed. Eg. what if someone was writing new Type<Type<

Copy link
Member

Choose a reason for hiding this comment

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

Isn't this still issue with generic signature help? Create a type that has construct and call signature and see that in case of new C<C< the signature help should return construct signature but this will return call signature?

@ghost
Copy link
Author

ghost commented Jun 26, 2018

@sheetalkamat Please re-review

@ghost ghost merged commit 52486ae into master Jul 11, 2018
@ghost ghost deleted the isPossiblyTypeArgumentPosition branch July 11, 2018 18:15
This pull request was closed.
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.

1 participant