Gu.Localization icon indicating copy to clipboard operation
Gu.Localization copied to clipboard

Handle undo add to resource.

Open JohanLarsson opened this issue 6 years ago • 2 comments

We need to undo the edit of the resx file and the generated file.

JohanLarsson avatar Apr 20 '18 18:04 JohanLarsson

Take a look at https://github.com/dotnet/roslyn/blob/master/src/VisualStudio/Core/Def/Packaging/PackageInstallerServiceFactory_UndoRedo.cs for how we do this in roslyn for uninstalling a nuget package on 'undo' if you install it with the lightbulb.

CyrusNajmabadi avatar Apr 20 '18 18:04 CyrusNajmabadi

Would adding the resx as an additional document and then do text.WithChanges(...) enable undo? Guess I can try it. Alternatively split it up in two code actions, one that adds and one that does the text.WithChanges(...) Also not sure if it will lead to other bs but guessing the sln is reparsed so that it does not matter.

JohanLarsson avatar Apr 20 '18 20:04 JohanLarsson