Skip to content

Commit

Permalink
Declarations only required ParseResults
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAngryByrd committed Jul 28, 2023
1 parent f97f9de commit 09c7a10
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/FsAutoComplete/LspServers/AdaptiveFSharpLspServer.fs
Expand Up @@ -1453,16 +1453,16 @@ type AdaptiveFSharpLspServer
|> AsyncAVal.forceAsync


let openFilesToCheckedDeclarations =
openFilesToCheckedFilesResults
let openFilesToDeclarations =
openFilesToParsedResults
|> AMap.map (fun k v ->
v
|> AsyncAVal.mapOption (fun c _ -> c.GetParseResults.GetNavigationItems().Declarations))
|> AsyncAVal.mapOption (fun p _ -> p.GetNavigationItems().Declarations))

let getAllDeclarations () =
let getAllOpenDeclarations () =
async {
let! results =
openFilesToCheckedDeclarations
openFilesToDeclarations
|> AMap.force
|> HashMap.toArray
|> Array.map (fun (k, v) ->
Expand All @@ -1477,7 +1477,7 @@ type AdaptiveFSharpLspServer
}

let getDeclarations filename =
openFilesToCheckedDeclarations |> AMapAsync.tryFindAndFlatten filename
openFilesToDeclarations |> AMapAsync.tryFindAndFlatten filename

let getFilePathAndPosition (p: ITextDocumentPositionParams) =
let filePath = p.GetFilePath() |> Utils.normalizePath
Expand Down Expand Up @@ -3198,7 +3198,7 @@ type AdaptiveFSharpLspServer

let glyphToSymbolKind = glyphToSymbolKind |> AVal.force

let! decls = getAllDeclarations ()
let! decls = getAllOpenDeclarations ()

let res =
decls
Expand Down

0 comments on commit 09c7a10

Please sign in to comment.