Make goto-definition go to a signature declaration if possible#10593
Merged
5 commits merged intoSep 1, 2016
Merged
Conversation
6f2567e to
4514f8f
Compare
| return node && node.parent && node.parent.kind === SyntaxKind.NewExpression && (<CallExpression>node.parent).expression === node; | ||
| } | ||
|
|
||
| function getCallOrNewExpressionWorker(node: Node, kind: SyntaxKind): Node | undefined { |
Member
There was a problem hiding this comment.
Change the type of kind to SyntaxKind.CallExpression | SyntaxKind.NewExpression
Author
There was a problem hiding this comment.
We'd need to do a new LKG before using enums-as-unions.
Member
|
For the record, calls and If it's not too hard, it'd be ideal to keep the behavior consistent between them. |
Member
|
Can you also add a test for going to definition on a call where overload resolution failed? declare function doStuff(n: number): number;
declare function doStuff(s: string): string;
/**/doStuff(true);Ideally, the language service should still jump to one of the overloads. |
| function getAncestorCallLikeExpression(node: Node): CallLikeExpression | undefined { | ||
| const target = climbPastManyPropertyAccesses(node); | ||
| const callLike = target.parent; | ||
| return isCallLikeExpression(callLike) && getInvokedExpression(callLike) === target && callLike; |
| function getAncestorCallLikeExpression(node: Node): CallLikeExpression | undefined { | ||
| const target = climbPastManyPropertyAccesses(node); | ||
| const callLike = target.parent; | ||
| return callLike && isCallLikeExpression(callLike) && getInvokedExpression(callLike) === target && callLike; |
Author
There was a problem hiding this comment.
First one is checking whether it exists. Last one is returning it from the function.
|
Other than the comments, 👍 |
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #9269 and #10074