Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Jul 13, 2018

@DanielRosenwasser Could you check if this fixes #25560 ?
Should fix #24857 too

@ghost
Copy link
Author

ghost commented Jul 13, 2018

Waiting for review from @DanielRosenwasser

private mapTextChangeToCodeEditUsingScriptInfoOrConfigFile(change: FileTextChanges): protocol.FileCodeEdits {
return mapTextChangesToCodeEditsUsingScriptInfoOrConfig(change, this.projectService.getScriptInfoOrConfig(this.normalizePath(change.fileName)));
private mapTextChangeToCodeEdit(change: FileTextChanges): protocol.FileCodeEdits {
return mapTextChangesToCodeEdits(change, this.projectService.getScriptInfoOrConfig(this.normalizePath(change.fileName)));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think you want to convert the fileName to normalizePath.. Instead you want to pass it as is to the getScriptOfConfig and there you will do the right thing.

private mapTextChangeToCodeEditUsingScriptInfoOrConfigFile(change: FileTextChanges): protocol.FileCodeEdits {
return mapTextChangesToCodeEditsUsingScriptInfoOrConfig(change, this.projectService.getScriptInfoOrConfig(this.normalizePath(change.fileName)));
private mapTextChangeToCodeEdit(change: FileTextChanges): protocol.FileCodeEdits {
return mapTextChangesToCodeEdits(change, this.projectService.getScriptInfoOrConfig(this.normalizePath(change.fileName)));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add test for the scenario @DanielRosenwasser was seeing where in the buffer was buffer with dynamic file name

@mhegazy
Copy link
Contributor

mhegazy commented Jul 18, 2018

@Andy-MS can you please port this to release-3.0 as well.

@ghost ghost merged commit 2701f78 into master Jul 18, 2018
@ghost ghost deleted the scriptInfoForLocations branch July 18, 2018 20:02
ghost pushed a commit that referenced this pull request Jul 18, 2018
…5623)

* Consistently use ScriptInfo for converting positions to Locations

* Code review
ghost pushed a commit that referenced this pull request Jul 18, 2018
…5623) (#25777)

* Consistently use ScriptInfo for converting positions to Locations

* Code review
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quick fix triggers debug assert "rename file" and "move to new file" refactors do not work when using files

2 participants