Skip to content

Commit 15c9f4f

Browse files
authored
Enable seamless support for Reference Assemblies (#1228)
* update ProjInfo to enable support * enable reference assemblies for FSharpProjectReferences
1 parent c062df2 commit 15c9f4f

File tree

5 files changed

+11
-23
lines changed

5 files changed

+11
-23
lines changed

global.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"sdk": {
33
"version": "7.0.400",
4+
"rollForward": "major",
45
"allowPrerelease": true
56
}
67
}

paket.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,25 +137,25 @@ NUGET
137137
FSharp.Core (>= 6.0)
138138
Newtonsoft.Json (>= 13.0.1)
139139
StreamJsonRpc (>= 2.16.36)
140-
Ionide.ProjInfo (0.62)
140+
Ionide.ProjInfo (0.63)
141141
FSharp.Core (>= 7.0.400) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
142142
Ionide.ProjInfo.Sln (>= 0.62) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
143143
Microsoft.Build (>= 17.2) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
144144
Microsoft.Build.Framework (>= 17.2) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
145145
SemanticVersioning (>= 2.0.2) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
146-
Ionide.ProjInfo.FCS (0.62)
146+
Ionide.ProjInfo.FCS (0.63)
147147
FSharp.Compiler.Service (>= 43.7.400) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
148148
FSharp.Core (>= 7.0.400) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
149149
Ionide.ProjInfo (>= 0.62) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
150-
Ionide.ProjInfo.ProjectSystem (0.62)
150+
Ionide.ProjInfo.ProjectSystem (0.63)
151151
FSharp.Compiler.Service (>= 43.7.400) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
152152
FSharp.Control.Reactive (>= 5.0.5) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
153153
FSharp.Core (>= 7.0.400) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
154154
Ionide.ProjInfo (>= 0.62) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
155155
Ionide.ProjInfo.FCS (>= 0.62) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
156156
Ionide.ProjInfo.Sln (>= 0.62) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
157157
Newtonsoft.Json (>= 13.0.1) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
158-
Ionide.ProjInfo.Sln (0.62)
158+
Ionide.ProjInfo.Sln (0.63)
159159
LinkDotNet.StringBuilder (1.18)
160160
McMaster.NETCore.Plugins (1.4) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
161161
Microsoft.DotNet.PlatformAbstractions (>= 3.1.6) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= netcoreapp2.1)) (&& (== netstandard2.1) (>= netcoreapp2.1))

src/FsAutoComplete.Core/Consts.fs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,4 @@ module ProjectLoader =
44
[<Literal>]
55
let ProduceReferenceAssembly = "ProduceReferenceAssembly"
66

7-
let globalProperties =
8-
[
9-
// For tooling we don't want to use Reference Assemblies as this doesn't play well with type checking across projects
10-
ProduceReferenceAssembly, "false" ]
7+
let globalProperties = []

src/FsAutoComplete.Core/State.fs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,9 @@ module ProjInfoExtensions =
1919
type FSharpReferencedProject with
2020

2121
member x.ProjectFilePath =
22-
let rCase, fields =
23-
FSharp.Reflection.FSharpValue.GetUnionFields(
24-
x,
25-
typeof<FSharpReferencedProject>,
26-
System.Reflection.BindingFlags.Public
27-
||| System.Reflection.BindingFlags.NonPublic
28-
||| System.Reflection.BindingFlags.Instance
29-
)
30-
31-
if rCase.Name = "FSharpReference" then
32-
(fields[1] :?> FSharpProjectOptions).ProjectFileName |> Some
33-
else
34-
None
22+
match x with
23+
| FSharpReferencedProject.FSharpReference(options = options) -> options.ProjectFileName |> Some
24+
| _ -> None
3525

3626
type FSharpProjectOptions with
3727

src/FsAutoComplete/LspServers/AdaptiveServerState.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ type AdaptiveState(lspClient: FSharpLspClient, sourceTextFactory: ISourceTextFac
773773
for p in projectOptions do
774774
logger.info (
775775
Log.setMessage "Found BaseIntermediateOutputPath of {path}"
776-
>> Log.addContextDestructured "path" p.Properties
776+
>> Log.addContextDestructured "path" ((|BaseIntermediateOutputPath|_|) p.Properties)
777777
)
778778

779779
// Collect other files that should trigger a reload of a project
@@ -853,7 +853,7 @@ type AdaptiveState(lspClient: FSharpLspClient, sourceTextFactory: ISourceTextFac
853853
let ws =
854854
{ ProjectFileName = projectFileName
855855
ProjectFiles = responseFiles
856-
OutFileOpt = Option.ofObj projectOption.TargetPath
856+
OutFileOpt = Option.ofObj projectOption.ResolvedTargetPath
857857
References = references
858858
Extra = projectOption
859859
ProjectItems = projViewerItemsNormalized.Items

0 commit comments

Comments
 (0)