Skip to content

Consistently use ScriptInfo for converting positions to Locations #25623

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

Merged
2 commits merged into from
Jul 18, 2018

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
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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