Skip to content

Commit

Permalink
Enable seamless support for Reference Assemblies (#1228)
Browse files Browse the repository at this point in the history
* update ProjInfo to enable support

* enable reference assemblies for FSharpProjectReferences
  • Loading branch information
baronfel authored Feb 6, 2024
1 parent c062df2 commit 15c9f4f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 23 deletions.
1 change: 1 addition & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"sdk": {
"version": "7.0.400",
"rollForward": "major",
"allowPrerelease": true
}
}
8 changes: 4 additions & 4 deletions paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -137,25 +137,25 @@ NUGET
FSharp.Core (>= 6.0)
Newtonsoft.Json (>= 13.0.1)
StreamJsonRpc (>= 2.16.36)
Ionide.ProjInfo (0.62)
Ionide.ProjInfo (0.63)
FSharp.Core (>= 7.0.400) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Ionide.ProjInfo.Sln (>= 0.62) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Microsoft.Build (>= 17.2) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Microsoft.Build.Framework (>= 17.2) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
SemanticVersioning (>= 2.0.2) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Ionide.ProjInfo.FCS (0.62)
Ionide.ProjInfo.FCS (0.63)
FSharp.Compiler.Service (>= 43.7.400) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
FSharp.Core (>= 7.0.400) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Ionide.ProjInfo (>= 0.62) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Ionide.ProjInfo.ProjectSystem (0.62)
Ionide.ProjInfo.ProjectSystem (0.63)
FSharp.Compiler.Service (>= 43.7.400) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
FSharp.Control.Reactive (>= 5.0.5) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
FSharp.Core (>= 7.0.400) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Ionide.ProjInfo (>= 0.62) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Ionide.ProjInfo.FCS (>= 0.62) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Ionide.ProjInfo.Sln (>= 0.62) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Newtonsoft.Json (>= 13.0.1) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Ionide.ProjInfo.Sln (0.62)
Ionide.ProjInfo.Sln (0.63)
LinkDotNet.StringBuilder (1.18)
McMaster.NETCore.Plugins (1.4) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= net6.0)) (&& (== netstandard2.1) (>= net6.0))
Microsoft.DotNet.PlatformAbstractions (>= 3.1.6) - restriction: || (== net6.0) (== net7.0) (== net8.0) (&& (== netstandard2.0) (>= netcoreapp2.1)) (&& (== netstandard2.1) (>= netcoreapp2.1))
Expand Down
5 changes: 1 addition & 4 deletions src/FsAutoComplete.Core/Consts.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,4 @@ module ProjectLoader =
[<Literal>]
let ProduceReferenceAssembly = "ProduceReferenceAssembly"

let globalProperties =
[
// For tooling we don't want to use Reference Assemblies as this doesn't play well with type checking across projects
ProduceReferenceAssembly, "false" ]
let globalProperties = []
16 changes: 3 additions & 13 deletions src/FsAutoComplete.Core/State.fs
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,9 @@ module ProjInfoExtensions =
type FSharpReferencedProject with

member x.ProjectFilePath =
let rCase, fields =
FSharp.Reflection.FSharpValue.GetUnionFields(
x,
typeof<FSharpReferencedProject>,
System.Reflection.BindingFlags.Public
||| System.Reflection.BindingFlags.NonPublic
||| System.Reflection.BindingFlags.Instance
)

if rCase.Name = "FSharpReference" then
(fields[1] :?> FSharpProjectOptions).ProjectFileName |> Some
else
None
match x with
| FSharpReferencedProject.FSharpReference(options = options) -> options.ProjectFileName |> Some
| _ -> None

type FSharpProjectOptions with

Expand Down
4 changes: 2 additions & 2 deletions src/FsAutoComplete/LspServers/AdaptiveServerState.fs
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ type AdaptiveState(lspClient: FSharpLspClient, sourceTextFactory: ISourceTextFac
for p in projectOptions do
logger.info (
Log.setMessage "Found BaseIntermediateOutputPath of {path}"
>> Log.addContextDestructured "path" p.Properties
>> Log.addContextDestructured "path" ((|BaseIntermediateOutputPath|_|) p.Properties)
)

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

0 comments on commit 15c9f4f

Please sign in to comment.