[Master] fix 16407 - LS in binding element of object binding pattern#16534
Merged
[Master] fix 16407 - LS in binding element of object binding pattern#16534
Conversation
f9dec04 to
3926c50
Compare
Member
|
I've iterated on yui's change - it no longer changes how we match up symbols in the checker, as that was breaking flow control analysis. Now, it does for object binding patterns a similar action as it does for property names in an object literal. The baseline changes are now nonexistent, and it is just new services functionality. |
amcasey
reviewed
Aug 10, 2017
src/services/goToDefinition.ts
Outdated
| declaration => createDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName)); | ||
| } | ||
|
|
||
| // If the node is an identifier in bindingelement of ObjectBindingPattern (Note: ArrayBindingPattern can only declaration) |
Member
There was a problem hiding this comment.
Would you mind rephrasing this a little? I find it a bit hard to follow.
amcasey
reviewed
Aug 10, 2017
src/services/goToDefinition.ts
Outdated
| // pr/*destination*/op1: number | ||
| // } | ||
| // bar<Test>(({pr/*goto*/op1})=>{}); | ||
| if (isPropertyName(node) && isBindingElement(node.parent) && isObjectBindingPattern(node.parent.parent) && (node.parent.propertyName ? node.parent.propertyName === node : node.parent.name === node)) { |
Member
There was a problem hiding this comment.
Alternatively, node === (node.parent.propertyName || node.parent.name).
266c208 to
7f568c3
Compare
Member
|
@amcasey done |
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.
Fix #16407
Because identifier in bindingElement in objectBindingPattern is considered declaration name, previously it will just return its symbol. So when perform goto-definition, it will simply just stay where it is
However, it is desirable to actually goto the
prop2in an interface. See: master...master-fix16407#diff-3c46922136bdd65e7a2c2d12db87bbe5....