-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Conversation
Waiting for review from @DanielRosenwasser |
src/server/session.ts
Outdated
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))); |
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 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.
src/server/session.ts
Outdated
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))); |
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.
Add test for the scenario @DanielRosenwasser was seeing where in the buffer was buffer with dynamic file name
be082ac
to
e192c2c
Compare
@Andy-MS can you please port this to release-3.0 as well. |
…5623) * Consistently use ScriptInfo for converting positions to Locations * Code review
@DanielRosenwasser Could you check if this fixes #25560 ?
Should fix #24857 too