Skip to content

Commit

Permalink
let users know when debugging functionality lights up
Browse files Browse the repository at this point in the history
  • Loading branch information
baronfel committed Aug 5, 2023
1 parent ed848c4 commit 3c48c3f
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/Components/CSharpExtensionSupport.fs
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,24 @@ module CSharpExtension =

hasWarned <- true

let private notifyUserThatDebuggingWorks() =
window.showInformationMessage ($"The C# extension is installed, so debugging and build tools are now available for F# projects.")
|> ignore<Thenable<_>>

let activate (context: ExtensionContext) =
// when extensions are installed or removed we need to update our state for the C# extension
// so enablement/disablement works correctly
context.Subscribe(
extensions.onDidChange.Invoke(fun _ ->
tryFindCSharpExtension () |> ignore
None)
let previousCSharpValue = hasCSharp
hasLookedForCSharp <- false
let currentCSharpValue = tryFindCSharpExtension ()
match previousCSharpValue, currentCSharpValue with
| false, true -> notifyUserThatDebuggingWorks()
| true, false ->
hasWarned <- false
warnAboutMissingCSharpExtension()
| _ -> ()
None
)
)

0 comments on commit 3c48c3f

Please sign in to comment.