ionide / ionide/FSharp.Analyzers.SDK
Support analysis for projects using Nuget
- Dominant language
- F#
- Stars
- 85
- Forks
- 28
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 20
Description
**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:
```bash
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
Contributor guide
Assessment
This issue has not been assessed yet.