From 4710a177356b542c16eceadecc6715691e34f5f9 Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Sat, 16 Sep 2017 02:27:16 -0700 Subject: [PATCH] merge --- .../ProjectSitesAndFiles.fs | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/vsintegration/src/FSharp.LanguageService/ProjectSitesAndFiles.fs b/vsintegration/src/FSharp.LanguageService/ProjectSitesAndFiles.fs index 57d7e4ee8..439e304a7 100644 --- a/vsintegration/src/FSharp.LanguageService/ProjectSitesAndFiles.fs +++ b/vsintegration/src/FSharp.LanguageService/ProjectSitesAndFiles.fs @@ -192,13 +192,27 @@ type internal ProjectSitesAndFiles() = if SourceFile.MustBeSingleFileProject(filename) then Debug.Assert(false, ".fsx or .fsscript should have been treated as implicit project") failwith ".fsx or .fsscript should have been treated as implicit project" - new ProjectSiteOfSingleFile(filename) :> IProjectSite - - member art.SetSource(buffer:IVsTextLines, source:IFSharpSource) : unit = + + static member GetReferencedProjectSites(projectSite:IProjectSite, serviceProvider:System.IServiceProvider) = + referencedProvideProjectSites (projectSite, serviceProvider) + |> Seq.map (fun (_, ps) -> ps.GetProjectSite()) + |> Seq.toArray + + member art.SetSource_DEPRECATED(buffer:IVsTextLines, source:IFSharpSource_DEPRECATED) : unit = let mutable guid = sourceUserDataGuid (buffer :?> IVsUserData).SetData(&guid, source) |> ErrorHandler.ThrowOnFailure |> ignore + /// Create project options for this project site. + static member GetProjectOptionsForProjectSite(enableInMemoryCrossProjectReferences, tryGetOptionsForReferencedProject, projectSite:IProjectSite,filename,extraProjectInfo,serviceProvider:System.IServiceProvider, useUniqueStamp) = + match projectSite with + | :? IHaveCheckOptions as hco -> hco.OriginalCheckOptions() + | _ -> + getProjectOptionsForProjectSite(enableInMemoryCrossProjectReferences, tryGetOptionsForReferencedProject, projectSite, filename, extraProjectInfo, serviceProvider, useUniqueStamp) + + /// Create project site for these project options + static member CreateProjectSiteForScript (filename, referencedProjectFileNames, checkOptions) = + ProjectSiteOfScriptFile (filename, referencedProjectFileNames, checkOptions) :> IProjectSite member art.TryGetSourceOfFile_DEPRECATED(rdt:IVsRunningDocumentTable, filename:string) : IFSharpSource_DEPRECATED option = match VsRunningDocumentTable.FindDocumentWithoutLocking(rdt,filename) with -- GitLab