@@ -4,6 +4,7 @@ open System
44open FunScript
55open FunScript.TypeScript
66open FunScript.TypeScript .fs
7+ open FunScript.TypeScript .vscode
78open FunScript.TypeScript .child_process
89
910open DTO
@@ -116,12 +117,20 @@ module LanguageService =
116117 " " |> request ( url " compilerlocation" ) |> send 0
117118
118119 let start () =
119- let path = ( VSCode.getPluginPath " Ionide.Ionide-fsharp" ) + " /bin/FsAutoComplete.Suave.exe"
120- let child = if Process.isMono () then Globals.spawn( " mono" , [| path; string port|]) else Globals.spawn( path, [| string port|])
121- service <- Some child
122- child.stderr.on( " data" , unbox< Function>( fun n -> Globals.console.error ( n.ToString()))) |> ignore
123- child.stdout.on( " data" , unbox< Function>( fun n -> Globals.console.log ( n.ToString()))) |> ignore
124- ()
120+ try
121+ let path = ( VSCode.getPluginPath " Ionide.Ionide-fsharp" ) + " /bin/FsAutoComplete.Suave.exe"
122+ let child = if Process.isMono () then Globals.spawn( " mono" , [| path; string port|]) else Globals.spawn( path, [| string port|])
123+ service <- Some child
124+ child.stderr.on( " data" , unbox< Function>( fun n -> Globals.console.error ( n.ToString()))) |> ignore
125+ child.stdout.on( " data" , unbox< Function>( fun n -> Globals.console.log ( n.ToString()))) |> ignore
126+ with
127+ | _ ->
128+ if Process.isMono () then
129+ " Failed to start language services. Please check if mono is in PATH"
130+ else
131+ " Failed to start language services. Please check if Microsoft Built Tools 2013 are installed"
132+ |> window.Globals.showErrorMessage
133+ |> ignore
125134
126135 let stop () =
127136 service |> Option.iter ( fun n -> n.kill " SIGKILL" )
0 commit comments