Skip to content

Commit e8245d1

Browse files
committed
options.ReferencesOnDisk are not part of options.OtherOptions.
1 parent a2ed82b commit e8245d1

File tree

6 files changed

+14
-7
lines changed

6 files changed

+14
-7
lines changed

ReSharper.FSharp/src/FSharp/FSharp.Common/src/Checker/FcsCheckerService.fs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ type FcsProject =
7070
for option in projectSnapshot.OtherOptions do
7171
writer.WriteLine($" {option}")
7272

73+
writer.WriteLine("References on disk:")
74+
for r in projectSnapshot.ReferencesOnDisk do
75+
writer.WriteLine($" %s{r.Path}")
76+
7377
writer.WriteLine("Referenced projects:")
7478
for referencedProject in projectSnapshot.ReferencedProjects do
7579
writer.WriteLine($" {referencedProject.OutputFile}")
@@ -97,6 +101,7 @@ type FcsCheckerService(lifetime: Lifetime, logger: ILogger, onSolutionCloseNotif
97101
let setting = SettingsUtil.getEntry<FSharpOptions> settingsStore name
98102
settingsStoreLive.GetValueProperty(lifetime, setting, null)
99103

104+
// Hard coded for now.
100105
let useTransparentCompiler = true
101106
// (getSettingProperty "UseTransparentCompiler").Value
102107

@@ -180,6 +185,7 @@ type FcsCheckerService(lifetime: Lifetime, logger: ILogger, onSolutionCloseNotif
180185

181186
x.FcsProjectProvider.PrepareAssemblyShim(psiModule)
182187

188+
// TODO: should this be the non virtual path?
183189
let path = sourceFile.GetLocation().FullPath
184190
let source = FcsCheckerService.getSourceText sourceFile.Document
185191
logger.Trace("ParseAndCheckFile: start {0}, {1}", path, opName)

ReSharper.FSharp/src/FSharp/FSharp.Common/src/Checker/FcsProjectProvider.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ type FcsProjectProvider(lifetime: Lifetime, solution: ISolution, changeManager:
135135
newOptions.ProjectFileName = oldOptions.ProjectFileName &&
136136
newOptions.SourceFiles = oldOptions.SourceFiles &&
137137
newOptions.OtherOptions = oldOptions.OtherOptions &&
138+
newOptions.ReferencesOnDisk = oldOptions.ReferencesOnDisk &&
138139

139140
newOptions.ReferencedProjects.Length = oldOptions.ReferencedProjects.Length &&
140141
(newOptions.ReferencedProjects, oldOptions.ReferencedProjects)

ReSharper.FSharp/src/FSharp/FSharp.Common/src/Checker/ScriptFcsProjectProvider.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ type ScriptFcsProjectProvider(lifetime: Lifetime, logger: ILogger, checkerServic
196196
List.length l1 = List.length l2 && List.forall2 (=) l1 l2
197197

198198
listEq options1.OtherOptions options2.OtherOptions &&
199+
listEq options1.ReferencesOnDisk options2.ReferencesOnDisk &&
199200
listEq options1.SourceFiles options2.SourceFiles
200201

201202
if not (areEqualForChecking oldOptions.ProjectSnapshot newSnapshot) then

ReSharper.FSharp/src/FSharp/FSharp.Common/src/ProjectModel/FSharpScriptPsiModuleFactory.fs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,9 @@ type FSharpScriptPsiModulesProvider(lifetime: Lifetime, solution: ISolution, cha
6868

6969
let getScriptReferences (scriptPath: VirtualFileSystemPath) (scriptSnapshot: FSharpProjectSnapshot) =
7070
let assembliesPaths = HashSet<VirtualFileSystemPath>()
71-
for o in scriptSnapshot.OtherOptions do
72-
if o.StartsWith("-r:", StringComparison.Ordinal) then
73-
let path = VirtualFileSystemPath.TryParse(o.Substring(3), InteractionContext.SolutionContext)
74-
if not path.IsEmpty then assembliesPaths.Add(path) |> ignore
71+
for { Path = r } in scriptSnapshot.ReferencesOnDisk do
72+
let path = VirtualFileSystemPath.TryParse(r, InteractionContext.SolutionContext)
73+
if not path.IsEmpty then assembliesPaths.Add(path) |> ignore
7574

7675
let filesPaths = HashSet<VirtualFileSystemPath>()
7776
for file in scriptSnapshot.SourceFiles do

ReSharper.FSharp/src/FSharp/FSharp.Tests.Host/FSharpTestHost.fs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,8 @@ type FSharpTestHost(solution: ISolution, sourceCache: FSharpSourceCache, itemsCo
5656

5757
projectProvider.GetProjectSnapshot(sourceFile)
5858
|> Option.map (fun options ->
59-
options.OtherOptions
60-
|> List.choose (fun o -> if o.StartsWith("-r:") then Some (o.Substring("-r:".Length)) else None)
61-
|> List.map (fun p -> VirtualFileSystemPath.TryParse(p, InteractionContext.SolutionContext))
59+
options.ReferencesOnDisk
60+
|> List.map (fun { Path = p } -> VirtualFileSystemPath.TryParse(p, InteractionContext.SolutionContext))
6261
|> List.filter (fun p -> not p.IsEmpty && directory.IsPrefixOf(p))
6362
|> List.map (fun p -> p.Name)
6463
|> List)

ReSharper.FSharp/test/src/FSharp.Tests.Common/src/Common.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ type TestFcsProjectProvider(lifetime: Lifetime, checkerService: FcsCheckerServic
247247
newOptions.ProjectFileName = oldOptions.ProjectFileName &&
248248
newOptions.SourceFiles = oldOptions.SourceFiles &&
249249
newOptions.OtherOptions = oldOptions.OtherOptions &&
250+
newOptions.ReferencesOnDisk = oldOptions.ReferencesOnDisk &&
250251
getReferencedProjectOutputs newOptions = getReferencedProjectOutputs oldOptions
251252

252253
let getFcsProject (psiModule: IPsiModule) =

0 commit comments

Comments
 (0)