Skip to content
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

"Revert Selected Ranges" not working- m.getChanges is not a function #171863

Closed
roblourens opened this issue Jan 20, 2023 · 5 comments · Fixed by #172137
Closed

"Revert Selected Ranges" not working- m.getChanges is not a function #171863

roblourens opened this issue Jan 20, 2023 · 5 comments · Fixed by #172137
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues important Issue identified as high-priority insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Milestone

Comments

@roblourens
Copy link
Member

image

2023-01-20 13:32:25.877 [error] TypeError: m.getChanges is not a function
    at cc.$getDiffInformation (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2301:14870)
    at m.N (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1573:15147)
    at m.M (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1573:14865)
    at m.H (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1573:13958)
    at m.G (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1573:12939)
    at vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1573:11727
    at p.invoke (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:86:145)
    at n.deliver (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:86:2029)
    at a.fire (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:86:1667)
    at r.fire (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:553:15221)
    at q.onmessage (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1671:1489) git.revertSelectedRanges {"value":"vscode.git","c":"vscode.git"}
@lszomoru lszomoru added bug Issue identified by VS Code Team member as probable bug git GIT issues labels Jan 20, 2023
@lszomoru lszomoru added this to the January 2023 milestone Jan 20, 2023
@DFelten
Copy link

DFelten commented Jan 22, 2023

I think on mac there is the same problem. When I try to revert a change within a file, there is a git error. But the git output is empty (or at least nothing new appears after trying to revert a change).

CleanShot 2023-01-22 at 14 07 10@2x

CleanShot 2023-01-22 at 14 05 23@2x

@lszomoru
Copy link
Member

@alexr00, it looks like this is a regression that was introduced with this commit.
In that commit the getChanges() method has been removed which unfortunately is used here:

return Promise.resolve((dirtyDiffContribution as any).getChanges());
}

I do not have full contact on why the as any cast is being used here. @joaomoreno do you have any context?

@lszomoru lszomoru added the important Issue identified as high-priority label Jan 23, 2023
@lszomoru
Copy link
Member

I have investigated some other issues and it looks like that commit might have a broader impact as the stage/revert changes commands also seem to be broken. The root cause is that the vscode.git extension is expecting LineChange[] while it gets LabeledChange[]. Let's get together first thing tomorrow morning to get to the bottom of this. Thanks!

alexr00 added a commit that referenced this issue Jan 24, 2023
alexr00 added a commit that referenced this issue Jan 24, 2023
@VSCodeTriageBot VSCodeTriageBot added the unreleased Patch has not yet been released in VS Code Insiders label Jan 24, 2023
@lszomoru
Copy link
Member

Thank you very much @alexr00 🎉

@VSCodeTriageBot VSCodeTriageBot added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Jan 25, 2023
@kamenminkov
Copy link

That was fixed so quickly that I didn't have time to complain :D
Thank you!

@roblourens roblourens added the verified Verification succeeded label Jan 25, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Mar 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues important Issue identified as high-priority insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants