提交 a889efb6 编写于 作者: D Don Syme

rip out failed attempt to activate menus

上级 c9413401
......@@ -620,7 +620,6 @@ type internal FsiCommandLineOptions(fsi: FsiEvaluationSessionHostConfig,
let mutable showILCode = false // show modul il code
#endif
let mutable showTypes = true // show types after each interaction?
let mutable useServerPrompt = false
let mutable fsiServerName = ""
let mutable interact = true
let mutable explicitArgs = []
......@@ -694,7 +693,6 @@ type internal FsiCommandLineOptions(fsi: FsiEvaluationSessionHostConfig,
PrivateOptions(
[// Make internal fsi-server* options. Do not print in the help. They are used by VFSI.
CompilerOption("fsi-server-report-references","", OptionString (fun s -> writeReferencesAndExit <- Some s), None, None);
CompilerOption("fsi-server-prompt","", OptionUnit (fun () -> useServerPrompt <- true), None, None);
CompilerOption("fsi-server","", OptionString (fun s -> fsiServerName <- s), None, None); // "FSI server mode on given named channel");
CompilerOption("fsi-server-input-codepage","",OptionInt (fun n -> fsiServerInputCodePage <- Some(n)), None, None); // " Set the input codepage for the console");
CompilerOption("fsi-server-output-codepage","",OptionInt (fun n -> fsiServerOutputCodePage <- Some(n)), None, None); // " Set the output codepage for the console");
......@@ -831,7 +829,7 @@ type internal FsiCommandLineOptions(fsi: FsiEvaluationSessionHostConfig,
member __.FsiServerInputCodePage = fsiServerInputCodePage
member __.FsiServerOutputCodePage = fsiServerOutputCodePage
member __.FsiLCID with get() = fsiLCID and set v = fsiLCID <- v
member __.UseServerPrompt = useServerPrompt
member __.UseServerPrompt = isInteractiveServer()
member __.IsInteractiveServer = isInteractiveServer()
member __.ProbeToSeeIfConsoleWorks = probeToSeeIfConsoleWorks
member __.EnableConsoleKeyProcessing = enableConsoleKeyProcessing
......
......@@ -22,7 +22,6 @@ module internal Guids =
let guidFsiConsoleCmdSet = Guid("0E455B35-F2EB-431b-A0BE-B268D8A7D17F")
let cmdIDAttachDebugger = 0x104
let cmdIDDetachDebugger = 0x105
let cmdIDQuitProcess = 0x106
let cmdIDFsiConsoleContextMenu = 0x2100
// Command set for SendToInteractive
......
......@@ -221,7 +221,6 @@ type internal FsiToolWindow() as this =
let writeKeyChunk = function
| StdOut,strs -> writeTextAndScroll (String.concat Environment.NewLine strs) // later: stdout and stderr may color differently
| StdErr,strs -> writeTextAndScroll (String.concat Environment.NewLine strs) // later: hence keep them split.
do responseBufferE.Add(fun keyStrings -> let keyChunks : (Response * string list) list = chunkKeyValues keyStrings
List.iter writeKeyChunk keyChunks)
let showInitialMessageNetCore scroll =
......@@ -340,40 +339,18 @@ type internal FsiToolWindow() as this =
let supportWhenAtStartOfInputArea (sender:obj) (e:EventArgs) =
let command = sender :?> MenuCommand
if command <> null then
let enabled = isCurrentPositionAtStartOfInputArea()
command.Enabled <- enabled
command.Supported <- enabled
command.Supported <- not source.IsCompletorActive && isCurrentPositionInInputArea()
/// Support when at the start of the input area AND no-selection (e.g. to enable NoAction on BACKSPACE).
let supportWhenAtStartOfInputAreaAndNoSelection (sender:obj) (e:EventArgs) =
let command = sender :?> MenuCommand
if command <> null then
let enabled = isCurrentPositionAtStartOfInputArea() && not (haveTextViewSelection())
command.Enabled <- enabled
command.Supported <- enabled
command.Supported <- isCurrentPositionAtStartOfInputArea()
let supportWhenSelectionIntersectsWithReadonlyOrNoSelection (sender:obj) (_:EventArgs) =
let command = sender :?> MenuCommand
if command <> null then
let enabled = isSelectionIntersectsWithReadonly() || not (haveTextViewSelection())
command.Enabled <- enabled
command.Supported <- enabled
let supportWhenInterruptSupported (sender:obj) (_:EventArgs) =
let command = sender :?> MenuCommand
if command <> null then
let enabled = sessions.Alive && sessions.SupportsInterrupt
command.Supported <- enabled
command.Enabled <- enabled
//command.Visible <- enabled
let supportWhenSessionAlive (sender:obj) (_:EventArgs) =
let command = sender :?> MenuCommand
if command <> null then
let enabled = sessions.Alive
command.Supported <- enabled
command.Enabled <- enabled
//command.Visible <- enabled
command.Supported <- isSelectionIntersectsWithReadonly() || not (haveTextViewSelection())
// NOTE: On* are command handlers.
......@@ -475,11 +452,6 @@ type internal FsiToolWindow() as this =
| Some _ -> FsiDebuggerState.AttachedToFSI, debuggedFsi
| None -> FsiDebuggerState.AttachedNotToFSI, None
let visibleWhenDebugAttachedFSIProcess (sender:obj) (_:EventArgs) =
let command = sender :?> MenuCommand
if command <> null then
command.Visible <- fst (getDebuggerState ()) = FsiDebuggerState.AttachedToFSI
let getDebugAttachedFSIProcess () =
match getDebuggerState () with
| FsiDebuggerState.AttachedToFSI, opt -> opt
......@@ -549,10 +521,6 @@ type internal FsiToolWindow() as this =
detachDebugger()
showNoActivate()
let onQuitProcess (sender:obj) (args:EventArgs) =
sessions.Kill()
showInitialMessageNetCore(true)
let sendTextToFSI text =
try
showNoActivate()
......@@ -723,11 +691,10 @@ type internal FsiToolWindow() as this =
addCommand guidVSStd97CmdID (int32 VSStd97CmdID.Cut) onCutDoCopy (Some supportWhenSelectionIntersectsWithReadonlyOrNoSelection)
addCommand guidVSStd97CmdID (int32 VSStd97CmdID.ClearPane) onClearPane None
addCommand guidVSStd2KCmdID (int32 VSStd2KCmdID.SHOWCONTEXTMENU) showContextMenu None
addCommand Guids.guidInteractiveCommands Guids.cmdIDSessionInterrupt onInterrupt (Some supportWhenInterruptSupported)
addCommand Guids.guidInteractiveCommands Guids.cmdIDSessionRestart (onRestart null) (Some supportWhenSessionAlive)
addCommand Guids.guidFsiConsoleCmdSet Guids.cmdIDAttachDebugger onAttachDebugger (Some supportWhenSessionAlive)
addCommand Guids.guidFsiConsoleCmdSet Guids.cmdIDDetachDebugger onDetachDebugger (Some visibleWhenDebugAttachedFSIProcess)
addCommand Guids.guidFsiConsoleCmdSet Guids.cmdIDQuitProcess onQuitProcess (Some supportWhenSessionAlive)
addCommand Guids.guidInteractiveCommands Guids.cmdIDSessionInterrupt onInterrupt None
addCommand Guids.guidInteractiveCommands Guids.cmdIDSessionRestart onRestart None
addCommand Guids.guidFsiConsoleCmdSet Guids.cmdIDAttachDebugger onAttachDebugger None
addCommand Guids.guidFsiConsoleCmdSet Guids.cmdIDDetachDebugger onDetachDebugger None
addCommand Guids.guidInteractiveShell Guids.cmdIDSendSelection onMLSendSelection None
addCommand Guids.guidInteractiveShell Guids.cmdIDSendLine onMLSendLine None
......@@ -762,10 +729,6 @@ type internal FsiToolWindow() as this =
if getDebugAttachedFSIProcess () |> Option.isSome then Some(OLECMDF.OLECMDF_SUPPORTED ||| OLECMDF.OLECMDF_ENABLED)
else Some(OLECMDF.OLECMDF_INVISIBLE)
| _ when guidCmdGroup = Guids.guidFsiConsoleCmdSet && nCmdId = uint32 Guids.cmdIDQuitProcess ->
if sessions.Alive then Some(OLECMDF.OLECMDF_SUPPORTED ||| OLECMDF.OLECMDF_ENABLED)
else Some(OLECMDF.OLECMDF_INVISIBLE)
| _ -> None
interface ITestVFSI with
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册