-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Update Getting Started Docs: Calling Analyzers w/ FAKE #225
Changes from 1 commit
9196777
020b964
ba24710
67bf90a
6798d4d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
(** | ||
--- | ||
category: end-users | ||
categoryindex: 1 | ||
index: 5 | ||
categoryindex: 2 | ||
index: 4 | ||
--- | ||
|
||
# Unit testing an analyzer | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
category: getting-started | ||
categoryindex: 1 | ||
index: 3 | ||
--- | ||
|
||
# Command Line Arguments | ||
|
||
## Example Command | ||
|
||
When running the CLI tool from the command line, the bare minimum you need to provide is the path to the project file(s) you want to analyze. | ||
|
||
```shell | ||
dotnet fsharp-analyzers --project ./YourProject.fsproj | ||
``` | ||
|
||
An optional argument you may need to provide is `--analyzers-path`. This is the path to the directory containing the analyzer DLLs. | ||
|
||
```shell | ||
dotnet fsharp-analyzers --project ./YourProject.fsproj --analyzers-path ./path/to/analyzers/directory | ||
``` | ||
|
||
⚠️ If you don't provide this argument, it will default to `packages/analyzers`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is really a Paket thing and should be mentioned as such. Folks using NuGet might not get how you can ever download the analyzers in that folder. |
||
|
||
## Viewing Additional Commands | ||
|
||
You can view the full list of commands available by running: | ||
|
||
```shell | ||
dotnet fsharp-analyzers --help | ||
``` | ||
|
||
[Next]({{fsdocs-next-page-link}}) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
category: getting-started | ||
categoryindex: 1 | ||
index: 2 | ||
--- | ||
|
||
# Configuring for the IDE | ||
|
||
## Visual Studio Code | ||
|
||
In order to configure analyzers for VSCode, you will need to update your project's `.vscode/settings.json` file or your user settings. You should only need the following settings: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @TheAngryByrd, where can people find the log if there's an SDK mismatch? Users may use older analyzers, which might not be detected by the tooling. I believe we mention this somewhere. I suggest including an explanation on this page about where this information will be displayed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Briefly looking at the code, I'm not sure we actually log this correctly. Added issue here: ionide/FsAutoComplete#1350 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alright, thanks, @1eyewonder maybe we just link to that issue in the docs. |
||
|
||
```json | ||
{ | ||
"FSharp.enableAnalyzers": true, | ||
"FSharp.analyzersPath": ["packages/analyzers"] | ||
} | ||
``` | ||
|
||
📓 Note: The path in `FSharp.analyzersPath` above is currently pointing to the path we set up in the Paket example on the [installation page]({{fsdocs-previous-page-link}}). | ||
|
||
After saving your new settings, make sure to restart VSCode. Once VSCode restarts, you should be able to test and see if the analyzers are working by opening a F# file in your workspace and entering the following code | ||
|
||
 | ||
|
||
[Next]({{fsdocs-next-page-link}}) |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,50 @@ | ||||||
--- | ||||||
category: getting-started | ||||||
categoryindex: 1 | ||||||
index: 1 | ||||||
--- | ||||||
# Installation | ||||||
|
||||||
## Installing the Tool | ||||||
|
||||||
A dotnet CLI tool, called [fsharp-analyzers](https://github.com/ionide/FSharp.Analyzers.SDK/), is used to run analyzers outside the context of an IDE. Add it to your tool-manifest with: | ||||||
|
||||||
```shell | ||||||
dotnet tool install fsharp-analyzers | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
``` | ||||||
|
||||||
## Installing Analyzers | ||||||
|
||||||
### Suggested Packages | ||||||
|
||||||
1. [Ionide Analyzers](https://github.com/ionide/FSharp.Analyzers.SDK/) | ||||||
2. [G-Research Analyzers](https://github.com/G-Research/fsharp-analyzers/) | ||||||
|
||||||
### Nuget | ||||||
|
||||||
If you are using Nuget as your package manager, add the `PackageReference` pointing to your favorite analyzers to the `.fsproj` file of the project you want to analyze. | ||||||
|
||||||
```xml | ||||||
<PackageReference Include="G-Research.FSharp.Analyzers" Version="0.12.1"> | ||||||
<PrivateAssets>all</PrivateAssets> | ||||||
<IncludeAssets>analyzers</IncludeAssets> | ||||||
</PackageReference> | ||||||
<PackageReference Include="Ionide.Analyzers" Version="0.28.0"> | ||||||
<PrivateAssets>all</PrivateAssets> | ||||||
<IncludeAssets>analyzers</IncludeAssets> | ||||||
</PackageReference> | ||||||
``` | ||||||
|
||||||
### Paket | ||||||
|
||||||
If you are using Paket as your package manager, add the package to your `paket.dependencies` file. The example below uses a paket group, but it is not required. | ||||||
|
||||||
```paket | ||||||
group analyzers | ||||||
source https://api.nuget.org/v3/index.json | ||||||
|
||||||
nuget Ionide.Analyzers | ||||||
nuget G-Research.FSharp.Analyzers | ||||||
``` | ||||||
|
||||||
[Next]({{fsdocs-next-page-link}}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be a bit misleading. It sounds like something will happen simply by downloading the tool and pointing it to a project, but you actually need to provide an analyzer.
The default argument will only have an effect if you:
This scenario seems quite unlikely at this point. It might be better to mention later that if you omit the
--analyzers-path
, it defaults topackages/analyzers
.