Skip to content

Commit

Permalink
Fix: Rename fails when declaration or usage in not-loaded files
Browse files Browse the repository at this point in the history
  • Loading branch information
Booksbaum and TheAngryByrd committed Feb 15, 2023
1 parent 0a5a058 commit 03a3cb5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/FsAutoComplete/LspServers/AdaptiveFSharpLspServer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -870,9 +870,15 @@ type AdaptiveFSharpLspServer(workspaceLoader: IWorkspaceLoader, lspClient: FShar
})

let getProjectOptionsForFile (filePath: string<LocalPath>) =
openFilesToChangesAndProjectOptions
|> AMap.tryFindA filePath
|> AVal.map (Option.map snd >> Option.defaultValue [])
aval {
match! sourceFileToProjectOptions |> AMap.tryFind filePath with
| None ->
// openFilesToChangesAndProjectOptions contains script files that we may need to look through
match! openFilesToChangesAndProjectOptions |> AMap.tryFindA filePath with
| None -> return []
| Some (_, projs) -> return projs
| Some projs -> return projs
}

let autoCompleteItems: cmap<DeclName, DeclarationListItem * Position * string<LocalPath> * (Position -> option<string>) * FSharp.Compiler.Syntax.ParsedInput> =
cmap ()
Expand Down

0 comments on commit 03a3cb5

Please sign in to comment.