Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Problems with F# Interactive scripting on Linux (Alt-Enter/Ctrl-Enter execution) #78

Closed
carsten-j opened this issue Jan 22, 2013 · 9 comments

Comments

@carsten-j
Copy link

When I am editing a FSX file in MonoDevelop and then want to execute some code in the F# interactive then I assume that I should put the cursor on the line in the FSX file that I want to execute and then press Alt-Enter.

This do not execute code in the interactive prompt. I experience either

  1. nothing happens or from time to time
  2. An error: System.InvalidOperationException: An item with id 'FSharp.MonoDevelop.FSharpInteractivePad' already exists.

Any suggestion to as what I do wrong?

The error details:

System.InvalidOperationException: An item with id 'FSharp.MonoDevelop.FSharpInteractivePad' already exists.
at MonoDevelop.Components.Docking.DockFrame.AddItem (System.String id) [0x00048] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-3.1-series/5d928ec4/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockFrame.cs:197
at MonoDevelop.Ide.Gui.DefaultWorkbench.AddPad (MonoDevelop.Ide.Codons.PadCodon padCodon, System.String placement, DockItemStatus defaultStatus) [0x00089] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-3.1-series/5d928ec4/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs:1281
at MonoDevelop.Ide.Gui.DefaultWorkbench.AddPad (MonoDevelop.Ide.Codons.PadCodon content, Boolean show) [0x0004c] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-3.1-series/5d928ec4/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs:483
at MonoDevelop.Ide.Gui.DefaultWorkbench.AddPad (MonoDevelop.Ide.Codons.PadCodon content) [0x00000] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-3.1-series/5d928ec4/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs:453
at MonoDevelop.Ide.Gui.Workbench.AddPad (MonoDevelop.Ide.Codons.PadCodon content) [0x00000] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-3.1-series/5d928ec4/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:305
at MonoDevelop.Ide.Gui.Workbench.AddPad (IPadContent padContent, System.String id, System.String label, System.String defaultPlacement, IconId icon) [0x00000] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-3.1-series/5d928ec4/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs:311
at MonoDevelop.FSharp.FSharpInteractivePad.get_CurrentPad () [0x00000] in :0
at MonoDevelop.FSharp.SendSelection.Update (MonoDevelop.Components.Commands.CommandInfo info) [0x00000] in :0
at MonoDevelop.Components.Commands.CommandHandler.InternalUpdate (MonoDevelop.Components.Commands.CommandInfo info) [0x00000] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-3.1-series/5d928ec4/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandHandler.cs:47
at MonoDevelop.Components.Commands.CommandManager.DefaultUpdateCommandInfo (MonoDevelop.Components.Commands.ActionCommand cmd, MonoDevelop.Components.Commands.CommandInfo info) [0x00079] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-3.1-series/5d928ec4/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:1257
at MonoDevelop.Components.Commands.CommandManager.GetCommandInfo (System.Object commandId, MonoDevelop.Components.Commands.CommandTargetRoute targetRoute) [0x001a9] in /Users/builder/data/lanes/monodevelop-lion-monodevelop-3.1-series/5d928ec4/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs:1223

@rsriniva
Copy link

This is how I worked around this issue on Linux/MD 3.0.6. Edit the file ~/.local/share/MonoDevelop-3.0/LocalInstall/Addins/MonoDevelop.FSharpBinding.3.2.12/FSharpBinding.monodevelop-3.0.6.addin.xml

Comment out the last Extension as below

<Extension path = "/MonoDevelop/Ide/MainMenu/Edit">
    <CommandItem id = "MonoDevelop.FSharp.FSharpCommands.SendSelection" />
    <CommandItem id = "MonoDevelop.FSharp.FSharpCommands.SendLine" />
 </Extension>

Then restart MD. Go to View -> Pads -> F# interactive. Enjoy REPL!

@7sharp9
Copy link
Member

7sharp9 commented Jan 22, 2013

I have always highlighted multiple lines and just sent that to the command line...

@carsten-j
Copy link
Author

Thanks for the input. However changing the xml file does not solve the problem. I am afraid that I will have to go back to Windows and Visual Studio. Otherwise I will not get any work done :-(

@7sharp9
Copy link
Member

7sharp9 commented Jan 22, 2013

I never use fsx files or the send to function. Its shift cmd L on the Mac incidentally. Hopefully someone will take a look at the issue at some point. With the last build I seem to have the F# interactive pad installed twice...

@rsriniva
Copy link

With the last build I seem to have the F# interactive pad installed twice...

I am seeing the same issue on Linux MD 3.0.6, Mono 3.0.3 and latest FS binding added from Addin Manager

@funnelweb
Copy link
Contributor

I don't get this error on XamarinStudio 4.0 on Mac

@funnelweb
Copy link
Contributor

The key combination has been changed to Ctrl-Enter on Xamarin Studio 4.0

@7sharp9
Copy link
Member

7sharp9 commented Mar 24, 2013

Seems to work fine as CTRL ENTER, can this be closed now?

@funnelweb
Copy link
Contributor

yes

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants