Skip to content

Commit

Permalink
warning message
Browse files Browse the repository at this point in the history
  • Loading branch information
baronfel committed Jul 29, 2023
1 parent cdbb771 commit f225697
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/Components/CSharpExtensionSupport.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ module CSharpExtension =
let private msCSharpExtensionName = "ms-vscode.csharp"
let private openvsixCSharpExtensionName = "ms-vscode.csharp"

let private resolvedCSharpExtensionName = msCSharpExtensionName

let mutable private hasLookedForCSharp = false
let mutable private hasCSharp = false
let mutable private csharpExtension: Extension<obj> = null
let mutable private hasWarned = false

let private csharpAvailableContext: bool -> unit =
let fn = Context.cachedSetter "fsharp.debuggerAvailable"
fun value ->
Expand All @@ -19,16 +23,19 @@ module CSharpExtension =
let isCSharpAvailable () = hasCSharp

let tryFindCSharpExtension() =
if hasLookedForCSharp
then hasCSharp
else
match extensions.getExtension msCSharpExtensionName with
if not hasLookedForCSharp
then
match extensions.getExtension resolvedCSharpExtensionName with
| None ->
csharpAvailableContext false
| Some e ->
csharpExtension <- e
csharpAvailableContext true
hasLookedForCSharp <- true
hasCSharp
hasCSharp

let warnAboutMissingCSharpExtension() = ()
let warnAboutMissingCSharpExtension() =
if not hasWarned then
window.showWarningMessage($"The {resolvedCSharpExtensionName} extension isn't installed, so debugging and some build tools will not be available. Consider installing the {resolvedCSharpExtensionName} extension to enable those features.")
|> ignore
hasWarned <- true

0 comments on commit f225697

Please sign in to comment.