Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adaptive refactorings and fixing code lens reference setting #1052

Merged
merged 3 commits into from
Feb 4, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/FsAutoComplete.Core/CompilerServiceInterface.fs
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,8 @@ type FSharpCompilerServiceChecker(hasAnalyzers) =

/// This function is called when the entire environment is known to have changed for reasons not encoded in the ProjectOptions of any project/compilation.
member _.ClearCaches() =
let oldlastCheckResults = lastCheckResults
lastCheckResults.Dispose()
lastCheckResults <- memoryCache ()
oldlastCheckResults.Dispose()
checker.InvalidateAll()
checker.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients()

Expand All @@ -264,7 +263,6 @@ type FSharpCompilerServiceChecker(hasAnalyzers) =

let options = clearProjectReferences options
let path = UMX.untag filePath

try
let! (p, c) = checker.ParseAndCheckFileInProject(path, version, source, options, userOpName = opName)

Expand Down
6 changes: 6 additions & 0 deletions src/FsAutoComplete.Core/Utils.fs
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,12 @@ module List =
let maxUnderThreshold nmax =
List.maxBy (fun n -> if n > nmax then 0 else n)

/// Groups a tupled list by the first item to produce a list of values
let groupByFst (tupledItems : ('Key * 'Value) list ) =
tupledItems
|> List.groupBy(fst)
|> List.map (fun (key, list) -> key, list |> List.map snd)




Expand Down
Loading