Skip to content

Commit 2e70cec

Browse files
committed
remove dependencies in sample
1 parent 9f2b9e3 commit 2e70cec

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

samples/FsiExe/FsiExe.fsproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@
4040
<Prefer32Bit>true</Prefer32Bit>
4141
</PropertyGroup>
4242
<ItemGroup>
43-
<Reference Include="FSharp.Compiler.Interactive.Settings, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
44-
<Private>True</Private>
45-
</Reference>
4643
<Reference Include="FSharp.Core, Version=$(TargetFSharpCoreVersion), Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
4744
<Private>True</Private>
4845
</Reference>

samples/FsiExe/fsimain.fs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ type internal DummyForm() =
4848
/// error during finalization of the half-initialized object...
4949
override x.Finalize() = ()
5050

51+
#if USE_WINFORMS_EVENT_LOOP
5152
/// This is the event loop implementation for winforms
5253
let WinFormsEventLoop(lcid : int option) =
5354
let mainForm = new DummyForm()
@@ -94,6 +95,7 @@ let WinFormsEventLoop(lcid : int option) =
9495

9596
member x.ScheduleRestart() = restart := true; Application.Exit() }
9697

98+
#endif
9799

98100
let StartServer (fsiSession : FsiEvaluationSession) (fsiServerName) =
99101
let server =
@@ -176,8 +178,11 @@ let MainMain argv =
176178
else
177179
None
178180

181+
#if USE_FSharp_Compiler_Interactive_Settings
179182
let fsiConfig0 = FsiEvaluationSession.GetDefaultConfiguration(fsi)
180-
183+
#else
184+
let fsiConfig0 = FsiEvaluationSession.GetDefaultConfiguration()
185+
#endif
181186
let rec fsiConfig =
182187
{ // Update the configuration to include 'StartServer' and 'OptionalConsoleReadLine'
183188
new FsiEvaluationSessionHostConfig () with
@@ -220,12 +225,14 @@ let MainMain argv =
220225
with _ ->
221226
()
222227

228+
#if USE_WINFORMS_EVENT_LOOP
223229
try fsi.EventLoop <- WinFormsEventLoop(fsiSession.LCID)
224230
with e ->
225231
printfn "Your system doesn't seem to support WinForms correctly. You will"
226232
printfn "need to set fsi.EventLoop use GUI windows from F# Interactive."
227233
printfn "You can set different event loops for MonoMac, Gtk#, WinForms and other"
228234
printfn "UI toolkits. Drop the --gui argument if no event loop is required."
235+
#endif
229236

230237

231238
console.SetCompletionFunction(fun (s1,s2) -> fsiSession.GetCompletions (match s1 with | Some s -> s + "." + s2 | None -> s2))

0 commit comments

Comments
 (0)