diff --git a/vsintegration/src/FSharp.Editor/VSMac/InteractivePad.fs b/vsintegration/src/FSharp.Editor/VSMac/InteractivePad.fs index ef23b7d112d..cc6cac038a4 100644 --- a/vsintegration/src/FSharp.Editor/VSMac/InteractivePad.fs +++ b/vsintegration/src/FSharp.Editor/VSMac/InteractivePad.fs @@ -1,5 +1,4 @@ - -// +// // InteractivePad.fs // // Author: @@ -253,7 +252,7 @@ type FSharpInteractivePad() as this = let setupSession() = let pathToExe = - Path.Combine(Reflection.Assembly.GetExecutingAssembly().Location |> Path.GetDirectoryName, "Interactive", "MonoDevelop.FSharpInteractive.Service") + Path.Combine(Reflection.Assembly.GetExecutingAssembly().Location |> Path.GetDirectoryName, "..", "..", "MonoDevelop.FSharpInteractive.Service") let ses = InteractiveSession(pathToExe) let controller = new InteractivePadController(ses) @@ -266,6 +265,8 @@ type FSharpInteractivePad() as this = let mutable session = None + static let mutable initialized = false + let resetFsi intent = input.Clear() killIntent <- intent @@ -319,6 +320,7 @@ type FSharpInteractivePad() as this = static member Fsi = FSharpInteractivePad.Pad |> Option.bind (fun pad -> Some(pad.Content :?> FSharpInteractivePad)) + member x.LastOutputLine with get() = lastLineOutput and set value = lastLineOutput <- value @@ -365,27 +367,29 @@ type FSharpInteractivePad() as this = member val Controller:InteractivePadController option = None with get, set override x.Initialize(container:MonoDevelop.Ide.Gui.IPadWindow) = - LoggingService.LogDebug ("InteractivePad: created!") + if not initialized then + initialized <- true + LoggingService.LogDebug ("InteractivePad: created!") - let toolbar = new Toolbar() + let toolbar = new Toolbar() - let addButton icon action tooltip = - let button = ToolbarButtonItem(null, icon) - button.Icon <- icon - button.Clicked.Add (fun _ -> action()) - button.Tooltip <- GettextCatalog.GetString tooltip - toolbar.AddItem(button) + let addButton icon action tooltip = + let button = ToolbarButtonItem(null, icon) + button.Icon <- icon + button.Clicked.Add (fun _ -> action()) + button.Tooltip <- GettextCatalog.GetString tooltip + toolbar.AddItem(button) - addButton "gtk-save" x.Save "Save as script" - addButton "gtk-open" x.OpenScript "Open" - addButton "gtk-clear" x.ClearFsi "Clear" - addButton "gtk-refresh" x.RestartFsi "Reset" + addButton "gtk-save" x.Save "Save as script" + addButton "gtk-open" x.OpenScript "Open" + addButton "gtk-clear" x.ClearFsi "Clear" + addButton "gtk-refresh" x.RestartFsi "Reset" - let ses = setupSession() - session <- ses |> Some + let ses = setupSession() + session <- ses |> Some - if not ses.HasStarted then ses.StartReceiving() - container.SetToolbar(toolbar, DockPositionType.Right) + if not ses.HasStarted then ses.StartReceiving() + container.SetToolbar(toolbar, DockPositionType.Right) member x.RestartFsi() = resetFsi Restart