Skip to content

Commit

Permalink
use AutomaticWorkspaceInit in AdaptiveLSP correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAngryByrd committed Mar 19, 2023
1 parent 4eb9360 commit e54bc7d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/FsAutoComplete/LspServers/AdaptiveFSharpLspServer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1960,9 +1960,10 @@ type AdaptiveFSharpLspServer(workspaceLoader: IWorkspaceLoader, lspClient: FShar
| None -> p.RootPath

let projs =
match actualRootPath with
| None -> []
| Some actualRootPath ->
match p.RootPath, c.AutomaticWorkspaceInit with
| None, _
| _, false -> workspacePaths |> AVal.force
| Some actualRootPath, true ->
let peeks =
WorkspacePeek.peek
actualRootPath
Expand All @@ -1986,13 +1987,15 @@ type AdaptiveFSharpLspServer(workspaceLoader: IWorkspaceLoader, lspClient: FShar
sln.Items |> List.collect Workspace.foldFsproj |> List.map fst
| _ -> []
|> List.map (Utils.normalizePath)
|> HashSet.ofList
|> WorkspaceChosen.Projs

transact (fun () ->
rootPath.Value <- actualRootPath
clientCapabilities.Value <- p.Capabilities
lspClient.ClientCapabilities <- p.Capabilities
updateConfig c
workspacePaths.Value <- WorkspaceChosen.Projs(HashSet.ofList projs))
workspacePaths.Value <- projs)

let defaultSettings =
{ Helpers.defaultServerCapabilities with
Expand Down

0 comments on commit e54bc7d

Please sign in to comment.