@@ -36,7 +36,7 @@ type ProjectResponse =
3636/// Public API for any operations related to workspace and projects.
3737/// Internally keeps all the information related to project files in current workspace.
3838/// It's responsible for refreshing and caching - should be used only as source of information and public API
39- type ProjectController ( toolsPath : ToolsPath ) as x =
39+ type ProjectController ( toolsPath : ToolsPath , workspaceLoaderFactory : ToolsPath -> IWorkspaceLoader ) as x =
4040 let fileCheckOptions = ConcurrentDictionary< string, FSharpProjectOptions>()
4141 let projects = ConcurrentDictionary< string, Project>()
4242 let mutable isWorkspaceReady = false
@@ -165,7 +165,7 @@ type ProjectController(toolsPath: ToolsPath) as x =
165165 | delay when delay > TimeSpan.Zero -> do ! Async.Sleep( Environment.workspaceLoadDelay() .TotalMilliseconds |> int)
166166 | _ -> ()
167167
168- let loader = WorkspaceLoader.Create ( toolsPath)
168+ let loader = workspaceLoaderFactory toolsPath
169169
170170 let bindNewOnloaded ( n : WorkspaceProjectState ) : ProjectSystemState option =
171171 match n with
@@ -177,7 +177,8 @@ type ProjectController(toolsPath: ToolsPath) as x =
177177 | Ok optsDPW ->
178178 let view = ProjectViewer.render optsDPW
179179 Some( ProjectSystemState.Loaded( fcsOpts, optsDPW, view.Items, isFromCache))
180- | Error _ -> None //TODO not ignore the error
180+ | Error e -> Some( ProjectSystemState.Failed( e.ProjFile, e))
181+
181182 | WorkspaceProjectState.Failed ( path, e) ->
182183 let error = e
183184 Some( ProjectSystemState.Failed( path, error))
0 commit comments