diff --git a/src/InteractiveWindow/VisualStudio/InteractiveWindow.vsct b/src/InteractiveWindow/VisualStudio/InteractiveWindow.vsct index 23915c0004f55f8e84ec17a0034b38729dcfe697..b779dbe01491fbffbdddd41d4e93924b6535fd54 100644 --- a/src/InteractiveWindow/VisualStudio/InteractiveWindow.vsct +++ b/src/InteractiveWindow/VisualStudio/InteractiveWindow.vsct @@ -231,19 +231,8 @@ --> - - + diff --git a/src/VisualStudio/Core/Def/Implementation/AbstractOleCommandTarget.Execute.cs b/src/VisualStudio/Core/Def/Implementation/AbstractOleCommandTarget.Execute.cs index 0dfbcb1f5b6bfb34e3ce7a3a4b0a70839fbfe2c4..b689947a7642e76915ea887386a4bd6dbc9fe281 100644 --- a/src/VisualStudio/Core/Def/Implementation/AbstractOleCommandTarget.Execute.cs +++ b/src/VisualStudio/Core/Def/Implementation/AbstractOleCommandTarget.Execute.cs @@ -9,11 +9,6 @@ using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.Utilities; -#if INTERACTIVE -using InteractiveCommandIds = Microsoft.VisualStudio.LanguageServices.InteractiveWindow.CommandIds; -using InteractiveGuids = Microsoft.VisualStudio.LanguageServices.InteractiveWindow.Guids; -#endif - namespace Microsoft.VisualStudio.LanguageServices.Implementation { internal abstract partial class AbstractOleCommandTarget @@ -52,12 +47,10 @@ public virtual int Exec(ref Guid pguidCmdGroup, uint commandId, uint executeInfo { return ExecuteVisualStudio97(ref pguidCmdGroup, commandId, executeInformation, pvaIn, pvaOut, subjectBuffer, contentType); } -#if INTERACTIVE - else if (pguidCmdGroup == InteractiveGuids.InteractiveCommandSetId) - { - return ExecuteInteractiveCommands(ref pguidCmdGroup, commandId, executeInformation, pvaIn, pvaOut, subjectBuffer, contentType); - } -#endif + else if (pguidCmdGroup == VSConstants.VsStd11) + { + return ExecuteVisualStudio11(ref pguidCmdGroup, commandId, executeInformation, pvaIn, pvaOut, subjectBuffer, contentType); + } else if (pguidCmdGroup == VSConstants.VsStd14) { return ExecuteVisualStudio2014(ref pguidCmdGroup, commandId, executeInformation, pvaIn, pvaOut, subjectBuffer, contentType); @@ -577,8 +570,7 @@ private void ExecuteGoToPreviousMethod(ITextBuffer subjectBuffer, IContentType c lastHandler: executeNextCommandTarget); } -#if INTERACTIVE - private int ExecuteInteractiveCommands(ref Guid pguidCmdGroup, uint commandId, uint executeInformation, IntPtr pvaIn, IntPtr pvaOut, ITextBuffer subjectBuffer, IContentType contentType) + private int ExecuteVisualStudio11(ref Guid pguidCmdGroup, uint commandId, uint executeInformation, IntPtr pvaIn, IntPtr pvaOut, ITextBuffer subjectBuffer, IContentType contentType) { int result = VSConstants.S_OK; var guidCmdGroup = pguidCmdGroup; @@ -587,23 +579,18 @@ private int ExecuteInteractiveCommands(ref Guid pguidCmdGroup, uint commandId, u result = NextCommandTarget.Exec(ref guidCmdGroup, commandId, executeInformation, pvaIn, pvaOut); }; - switch ((InteractiveCommandIds)commandId) + switch ((VSConstants.VSStd11CmdID)commandId) { - case InteractiveCommandIds.ExecuteInInteractiveWindow: + case VSConstants.VSStd11CmdID.ExecuteSelectionInInteractive: ExecuteExecuteInInteractiveWindow(subjectBuffer, contentType, executeNextCommandTarget); break; - case InteractiveCommandIds.CopyToInteractiveWindow: - ExecuteCopyToToInteractiveWindow(subjectBuffer, contentType, executeNextCommandTarget); - break; - default: return NextCommandTarget.Exec(ref pguidCmdGroup, commandId, executeInformation, pvaIn, pvaOut); } return result; } -#endif private void ExecuteMoveSelectedLinesUp(ITextBuffer subjectBuffer, IContentType contentType, Action executeNextCommandTarget) { @@ -984,13 +971,6 @@ private void ExecuteExecuteInInteractiveWindow(ITextBuffer subjectBuffer, IConte lastHandler: executeNextCommandTarget); } - private void ExecuteCopyToToInteractiveWindow(ITextBuffer subjectBuffer, IContentType contentType, Action executeNextCommandTarget) - { - CurrentHandlers.Execute(contentType, - args: new CopyToInteractiveCommandArgs(ConvertTextView(), subjectBuffer), - lastHandler: executeNextCommandTarget); - } - private void ExecuteBrowserBackward(ITextBuffer subjectBuffer, IContentType contentType, Action executeNextCommandTarget) { ExecuteBrowserNavigationCommand(navigateBackward: true, executeNextCommandTarget: executeNextCommandTarget); diff --git a/src/VisualStudio/Core/Def/Implementation/AbstractOleCommandTarget.Query.cs b/src/VisualStudio/Core/Def/Implementation/AbstractOleCommandTarget.Query.cs index 6eb736d2275521c2384adcc2de59d0a953993ed3..4cb4ffdb35c9acfdc108255a433396f0ef2dc15f 100644 --- a/src/VisualStudio/Core/Def/Implementation/AbstractOleCommandTarget.Query.cs +++ b/src/VisualStudio/Core/Def/Implementation/AbstractOleCommandTarget.Query.cs @@ -12,11 +12,6 @@ using Microsoft.VisualStudio.Text.Editor; using Roslyn.Utilities; -#if INTERACTIVE -using InteractiveCommandIds = Microsoft.VisualStudio.LanguageServices.InteractiveWindow.CommandIds; -using InteractiveGuids = Microsoft.VisualStudio.LanguageServices.InteractiveWindow.Guids; -#endif - namespace Microsoft.VisualStudio.LanguageServices.Implementation { internal abstract partial class AbstractOleCommandTarget @@ -42,12 +37,10 @@ public int QueryStatus(ref Guid pguidCmdGroup, uint commandCount, OLECMD[] prgCm { return QueryVisualStudio97Status(ref pguidCmdGroup, commandCount, prgCmds, commandText); } -#if INTERACTIVE - else if (pguidCmdGroup == InteractiveGuids.InteractiveCommandSetId) + else if (pguidCmdGroup == VSConstants.VsStd11) { - return QueryInteractiveCommandStatus(ref pguidCmdGroup, commandCount, prgCmds, commandText); + return QueryVisualStudio11Status(ref pguidCmdGroup, commandCount, prgCmds, commandText); } -#endif else if (pguidCmdGroup == VSConstants.VsStd14) { return QueryVisualStudio2014Status(ref pguidCmdGroup, commandCount, prgCmds, commandText); @@ -231,22 +224,17 @@ private int QueryVisualStudio2000Status(ref Guid pguidCmdGroup, uint commandCoun } } -#if INTERACTIVE - private int QueryInteractiveCommandStatus(ref Guid pguidCmdGroup, uint commandCount, OLECMD[] prgCmds, IntPtr commandText) + private int QueryVisualStudio11Status(ref Guid pguidCmdGroup, uint commandCount, OLECMD[] prgCmds, IntPtr commandText) { - switch ((InteractiveCommandIds)prgCmds[0].cmdID) + switch ((VSConstants.VSStd11CmdID)prgCmds[0].cmdID) { - case InteractiveCommandIds.ExecuteInInteractiveWindow: - return QueryExecuteInInteractiveWindowStatus(ref pguidCmdGroup, commandCount, prgCmds, commandText); - - case InteractiveCommandIds.CopyToInteractiveWindow: - return QueryCopyToInteractiveWindowStatus(ref pguidCmdGroup, commandCount, prgCmds, commandText); + case VSConstants.VSStd11CmdID.ExecuteSelectionInInteractive: + return QueryExecuteInInteractiveWindowStatus(ref pguidCmdGroup, commandCount, prgCmds, commandText); ; default: return NextCommandTarget.QueryStatus(ref pguidCmdGroup, commandCount, prgCmds, commandText); } } -#endif private int GetCommandState( Func createArgs, @@ -491,13 +479,6 @@ private int QueryExecuteInInteractiveWindowStatus(ref Guid pguidCmdGroup, uint c ref pguidCmdGroup, commandCount, prgCmds, commandText); } - private int QueryCopyToInteractiveWindowStatus(ref Guid pguidCmdGroup, uint commandCount, OLECMD[] prgCmds, IntPtr commandText) - { - return GetCommandState( - (v, b) => new CopyToInteractiveCommandArgs(v, b), - ref pguidCmdGroup, commandCount, prgCmds, commandText); - } - private int QueryEncapsulateFieldStatus(ref Guid pguidCmdGroup, uint commandCount, OLECMD[] prgCmds, IntPtr commandText) { return GetCommandState(