From 894c96d24557c9624cf72505f8d4aa10992ee440 Mon Sep 17 00:00:00 2001 From: Gauthier Segay Date: Sun, 12 Nov 2023 19:55:13 +0100 Subject: [PATCH 1/2] Update F# Interactive Dependency Manager Plugins README.md Links to microsoft.com documentation for FSI references and command line parameters. Precise how they are deployed. --- src/FSharp.DependencyManager.Nuget/README.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/FSharp.DependencyManager.Nuget/README.md b/src/FSharp.DependencyManager.Nuget/README.md index b24fae7442..9c0e88eac1 100644 --- a/src/FSharp.DependencyManager.Nuget/README.md +++ b/src/FSharp.DependencyManager.Nuget/README.md @@ -1,17 +1,24 @@ -# `dotnet fsi` Dependency Manager Plugins +# F# Interactive Dependency Manager Plugins -Since .NET 5.0, `dotnet fsi` ships with dependency manager plugins support that can be called like so: +Since F# 5.0, `dotnet fsi` and `FsiAnyCPU.exe` (the .NET Framework variant) ships with dependency manager plugins support that can be called like so: ```fsharp #r "myextension: my extension parameters" ``` +For F# Interactive to load the extensions[^1], they either need to: +* be deployed next to `fsi.dll` of dotnet SDK (or next `FsiAnyCPU.exe` for .NET Framework) +* refered to via `--compilertool:`[^2] argument + +The same goes for the tooling hosting [F# Compiler Service](https://fsharp.github.io/fsharp-compiler-docs/fcs/). + The initial [RFC](https://github.com/fsharp/fslang-design/blob/main/tooling/FST-1027-fsi-references.md) for this feature overviews how it is designed. -The current implementation follows pattern that can be deducted by refering to [implementation in DependencyProvider.fs](https://github.com/dotnet/fsharp/blob/b9687a58cee795a94eb88cf84e309767cc25f6cb/src/Compiler/DependencyManager/DependencyProvider.fs#L145-L322); due to the system working without having a staticically linked dependency, it uses a late binding approach leveraging runtime reflection to identify if an extension conforms to patterns understood by the specifics of the compiler implementation. +More about F# Interactive References +The current implementation follows pattern that can be deducted by refering to [implementation in DependencyProvider.fs](https://github.com/dotnet/fsharp/blob/b9687a58cee795a94eb88cf84e309767cc25f6cb/src/Compiler/DependencyManager/DependencyProvider.fs#L145-L322); due to the system working without having a staticically linked dependency, it uses a late binding approach leveraging runtime reflection to identify if an extension conforms to patterns understood by the specifics of the compiler implementation. # `#r "nuget:"` [nuget](https://github.com/dotnet/fsharp/tree/main/src/fsharp/FSharp.DependencyManager.Nuget) @@ -29,7 +36,6 @@ let o = {| X = 2; Y = "Hello" |} printfn "%s" (JsonConvert.SerializeObject o) ``` - # `#r "paket:"` [paket](https://fsprojects.github.io/Paket/fsi-integration.html) Reference dependencies (nuget, git, gist, github) through [Paket package manager](https://fsprojects.github.io/Paket). @@ -49,4 +55,6 @@ X,Y for r in MyCsv.GetSample().Rows do printfn "%i = %s" r.X r.Y -``` \ No newline at end of file +``` +[^1]: [Referencing packages in F# Interactive](https://learn.microsoft.com/en-us/dotnet/fsharp/tools/fsharp-interactive/#referencing-packages-in-f-interactive) +[^2]: [F# Interactive options](https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/fsharp-interactive-options) From f0c6960a6ca7cc87d917dd4bd9a58bcd17ce8357 Mon Sep 17 00:00:00 2001 From: Gauthier Segay Date: Tue, 14 Nov 2023 13:15:26 +0100 Subject: [PATCH 2/2] Apply suggestions from code review Thanks! Co-authored-by: Petr --- src/FSharp.DependencyManager.Nuget/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/FSharp.DependencyManager.Nuget/README.md b/src/FSharp.DependencyManager.Nuget/README.md index 9c0e88eac1..87f89e7e55 100644 --- a/src/FSharp.DependencyManager.Nuget/README.md +++ b/src/FSharp.DependencyManager.Nuget/README.md @@ -16,9 +16,9 @@ The same goes for the tooling hosting [F# Compiler Service](https://fsharp.githu The initial [RFC](https://github.com/fsharp/fslang-design/blob/main/tooling/FST-1027-fsi-references.md) for this feature overviews how it is designed. -More about F# Interactive References +**More about F# Interactive References** -The current implementation follows pattern that can be deducted by refering to [implementation in DependencyProvider.fs](https://github.com/dotnet/fsharp/blob/b9687a58cee795a94eb88cf84e309767cc25f6cb/src/Compiler/DependencyManager/DependencyProvider.fs#L145-L322); due to the system working without having a staticically linked dependency, it uses a late binding approach leveraging runtime reflection to identify if an extension conforms to patterns understood by the specifics of the compiler implementation. +The current implementation follows pattern that can be deducted by referring to [implementation in DependencyProvider.fs](https://github.com/dotnet/fsharp/blob/b9687a58cee795a94eb88cf84e309767cc25f6cb/src/Compiler/DependencyManager/DependencyProvider.fs#L145-L322); due to the system working without having a statically linked dependency, it uses a late binding approach leveraging runtime reflection to identify if an extension conforms to patterns understood by the specifics of the compiler implementation. # `#r "nuget:"` [nuget](https://github.com/dotnet/fsharp/tree/main/src/fsharp/FSharp.DependencyManager.Nuget) @@ -56,5 +56,5 @@ X,Y for r in MyCsv.GetSample().Rows do printfn "%i = %s" r.X r.Y ``` -[^1]: [Referencing packages in F# Interactive](https://learn.microsoft.com/en-us/dotnet/fsharp/tools/fsharp-interactive/#referencing-packages-in-f-interactive) -[^2]: [F# Interactive options](https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/fsharp-interactive-options) +[^1]: [Referencing packages in F# Interactive](https://learn.microsoft.com/dotnet/fsharp/tools/fsharp-interactive/#referencing-packages-in-f-interactive) +[^2]: [F# Interactive options](https://learn.microsoft.com/dotnet/fsharp/language-reference/fsharp-interactive-options)