You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/getting-started/Configuring for IDE.md
+57-4Lines changed: 57 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,46 @@ index: 2
6
6
7
7
# Configuring for the IDE
8
8
9
+
Currently, analyzers are only supported in FsAutocomplete/Ionide, which is used by Visual Studio Code and other editors that support the Language Server Protocol (LSP).
10
+
9
11
## Visual Studio Code
10
12
11
-
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 need the settings shown below.
13
+
In order to configure analyzers for VSCode, there are 2 ways.
14
+
15
+
### Using NuGet Packages
16
+
17
+
For each project where you want to enable analyzers, add the following to your `.fsproj` file:
or if using [Central Package Management](https://learn.microsoft.com/en-us/nuget/consume-packages/central-package-management) in your `Directory.Packages.props`:
**NOTE**: The `PrivateAssets="All"` is important to ensure that the analyzer package does not get included in your published application. See [Controlling dependency assets](https://learn.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files#controlling-dependency-assets) for more information.
41
+
42
+
After adding the package reference, you may need to do a `dotnet restore` to force FsAutocomplete to pick up the new analyzers for a specific project.
43
+
44
+
### Configure a predefined path
45
+
46
+
This is useful if you're using `paket` to install analyzers to a specific directory in your project or have custom built analyzers to test against.
47
+
48
+
You will need to update your project's `.vscode/settings.json` file or your user settings. You should need the settings shown below.
12
49
13
50
```json
14
51
{
@@ -17,10 +54,26 @@ In order to configure analyzers for VSCode, you will need to update your project
17
54
}
18
55
```
19
56
20
-
📓 Note: Issue created [here](https://github.com/ionide/FsAutoComplete/issues/1350) regarding analyzers & SDK mismatches in the logs
57
+
After saving your new settings, FsAutocomplete should try to reload analyzers.
58
+
59
+
---
60
+
21
61
22
-
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
62
+
63
+
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.
If not, you can enable `FSharp.verboseLogging`, restart VSCode, then open the Output pane (1) with the `F#` output channel selected (2).
70
+
71
+
```json
72
+
{
73
+
"FSharp.verboseLogging": true
74
+
}
75
+
```
76
+
77
+
You can then search (Cmd/Ctrl+F while in the Output pane) for `FsAutoComplete.Analyzer` (3) prefix in the log to see if analyzers are being loaded correctly.
0 commit comments