Closed jpeg729 closed 4 years ago
MappingGenerator is mainly based on the code refactorings. Is it supported by VSCode?
The pull request I linked to claims to support "roslyn analyzers and code fixes", which suggests that they are supported. However, I only have partial success.
Quick testing with VS Code with dotnet core 2.2 running on linux shows that I can Ctrl+. on a class name and do things like "Generate constructor" and "Generate Equals and GetHashCode...".
More quick testing shows that adding the existing version of the nuget package MappingGenerator does not enable Ctrl+. for things that I regularly do in Visual Studio with the extension. I don't know why.
So basically, maybe refactorings are supported, and if not, but they probably will be soon.
Another approach is suggested by Roslynator that has just released an extension that supports VS Code, c.f. https://marketplace.visualstudio.com/items?itemName=josefpihrt-vscode.roslynator.
Thanks for the research. The current nuget package of MappingGenerator may not be completed (I tried to make it work a while ago but I didn't finish that). I will take a look an that in the free moment.
Ok, I've updated the Nuget package. Can you verify how it works on VSCode?
Thank you for your efforts, unfortunately I can't make it work on VS Code on Linux and I can't see why. I'll try on Windows tomorrow.
@jpeg729 Here's a very good description of how to use refactorings from VSIX with VSCode. Can you try it and let me know if this actually works for MappintGenerator?
https://www.strathweb.com/2017/05/using-roslyn-refactorings-with-omnisharp-and-visual-studio-code/
Does this mean that the package should work as a standalone nuget package analyzer without installing it via vsix ?
Analyzers and CodeFixes should work using NuGet package. Unfortunately, code refactorings - which are used as underlying mechanisms for most of the MappingGenerator features are not supported by NuGet package (Only Rider is able to load refactorings from NugetPackage, not sure about VS - maybe they change something recently).
Now that support for roslyn analysers and code fixes has been merged into omnisharp (c.f. https://github.com/OmniSharp/omnisharp-roslyn/pull/1076) I would love to be able to use this with vs code.
Would you consider updating the nuget package?