Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Commit da0b600

Browse files
TIHanKevinRansom
authored andcommitted
Fixed referencing cross projects (#5698)
* Fixed referencing cross projects * Fixed legacy project referencing CPS style project
1 parent 7791976 commit da0b600

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

vsintegration/src/FSharp.Editor/LanguageService/ProjectSitesAndFiles.fs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ type internal ProjectSitesAndFiles() =
225225
let getReferencesForSolutionService (solutionService:IVsSolution) =
226226
[|
227227
match referencedProjects projectSite, extraProjectInfo with
228-
| None, Some (:? VisualStudioWorkspaceImpl as workspace) when not (isNull workspace.CurrentSolution)->
228+
| _, Some (:? VisualStudioWorkspaceImpl as workspace) when not (isNull workspace.CurrentSolution)->
229229
let path = projectSite.ProjectFileName
230230
if not (String.IsNullOrWhiteSpace(path)) then
231231
match projectIdOpt with
@@ -241,13 +241,15 @@ type internal ProjectSitesAndFiles() =
241241
yield Some project.Id, project.FilePath, outputPath, siteProvider
242242
| _ -> ()
243243

244-
| (Some references), _ ->
244+
| (Some references), Some (:? VisualStudioWorkspaceImpl as workspace) ->
245245
for p in references do
246246
match solutionService.GetProjectOfUniqueName(p.UniqueName) with
247247
| VSConstants.S_OK, (:? IProvideProjectSite as ps) ->
248-
yield None, p.FileName, (fullOutputAssemblyPath p) |> Option.defaultValue "", ps
248+
let path = ps.GetProjectSite().ProjectFileName
249+
let projectId = workspace.ProjectTracker.GetOrCreateProjectIdForPath(path, projectDisplayNameOf path)
250+
yield Some projectId, p.FileName, (fullOutputAssemblyPath p) |> Option.defaultValue "", ps
249251
| _ -> ()
250-
| None, _ -> ()
252+
| _ -> ()
251253
|]
252254
let solutionService = try Some (serviceProvider.GetService(typeof<SVsSolution>) :?> IVsSolution) with _ -> None
253255
seq { match solutionService with

0 commit comments

Comments
 (0)