开发者

F# interactive - "reset session" hotkey

开发者 https://www.devze.com 2023-03-14 23:27 出处:网络
I have assigned a new Global hotkey to VS 2010/Options/Environment/Keyboard/OtherContextMenus.FSIConsoleContext.ResetSession

I have assigned a new Global hotkey to

VS 2010/Options/Environment/Keyboard/OtherContextMenus.FSIConsoleContext.ResetSession

But it seems to work only in the FSI window. How can I make the 开发者_如何学编程hotkey work globally?


I don't think you can do it the way you describe it (the hotkey will only work within the context of the FSI window), but you can use a VS Macro to change the focus to the FSI console, reset the session and move back;

the following worked for me: (needs additional error handling etc)

Sub ResetFSharpMacro()
    Dim WindowName As String
    WindowName = DTE.ActiveDocument.Name
    DTE.ExecuteCommand("View.F#Interactive")
    DTE.ExecuteCommand("OtherContextMenus.FSIConsoleContext.ResetSession")
    DTE.Windows.Item(WindowName).Activate()
End Sub

You can then use Macros.MyMacro.... to assign a global hotkey

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号