Add 'prefixText' and 'suffixText' when renaming shorthand properties#27356
Merged
3 commits merged intomasterfrom Sep 26, 2018
Merged
Add 'prefixText' and 'suffixText' when renaming shorthand properties#273563 commits merged intomasterfrom
3 commits merged intomasterfrom
Conversation
d8fb299 to
232e353
Compare
| return unwrapJSONCallResult(this.shim.findRenameLocations(fileName, position, findInStrings, findInComments)); | ||
| const res = unwrapJSONCallResult(this.shim.findRenameLocations(fileName, position, findInStrings, findInComments)) as ReadonlyArray<ts.RenameLocation>; | ||
| // JSON serialization removes undefined properties, so add them back if necessary. | ||
| return res.map((r): ts.RenameLocation => ({ prefixText: undefined, suffixText: undefined, ...r })); |
Member
There was a problem hiding this comment.
why? Not having those properties should result in same result as having them as undefined?
| } | ||
|
|
||
| export interface RenameTextSpan extends TextSpan { | ||
| readonly prefixText: string | undefined; |
Member
There was a problem hiding this comment.
Can you make these optional instead?
ef92a72 to
b7e3dbf
Compare
b7e3dbf to
6a8f472
Compare
mjbvz
approved these changes
Sep 26, 2018
Contributor
mjbvz
left a comment
There was a problem hiding this comment.
Protocol changes look good to me. Once this is merged, I'll add basic support in VS Code so users of TS@next can try it out before we pick up TS 3.2
Author
|
@sheetalkamat Good to merge? |
sheetalkamat
approved these changes
Sep 26, 2018
|
What if I want to call tsLanguageService.findRenameLocations(...) to rename the key of short hand property? It seems that I cannot use this api to achieve my goal right now. |
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 #12007