Skip to content

Commit 53aabd7

Browse files
committed
fix search
1 parent 2aa7e3f commit 53aabd7

File tree

3 files changed

+10
-23
lines changed

3 files changed

+10
-23
lines changed

src/fsharp/ReferenceResolver.fs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,13 @@ let SimplisticResolver =
118118
if System.Environment.OSVersion.Platform = System.PlatformID.Win32NT then
119119
yield! registrySearchPaths() ]
120120

121-
for (baggage,r) in references do
121+
for (r, baggage) in references do
122122
try
123+
printfn "resolving %s" r
123124
let mutable found = false
124125
let success path =
125126
if not found then
127+
printfn "resolved %s --> %s" r path
126128
found <- true
127129
results.Add { itemSpec = path; prepareToolTip = snd; baggage=baggage }
128130

@@ -140,7 +142,6 @@ let SimplisticResolver =
140142
| s -> s
141143
PF + @"\Reference Assemblies\Microsoft\FSharp\.NETFramework\v4.0\" + n.Version.ToString()
142144
let trialPath = Path.Combine(fscoreDir0,n.Name + ".dll")
143-
printfn "searching %s" trialPath
144145
if FileSystem.SafeExists(trialPath) then
145146
success trialPath
146147

@@ -163,11 +164,11 @@ let SimplisticResolver =
163164
if FileSystem.SafeExists(trialPath) then
164165
success trialPath
165166

166-
if not found then
167-
let ass = try Some (Assembly.Load(r)) with _ -> None
168-
match ass with
169-
| Some ass -> success ass.Location
170-
| None -> ()
167+
//if not found then
168+
// let ass = try Some (Assembly.Load(r)) with _ -> None
169+
// match ass with
170+
// | Some ass -> success ass.Location
171+
// | None -> ()
171172
with e -> logWarning "SR001" (e.ToString())
172173
results.ToArray() }
173174

@@ -186,15 +187,15 @@ let fscoreDir =
186187
System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory()
187188

188189
let resolve s =
189-
SimplisticResolver.Resolve(ResolutionEnvironment.CompileTimeLike,[| for a in s -> ("", a) |],"v4.5.1", [SimplisticResolver.DotNetFrameworkReferenceAssembliesRootDirectory + @"\v4.5.1" ],"", "", fscoreDir,[],__SOURCE_DIRECTORY__,ignore, (fun _ _ -> ()), (fun _ _-> ()))
190+
SimplisticResolver.Resolve(ResolutionEnvironment.CompileTimeLike,[| for a in s -> (a, "") |],"v4.5.1", [SimplisticResolver.DotNetFrameworkReferenceAssembliesRootDirectory + @"\v4.5.1" ],"", "", fscoreDir,[],__SOURCE_DIRECTORY__,ignore, (fun _ _ -> ()), (fun _ _-> ()))
190191

191192
resolve ["System"; "mscorlib"; "mscorlib.dll"; "FSharp.Core"; "FSharp.Core.dll"; "Microsoft.SqlServer.Dmf.dll"; "Microsoft.SqlServer.Dmf" ]
192193

193194
resolve [ "FSharp.Core, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" ]
194195
#endif
195196

196197
let GetDefaultResolver(msbuildEnabled: bool, msbuildVersion: string option) =
197-
//let msbuildEnabled = msbuildEnabled && false
198+
let msbuildEnabled = msbuildEnabled && false
198199
let tryMSBuild v =
199200
if msbuildEnabled then
200201
// Detect if MSBuild v12 is on the machine, if so use the resolver from there

tests/service/FSharp.Compiler.Service.Tests.fsproj

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,6 @@
9999
<Project>{887630a3-4b1d-40ea-b8b3-2d842e9c40db}</Project>
100100
<Private>True</Private>
101101
</ProjectReference>
102-
<ProjectReference Include="data\TestTP\TestTP.fsproj">
103-
<Name>TestTP</Name>
104-
<Project>{ff76bd3c-5e0a-4752-b6c3-044f6e15719b}</Project>
105-
<Private>True</Private>
106-
</ProjectReference>
107102
</ItemGroup>
108103
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
109104
<ItemGroup>

tests/service/ProjectAnalysisTests.fs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4510,15 +4510,6 @@ module Project35b =
45104510
let options = checker.GetProjectOptionsFromScript(fileName1, fileSource1) |> Async.RunSynchronously
45114511
#endif
45124512

4513-
[<Test>]
4514-
let ``Test project35b Dependency files for ParseFileInProject`` () =
4515-
// This is testing legacy functionality
4516-
let parseFileResults = checker.ParseFileInProject(Project35b.fileName1, Project35b.fileSource1, Project35b.options) |> Async.RunSynchronously
4517-
for d in parseFileResults.DependencyFiles do
4518-
printfn "ParseFileInProject dependency: %s" d
4519-
parseFileResults.DependencyFiles |> List.exists (fun s -> s.Contains "notexist.dll") |> shouldEqual true
4520-
parseFileResults.DependencyFiles |> List.exists (fun s -> s.Contains Project35b.fileName1) |> shouldEqual true
4521-
45224513
[<Test>]
45234514
let ``Test project35b Dependency files for ParseAndCheckFileInProject`` () =
45244515
let checkFileResults =

0 commit comments

Comments
 (0)