public virtual bool HandlePreExec()

in vsintegration/src/FSharp.LanguageService.Base/ViewFilter.cs [458:565]


        public virtual bool HandlePreExec(ref Guid guidCmdGroup, uint nCmdId, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut) {
            
            this.wasCompletionActive = this.Source.IsCompletorActive;
            this.gotEnterKey = false;

            int line;
            int col;
            var hr = textView.GetCaretPos(out line, out col);
            if (NativeMethods.Failed(hr))
                return false;

            if (guidCmdGroup == typeof(VsCommands).GUID) {
                VsCommands cmd = (VsCommands)nCmdId;
#if TRACE_EXEC
                if (cmd != VsCommands.SolutionCfg && cmd != VsCommands.SearchCombo) {
                    Trace.WriteLine(String.Format("ExecCommand: {0}", cmd.ToString()));
                }
#endif

                
                switch (cmd) {
                    case VsCommands.GotoDefn:
                    case VsCommands.GotoDecl:
                    case VsCommands.GotoRef:
                        HandleGoto(cmd, line, col);
                        return true;
                }
            } else if (guidCmdGroup == typeof(VsCommands2K).GUID) {

                VsCommands2K cmd = (VsCommands2K)nCmdId;

                switch (cmd) {
                    case VsCommands2K.FORMATDOCUMENT:
                        this.ReformatDocument();
                        return true;

                    case VsCommands2K.FORMATSELECTION:
                        this.ReformatSelection();
                        return true;

                    case VsCommands2K.COMMENT_BLOCK:
                        this.CommentSelection();
                        return true;

                    case VsCommands2K.UNCOMMENT_BLOCK:
                        this.UncommentSelection();
                        return true;

                    case VsCommands2K.COMPLETEWORD:
                        this.source.Completion(this.textView, this.source.GetTokenInfo(line, col), BackgroundRequestReason.CompleteWord, RequireFreshResults.No);
                        return true;

                    case VsCommands2K.SHOWMEMBERLIST:
                        this.source.Completion(this.textView, this.source.GetTokenInfo(line, col), BackgroundRequestReason.DisplayMemberList, RequireFreshResults.No);
                        return true;

                    case VsCommands2K.PARAMINFO:
                        this.source.MethodTip(this.textView, line, col, this.source.GetTokenInfo(line, col), MethodTipMiscellany_DEPRECATED.ExplicitlyInvokedViaCtrlShiftSpace, RequireFreshResults.No);
                        return true;

                    case VsCommands2K.QUICKINFO: 
                        HandleQuickInfo(line, col);
                        return true;

                    case VsCommands2K.SHOWCONTEXTMENU:
                        this.ShowContextMenu(Microsoft.VisualStudio.Shell.VsMenus.IDM_VS_CTXT_CODEWIN, Microsoft.VisualStudio.Shell.VsMenus.guidSHLMainMenu, null);
                        return true;

                    //                    case VsCommands2K.HANDLEIMEMESSAGE:
                    //                        if (pvaOut != IntPtr.Zero) {
                    //                            Marshal.GetNativeVariantForObject(false, pvaOut); //debug this make sure it's right ...
                    //                        }
                    //                        break;

                    case VsCommands2K.OUTLN_STOP_HIDING_ALL:
                        this.source.OutliningEnabled = false;
                        break;

                    case VsCommands2K.OUTLN_START_AUTOHIDING:
                        this.source.OutliningEnabled = true;
                        break;

                }
            }
            else if (guidCmdGroup == Microsoft.VisualStudio.VSConstants.VsStd11)
            {
                if (nCmdId == (uint) Microsoft.VisualStudio.VSConstants.VSStd11CmdID.ExecuteSelectionInInteractive)
                {
                    Interactive.Hooks.OnMLSend(GetProjectSystemPackage(), Interactive.FsiEditorSendAction.ExecuteSelection, null, null);
                    return true;
                }
                else if (nCmdId == (uint) Microsoft.VisualStudio.VSConstants.VSStd11CmdID.ExecuteLineInInteractive)
                {
                    Interactive.Hooks.OnMLSend(GetProjectSystemPackage(), Interactive.FsiEditorSendAction.ExecuteLine, null, null);
                    return true;
                }
            }
            else if (guidCmdGroup == guidInteractive)
            {
                if (nCmdId == cmdIDDebugSelection)
                {
                    Interactive.Hooks.OnMLSend(GetProjectSystemPackage(), Interactive.FsiEditorSendAction.DebugSelection, null, null);
                    return true;
                }
            }

            return false;
        }