Merge pull request #24820 from amcasey/RenameNormalize

Normalize paths in GetEditsForFileRename
This commit is contained in:
Andrew Casey 2018-06-11 10:01:58 -07:00 committed by GitHub
commit e5597eec81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1700,7 +1700,7 @@ namespace ts.server {
private getEditsForFileRename(args: protocol.GetEditsForFileRenameRequestArgs, simplifiedResult: boolean): ReadonlyArray<protocol.FileCodeEdits> | ReadonlyArray<FileTextChanges> {
const { file, project } = this.getFileAndProject(args);
const changes = project.getLanguageService().getEditsForFileRename(args.oldFilePath, args.newFilePath, this.getFormatOptions(file), this.getPreferences(file));
const changes = project.getLanguageService().getEditsForFileRename(toNormalizedPath(args.oldFilePath), toNormalizedPath(args.newFilePath), this.getFormatOptions(file), this.getPreferences(file));
return simplifiedResult ? this.mapTextChangesToCodeEdits(project, changes) : changes;
}