Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/release-notes/.FSharp.Compiler.Service/10.0.300.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
* FSharpType: add ImportILType ([PR #19300](https://github.com/dotnet/fsharp/pull/19300))
* Type checker: recover on argument/overload checking ([PR #19314](https://github.com/dotnet/fsharp/pull/19314))

* Support `#exit;;` as alias to `#quit;;` in F# Interactive. ([PR #19329](https://github.com/dotnet/fsharp/pull/19329))

### Changed

* Centralized product TFM (Target Framework Moniker) into MSBuild props file `eng/TargetFrameworks.props`. Changing the target framework now only requires editing one file, and it integrates with MSBuild's `--getProperty` for scripts.
Expand Down
3 changes: 2 additions & 1 deletion src/Compiler/Interactive/fsi.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1295,6 +1295,7 @@ type internal FsiCommandLineOptions(fsi: FsiEvaluationSessionHostConfig, argv: s

fsiConsoleOutput.uprintfn """ #clear;; // %s""" (FSIstrings.SR.fsiIntroTextHashclearInfo ())
fsiConsoleOutput.uprintfn """ #quit;; // %s""" (FSIstrings.SR.fsiIntroTextHashquitInfo ())
fsiConsoleOutput.uprintfn """ #exit;; // %s""" (FSIstrings.SR.fsiIntroTextHashquitInfo ())
fsiConsoleOutput.uprintfn ""
fsiConsoleOutput.uprintfnn "%s" (FSIstrings.SR.fsiIntroTextHeader2commandLine ())
fsiConsoleOutput.uprintfn "%s" (FSIstrings.SR.fsiIntroTextHeader3 helpLine)
Expand Down Expand Up @@ -3885,7 +3886,7 @@ type FsiInteractionProcessor
fsiOptions.ClearScreen()
istate, Completed None

| ParsedHashDirective(("q" | "quit"), [], _) -> fsiInterruptController.Exit()
| ParsedHashDirective(("q" | "quit" | "exit"), [], _) -> fsiInterruptController.Exit()

| ParsedHashDirective("help", hashArguments, m) ->
let args = (parsedHashDirectiveArguments hashArguments tcConfigB.langVersion)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -720,63 +720,35 @@ x |> Seq.iter(fun r ->

[<Fact>]
member _.``Verify that #help produces help text for fsi + dependency manager``() =
let expected = """
F# Interactive directives:

#r "file.dll";; // Reference (dynamically load) the given DLL
#i "package source uri";; // Include package source uri when searching for packages
#I "path";; // Add the given search path for referenced DLLs
#load "file.fs" ...;; // Load the given file(s) as if compiled and referenced
#time ["on"|"off"];; // Toggle timing on/off
#help;; // Display help
#help "idn";; // Display documentation for an identifier, e.g. #help "List.map";;
#r "nuget:FSharp.Data, 3.1.2";; // Load Nuget Package 'FSharp.Data' version '3.1.2'
#r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version
#clear;; // Clear screen
#quit;; // Exit

F# Interactive command line options:"""

use script = new FSharpScript(quiet = false, langVersion = LangVersion.V80)

use capture = new TestConsole.ExecutionCapture()
let _opt = script.Eval("#help") |> getValue

let output = capture.OutText

Assert.Contains(expected, output)
// Verify dependency manager lines are present in help output
Assert.Contains("""#r "nuget:FSharp.Data, 3.1.2";;""", output)
Assert.Contains("""#r "nuget:FSharp.Data";;""", output)
Assert.Contains("""#i "package source uri";;""", output)

// this is the end of the line each different platform has a different mechanism for starting fsi
// Actual output looks similar to: """ See 'testhost --help' for options"""
Assert.EndsWith("--help' for options", output.Trim())

[<Fact>]
member _.``Verify that #help produces help text for fsi + dependency manager language version preview``() =
let expected = """
F# Interactive directives:

#r "file.dll";; // Reference (dynamically load) the given DLL
#i "package source uri";; // Include package source uri when searching for packages
#I "path";; // Add the given search path for referenced DLLs
#load "file.fs" ...;; // Load the given file(s) as if compiled and referenced
#time ["on"|"off"];; // Toggle timing on/off
#help;; // Display help
#help "idn";; // Display documentation for an identifier, e.g. #help "List.map";;
#r "nuget:FSharp.Data, 3.1.2";; // Load Nuget Package 'FSharp.Data' version '3.1.2'
#r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version
#clear;; // Clear screen
#quit;; // Exit

F# Interactive command line options:"""

use script = new FSharpScript(quiet = false, langVersion = LangVersion.Preview)

use capture = new TestConsole.ExecutionCapture()
let _opt = script.Eval("#help") |> getValue

let output = capture.OutText

Assert.Contains(expected, output)
// Verify dependency manager lines are present in help output
Assert.Contains("""#r "nuget:FSharp.Data, 3.1.2";;""", output)
Assert.Contains("""#r "nuget:FSharp.Data";;""", output)
Assert.Contains("""#i "package source uri";;""", output)

// this is the end of the line each different platform has a different mechanism for starting fsi
// Actual output looks similar to: """ See 'testhost --help' for options"""
Expand Down
1 change: 1 addition & 0 deletions tests/fsharp/core/printing/output.1000.stdout.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,7 @@ type 'a T4063 = | AT4063 of 'a
#r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version
#clear;; // Clear screen
#quit;; // Exit
#exit;; // Exit

F# Interactive command line options:

Expand Down
1 change: 1 addition & 0 deletions tests/fsharp/core/printing/output.200.stdout.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ type 'a T4063 = | AT4063 of 'a
#r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version
#clear;; // Clear screen
#quit;; // Exit
#exit;; // Exit

F# Interactive command line options:

Expand Down
1 change: 1 addition & 0 deletions tests/fsharp/core/printing/output.47.stdout.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -4063,6 +4063,7 @@ type 'a T4063 = | AT4063 of 'a
#help "idn";; // Display documentation for an identifier, e.g. #help "List.map";;
#clear;; // Clear screen
#quit;; // Exit
#exit;; // Exit

F# Interactive command line options:

Expand Down
1 change: 1 addition & 0 deletions tests/fsharp/core/printing/output.multiemit.stdout.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -4065,6 +4065,7 @@ type 'a T4063 = | AT4063 of 'a
#r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version
#clear;; // Clear screen
#quit;; // Exit
#exit;; // Exit

F# Interactive command line options:

Expand Down
1 change: 1 addition & 0 deletions tests/fsharp/core/printing/output.off.stdout.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ type 'a T4063 = | AT4063 of 'a
#r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version
#clear;; // Clear screen
#quit;; // Exit
#exit;; // Exit

F# Interactive command line options:

Expand Down
1 change: 1 addition & 0 deletions tests/fsharp/core/printing/output.stdout.bsl
Original file line number Diff line number Diff line change
Expand Up @@ -4065,6 +4065,7 @@ type 'a T4063 = | AT4063 of 'a
#r "nuget:FSharp.Data";; // Load Nuget Package 'FSharp.Data' with the highest version
#clear;; // Clear screen
#quit;; // Exit
#exit;; // Exit

F# Interactive command line options:

Expand Down
Loading