@@ -6,7 +6,6 @@ open System
66open System.Collections .Generic
77open ParallelTypeCheckingTests
88open ParallelTypeCheckingTests.FileInfoGathering
9- open ParallelTypeCheckingTests.Graph
109open ParallelTypeCheckingTests.Types
1110open FSharp.Compiler .Syntax
1211
@@ -30,12 +29,13 @@ type DepsResult =
3029 Files : FileData []
3130 Graph : DepsGraph
3231 }
32+ with member this.Edges () = this.Graph |> Graph.collectEdges
3333
3434type References = Reference seq
3535
3636/// Algorithm for automatically detecting (lack of) file dependencies based on their AST contents
3737[<RequireQualifiedAccess>]
38- module internal AutomatedDependencyResolving =
38+ module internal DependencyResolution =
3939
4040 /// Eg. 'A' and 'B' in "module A.B"
4141 type ModuleSegment = string
@@ -142,20 +142,22 @@ module internal AutomatedDependencyResolving =
142142 printfn $" {backed.Length} backed files found"
143143 let filesWithModuleAbbreviations =
144144 nodes
145- |> Array.filter ( fun n -> n.Data.Abbreviations |> Array.exists ( function Abbreviation.ModuleAbbreviation _ -> true | _ -> false ))
145+ |> Array.filter ( fun n ->
146+ n.Data.Abbreviations
147+ |> Array.exists ( function Abbreviation.ModuleAbbreviation -> true | _ -> false ))
146148
147149 let trie = buildTrie nodes
148150
149151 let fsiFiles =
150152 nodes
151- |> Array.filter ( fun f -> f.File.Name.EndsWith " .fsi " )
153+ |> Array.filter ( fun f -> match f.File.AST with | ASTOrX.AST ( ParsedInput.SigFile _) -> true | _ -> false )
152154
153155 let processFile ( node : FileData ) =
154156 let deps =
155157 let fsiDep =
156158 if node.File.FsiBacked then
157159 nodes
158- |> Array.find ( fun x -> x.File.Name = node.File.Name + " i " )
160+ |> Array.find ( fun x -> x.File.QualifiedName = node.File.QualifiedName )
159161 |> fun x -> [| x|]
160162 else
161163 [||]
@@ -239,7 +241,7 @@ module internal AutomatedDependencyResolving =
239241 reachable
240242 |> Seq.collect ( fun node -> node.Files)
241243 // TODO Temporary - Add all nodes
242- |> Seq.append nodes
244+ // |> Seq.append nodes
243245 // If not, then the below is not necessary.
244246 // Assume that this file depends on all files that have any module abbreviations
245247 // TODO Handle module abbreviations in a better way
0 commit comments