-
Notifications
You must be signed in to change notification settings - Fork 12.8k
fix(57026): Renaming on declaration whose name is a String Literal #61353
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
Open
NamHaiBui
wants to merge
7
commits into
microsoft:main
Choose a base branch
from
SeniorSeminarGroup:57026
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a70c773
Fixes 57026
NamHaiBui 481f9c8
Merge branch 'main' of https://github.com/microsoft/TypeScript into 5…
NamHaiBui e59e213
Remove unnecessary comment
NamHaiBui eaa8990
Remove unneccessary code and finalized
NamHaiBui e59fdd5
Merge branch 'main' of https://github.com/microsoft/TypeScript into 5…
NamHaiBui ea220c1
Adding tests and changed property checking
NamHaiBui e39f5cd
Merge branch 'main' of https://github.com/microsoft/TypeScript into 5…
NamHaiBui File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
10 changes: 6 additions & 4 deletions
10
tests/baselines/reference/renameStringLiteralTypes5.baseline.jsonc
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
// === findRenameLocations === | ||
// === /tests/cases/fourslash/renameStringLiteralTypes5.ts === | ||
// type T = { | ||
// <|"[|Prop 1RENAME|]": string;|> | ||
// declare const Att_1: "[|Att 2RENAME|]"/*RENAME*/ | ||
// | ||
// interface Case_1 { | ||
// [Att_1]: string | ||
// } | ||
// | ||
// declare const fn: <K extends keyof T>(p: K) => void | ||
// declare const fnc_1: <K extends keyof Case_1>(p: K) => void | ||
// | ||
// fn("[|Prop 1RENAME|]"/*RENAME*/) | ||
// fnc_1("[|Att 2RENAME|]") |
9 changes: 9 additions & 0 deletions
9
tests/baselines/reference/renameStringLiteralTypes6.baseline.jsonc
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// === findRenameLocations === | ||
// === /tests/cases/fourslash/renameStringLiteralTypes6.ts === | ||
// interface Case_1 { | ||
// <|"[|Att 2RENAME|]"/*RENAME*/: string|> | ||
// } | ||
// | ||
// declare const fnc_1: <K extends keyof Case_1>(p: K) => void | ||
// | ||
// fnc_1("[|Att 2RENAME|]") |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
////type T = { | ||
//// "Prop 1": string; | ||
////declare const Att_1: "Att 2"/**/ | ||
//// | ||
////interface Case_1 { | ||
//// [Att_1]: string | ||
////} | ||
//// | ||
////declare const fn: <K extends keyof T>(p: K) => void | ||
////declare const fnc_1: <K extends keyof Case_1>(p: K) => void | ||
//// | ||
////fn("Prop 1"/**/) | ||
////fnc_1("Att 2") | ||
|
||
verify.baselineRename("", {}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/// <reference path="fourslash.ts" /> | ||
|
||
|
||
////interface Case_1 { | ||
//// "Att 2"/**/: string | ||
////} | ||
//// | ||
////declare const fnc_1: <K extends keyof Case_1>(p: K) => void | ||
//// | ||
////fnc_1("Att 2") | ||
|
||
verify.baselineRename("", {}); |
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.
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.
Why are these tests being modified rather than being added to, if anything?
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.
It was a duplicate test of renameStringLiteralTypes4 so I modified it to reflect one of the cases mentioned in the original issue.
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.
They are not duplicate tests. One is a
type
, the other is aninterface
.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.
I'm sorry about that, I will revert changes and add an additional tests for
type
as well. Thank you and sorry for the oversight.