Skip to content

Commit

Permalink
Add setting to turn off test discovery on workspace load (#1919)
Browse files Browse the repository at this point in the history
  • Loading branch information
farlee2121 committed Aug 31, 2023
1 parent 07ad91b commit 1b7010b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions release/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,11 @@
"description": "Allow Ionide to prompt to use SdkScripts",
"type": "boolean"
},
"FSharp.TestExplorer.AutoDiscoverTestsOnLoad": {
"default": true,
"description": "Decides if the test explorer will automatically try discover tests when the workspace loads. You can still manually refresh the explorer to discover tests at any time",
"type": "boolean"
},
"FSharp.trace.server": {
"default": "off",
"description": "Trace server messages at the LSP protocol level for diagnostics.",
Expand Down
6 changes: 5 additions & 1 deletion src/Components/TestExplorer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1506,10 +1506,14 @@ let activate (context: ExtensionContext) =

testController.refreshHandler <- Some refreshHandler


let shouldAutoDiscoverTests =
Configuration.get true "FSharp.TestExplorer.AutoDiscoverTestsOnLoad"

let mutable hasInitiatedDiscovery = false

Project.workspaceLoaded.Invoke(fun () ->
if not hasInitiatedDiscovery then
if shouldAutoDiscoverTests && not hasInitiatedDiscovery then
hasInitiatedDiscovery <- true

let trxTests =
Expand Down

0 comments on commit 1b7010b

Please sign in to comment.