Skip to content
This repository has been archived by the owner on Jan 16, 2022. It is now read-only.

Use with vs code via nuget package #83

Closed
jpeg729 opened this issue Aug 19, 2019 · 8 comments
Closed

Use with vs code via nuget package #83

jpeg729 opened this issue Aug 19, 2019 · 8 comments
Labels
abandon by the reporter Reporter is not responding. Not interested in collaboration. fix verification

Comments

@jpeg729
Copy link

jpeg729 commented Aug 19, 2019

Now that support for roslyn analysers and code fixes has been merged into omnisharp (c.f. OmniSharp/omnisharp-roslyn#1076) I would love to be able to use this with vs code.

Would you consider updating the nuget package?

@cezarypiatek
Copy link
Owner

MappingGenerator is mainly based on the code refactorings. Is it supported by VSCode?

@jpeg729
Copy link
Author

jpeg729 commented Aug 19, 2019

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.

@cezarypiatek
Copy link
Owner

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.

@cezarypiatek
Copy link
Owner

Ok, I've updated the Nuget package. Can you verify how it works on VSCode?

@jpeg729
Copy link
Author

jpeg729 commented Sep 1, 2019

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.

@cezarypiatek
Copy link
Owner

@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/

@p3t3rix
Copy link

p3t3rix commented Oct 17, 2019

Does this mean that the package should work as a standalone nuget package analyzer without installing it via vsix ?

@cezarypiatek
Copy link
Owner

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).

@cezarypiatek cezarypiatek added the abandon by the reporter Reporter is not responding. Not interested in collaboration. label Nov 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
abandon by the reporter Reporter is not responding. Not interested in collaboration. fix verification
Projects
None yet
Development

No branches or pull requests

3 participants