Skip to content

Conversation

@a-tarasyuk
Copy link
Contributor

Fixes #54463

This issue is a regression - If the source file doesn't exist in the program, the refactoring should generate a new file. However, there is a scenario where the file exists but is not included in the list of program files.

@DanielRosenwasser I'm not certain if it is acceptable to parse the existing file and add changes to it.

@typescript-bot typescript-bot added the For Milestone Bug PRs that fix a bug with a specific milestone label Jun 1, 2023
@DanielRosenwasser DanielRosenwasser requested review from andrewbranch, gabritto and navya9singh and removed request for andrewbranch June 1, 2023 17:34
@andrewbranch
Copy link
Member

andrewbranch commented Jun 1, 2023

We decided that cross-project moves won’t be supported for now. I think the refactor just shouldn’t be offered if the target file exists but isn’t in the program.

@a-tarasyuk
Copy link
Contributor Author

@andrewbranch Is it necessary to provide a specific message for that particular case?

@andrewbranch
Copy link
Member

I think that would be good, but we might need to discuss what the message should be. The problem is that inferred projects only contain open files, so this feature is very limited for users with no tsconfig. They probably think of their project as all files in the open directory, but from TSServer’s point of view, the “project” is only the open files. So saying something like “Cannot move to file outside the current project” won’t make much sense to those users.

@a-tarasyuk a-tarasyuk marked this pull request as ready for review June 5, 2023 16:01
@DanielRosenwasser DanielRosenwasser merged commit 93ac5c6 into microsoft:main Jun 6, 2023
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Milestone Bug PRs that fix a bug with a specific milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move to existing file — Error: Debug Failure. at doChange4

5 participants