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

Support analysis for projects using Nuget #9

Open
Zaid-Ajaj opened this issue Jan 23, 2020 · 0 comments
Open

Support analysis for projects using Nuget #9

Zaid-Ajaj opened this issue Jan 23, 2020 · 0 comments

Comments

@Zaid-Ajaj
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Allow ionide to detect packages installed from nuget. Right now only paket seems to be supported since it installs the packages locally within packages/analyzers. Many projects might not be using paket (Feliz template for example). Requiring paket also makes the entry barrier higher if you just want to try out an analyzer with a console project.

Describe the solution you'd like
Finding the assemblies of analyzers will require some sort of local package resolution since nuget packages aren't installed in a local directory within a project (AFAIK at least).

Using a combination of the following commands, you can figure out where to find the analyzers:

dotnet nuget locals global-packages --list
info : global-packages: C:\Users\zaidn\.nuget\packages\

dotnet list package
Project 'OptionTest' has the following package references
   [netcoreapp3.1]:
   Top-level Package              Requested   Resolved
   > FSharp.Analyzers.Sample      1.2.0       1.2.0
   > FSharp.Core                  4.7.0       4.7.0

This way you can construct the path of the analyzer:

C:\Users\zaidn\.nuget\packages\{Analyzer}\{Resolved-Version}\lib\{ProjectFramework}\{Analyzer}.dll

For {ProjectFramework} I am not entirely sure how to figure out which target framework the analyzer was compiled with. One option is to find the first directory that starts with net or just loading whatever target framework that can be loaded

Describe alternatives you've considered
Require paket always

Additional context
N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant