@@ -185,11 +185,15 @@ module Snapshots =
185185 )
186186
187187 loadedProjectsA
188- |> AMap.filter ( fun k _ ->
189- project.ReferencedProjects
190- |> List.exists ( fun x -> normalizePath x.ProjectFileName = k))
191- |> AMap.map ( fun _ proj ->
192- if proj.ProjectFileName.EndsWith " .fsproj" then
188+ |> AMap.choose ( fun localPath proj ->
189+ let loadedProjectNotReferenced =
190+ project.ReferencedProjects
191+ |> List.exists ( fun x -> normalizePath x.ProjectFileName = localPath)
192+ |> not
193+
194+ if loadedProjectNotReferenced then
195+ None
196+ else if proj.ProjectFileName.EndsWith " .fsproj" then
193197
194198 let resolvedTargetPath =
195199 aval {
@@ -205,10 +209,11 @@ module Snapshots =
205209 sourceTextFactory
206210 ( createReferences cachedSnapshots inMemorySourceFiles sourceTextFactory loadedProjectsA)
207211 |> createReferencedProjectsFSharpReference resolvedTargetPath
212+ |> Some
208213
209214 else
210215 // TODO: Find if this needs to be adaptive or if `getStamp` in a PEReference will be enough to break thru the caching in FCS
211- loadFromDotnetDll proj |> AVal.constant)
216+ loadFromDotnetDll proj |> AVal.constant |> Some )
212217 |> AMap.toASetValues
213218
214219 /// <summary>Creates a snapshot from a Project, using the already created snapshots it possible.</summary>
@@ -246,8 +251,8 @@ module Snapshots =
246251 let sourceFiles = // alist because order matters for the F# Compiler
247252 project.SourceFiles
248253 |> AList.ofList
249- |> AList.map Utils.normalizePath
250254 |> AList.map ( fun sourcePath ->
255+ let sourcePath = Utils.normalizePath sourcePath
251256
252257 aval {
253258 // prefer in-memory files over on-disk files
0 commit comments