未验证 提交 796a5d2d 编写于 作者: J Jason Malinowski 提交者: GitHub

Merge pull request #32623 from jasonmalinowski/delete-legacy-commanding-infrastructure

 Delete Roslyn's ICommandHandler interface and all support code
......@@ -13,18 +13,18 @@
using Microsoft.CodeAnalysis.Formatting;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Microsoft.CodeAnalysis.Text;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion;
using Microsoft.VisualStudio.Text.Operations;
using Microsoft.VisualStudio.Utilities;
using Roslyn.Utilities;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.CSharp.AutomaticCompletion
{
/// <summary>
/// csharp automatic line ender command handler
/// </summary>
[Export(typeof(VSCommanding.ICommandHandler))]
[Export(typeof(ICommandHandler))]
[ContentType(ContentTypeNames.CSharpContentType)]
[Name(PredefinedCommandHandlerNames.AutomaticLineEnder)]
[Order(After = PredefinedCompletionNames.CompletionCommandHandler)]
......
......@@ -8,15 +8,15 @@
using Microsoft.CodeAnalysis.Shared.Extensions;
using Microsoft.CodeAnalysis.Text;
using Microsoft.CodeAnalysis.Text.Shared.Extensions;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Operations;
using Microsoft.VisualStudio.Utilities;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.CSharp.BlockCommentEditing
{
[Export(typeof(VSCommanding.ICommandHandler))]
[Export(typeof(ICommandHandler))]
[ContentType(ContentTypeNames.CSharpContentType)]
[Name(nameof(BlockCommentEditingCommandHandler))]
[Order(After = PredefinedCompletionNames.CompletionCommandHandler)]
......
......@@ -4,17 +4,17 @@
using Microsoft.CodeAnalysis.Editor.Shared.Extensions;
using Microsoft.CodeAnalysis.Editor.Shared.Options;
using Microsoft.CodeAnalysis.Text.Shared.Extensions;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
using Microsoft.VisualStudio.Utilities;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.CSharp.BlockCommentEditing
{
[Export(typeof(VSCommanding.ICommandHandler))]
[Export(typeof(ICommandHandler))]
[ContentType(ContentTypeNames.CSharpContentType)]
[Name(nameof(CloseBlockCommentCommandHandler))]
[Order(After = nameof(BlockCommentEditingCommandHandler))]
internal sealed class CloseBlockCommentCommandHandler : VSCommanding.ICommandHandler<TypeCharCommandArgs>
internal sealed class CloseBlockCommentCommandHandler : ICommandHandler<TypeCharCommandArgs>
{
[ImportingConstructor]
public CloseBlockCommentCommandHandler()
......@@ -23,7 +23,7 @@ public CloseBlockCommentCommandHandler()
public string DisplayName => EditorFeaturesResources.Block_Comment_Editing;
public bool ExecuteCommand(TypeCharCommandArgs args, VSCommanding.CommandExecutionContext executionContext)
public bool ExecuteCommand(TypeCharCommandArgs args, CommandExecutionContext executionContext)
{
if (args.TypedChar == '/')
{
......@@ -56,7 +56,7 @@ public bool ExecuteCommand(TypeCharCommandArgs args, VSCommanding.CommandExecuti
return false;
}
public VSCommanding.CommandState GetCommandState(TypeCharCommandArgs args)
=> VSCommanding.CommandState.Unspecified;
public CommandState GetCommandState(TypeCharCommandArgs args)
=> CommandState.Unspecified;
}
}
......@@ -3,12 +3,12 @@
using System.ComponentModel.Composition;
using Microsoft.CodeAnalysis.Editor.Implementation.ChangeSignature;
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Utilities;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.CSharp.ChangeSignature
{
[Export(typeof(VSCommanding.ICommandHandler))]
[Export(typeof(ICommandHandler))]
[ContentType(ContentTypeNames.CSharpContentType)]
[Name(PredefinedCommandHandlerNames.ChangeSignature)]
internal class CSharpChangeSignatureCommandHandler : AbstractChangeSignatureCommandHandler
......
......@@ -11,15 +11,15 @@
using Microsoft.CodeAnalysis.Editor.Implementation.CommentSelection;
using Microsoft.CodeAnalysis.Host.Mef;
using Microsoft.CodeAnalysis.Text;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Operations;
using Microsoft.VisualStudio.Utilities;
using Roslyn.Utilities;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.CSharp.CommentSelection
{
[Export(typeof(VSCommanding.ICommandHandler))]
[Export(typeof(ICommandHandler))]
[ContentType(ContentTypeNames.CSharpContentType)]
[Name(PredefinedCommandHandlerNames.ToggleBlockComment)]
internal class CSharpToggleBlockCommentCommandHandler :
......
......@@ -20,20 +20,19 @@
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
using Microsoft.VisualStudio.Utilities;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.CSharp.CompleteStatement
{
/// <summary>
/// When user types <c>;</c> in a statement, semicolon is added and caret is placed after the semicolon
/// </summary>
[Export(typeof(VSCommanding.ICommandHandler))]
[Export(typeof(ICommandHandler))]
[ContentType(ContentTypeNames.CSharpContentType)]
[Name(nameof(CompleteStatementCommandHandler))]
[Order(After = PredefinedCompletionNames.CompletionCommandHandler)]
internal sealed class CompleteStatementCommandHandler : IChainedCommandHandler<TypeCharCommandArgs>
{
public VSCommanding.CommandState GetCommandState(TypeCharCommandArgs args, Func<VSCommanding.CommandState> nextCommandHandler) => nextCommandHandler();
public CommandState GetCommandState(TypeCharCommandArgs args, Func<CommandState> nextCommandHandler) => nextCommandHandler();
[ImportingConstructor]
[Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
......
......@@ -6,19 +6,18 @@
using System.Threading;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Extensions;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Editor.Host;
using Microsoft.CodeAnalysis.Editor.Implementation.DocumentationComments;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion;
using Microsoft.VisualStudio.Text.Operations;
using Microsoft.VisualStudio.Utilities;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.CSharp.DocumentationComments
{
[Export(typeof(VSCommanding.ICommandHandler))]
[Export(typeof(ICommandHandler))]
[ContentType(ContentTypeNames.CSharpContentType)]
[Name(PredefinedCommandHandlerNames.DocumentationComments)]
[Order(After = PredefinedCommandHandlerNames.Rename)]
......
......@@ -7,16 +7,16 @@
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Editor.Implementation.DocumentationComments;
using Microsoft.CodeAnalysis.Shared.Extensions;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Text.Operations;
using Microsoft.VisualStudio.Utilities;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.CSharp.DocumentationComments
{
[Export(typeof(VSCommanding.ICommandHandler))]
[Export(typeof(ICommandHandler))]
[ContentType(ContentTypeNames.CSharpContentType)]
[Name(nameof(XmlTagCompletionCommandHandler))]
[Order(Before = PredefinedCompletionNames.CompletionCommandHandler)]
......
......@@ -4,13 +4,13 @@
using Microsoft.CodeAnalysis.Editor.Implementation.EncapsulateField;
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.CodeAnalysis.Shared.TestHooks;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Text.Operations;
using Microsoft.VisualStudio.Utilities;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.CSharp.EncapsulateField
{
[Export(typeof(VSCommanding.ICommandHandler))]
[Export(typeof(ICommandHandler))]
[ContentType(ContentTypeNames.CSharpContentType)]
[Name(PredefinedCommandHandlerNames.EncapsulateField)]
[Order(After = PredefinedCommandHandlerNames.DocumentationComments)]
......
......@@ -3,12 +3,12 @@
using System.ComponentModel.Composition;
using Microsoft.CodeAnalysis.Editor.Implementation.ExtractInterface;
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Utilities;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.CSharp.ExtractInterface
{
[Export(typeof(VSCommanding.ICommandHandler))]
[Export(typeof(ICommandHandler))]
[ContentType(ContentTypeNames.CSharpContentType)]
[Name(PredefinedCommandHandlerNames.ExtractInterface)]
internal class ExtractInterfaceCommandHandler : AbstractExtractInterfaceCommandHandler
......
......@@ -3,13 +3,13 @@
using System.ComponentModel.Composition;
using Microsoft.CodeAnalysis.Editor.Implementation.ExtractMethod;
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Text.Operations;
using Microsoft.VisualStudio.Utilities;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.CSharp.ExtractMethod
{
[Export(typeof(VSCommanding.ICommandHandler))]
[Export(typeof(ICommandHandler))]
[ContentType(ContentTypeNames.CSharpContentType)]
[Name(PredefinedCommandHandlerNames.ExtractMethod)]
[Order(After = PredefinedCommandHandlerNames.DocumentationComments)]
......
......@@ -9,7 +9,6 @@
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
using Microsoft.VisualStudio.Utilities;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.CSharp.FixInterpolatedVerbatimString
{
......@@ -17,7 +16,7 @@ namespace Microsoft.CodeAnalysis.Editor.CSharp.FixInterpolatedVerbatimString
/// Replaces <c>@$"</c> with <c>$@"</c>, which is the preferred and until C# 8.0 the only supported form
/// of an interpolated verbatim string start token. In C# 8.0 we still auto-correct to this form for consistency.
/// </summary>
[Export(typeof(VSCommanding.ICommandHandler))]
[Export(typeof(ICommandHandler))]
[ContentType(ContentTypeNames.CSharpContentType)]
[Name(nameof(FixInterpolatedVerbatimStringCommandHandler))]
internal sealed class FixInterpolatedVerbatimStringCommandHandler : IChainedCommandHandler<TypeCharCommandArgs>
......@@ -62,7 +61,7 @@ public void ExecuteCommand(TypeCharCommandArgs args, Action nextCommandHandler,
}
}
public VSCommanding.CommandState GetCommandState(TypeCharCommandArgs args, Func<VSCommanding.CommandState> nextCommandHandler)
public CommandState GetCommandState(TypeCharCommandArgs args, Func<CommandState> nextCommandHandler)
=> nextCommandHandler();
}
}
......@@ -16,15 +16,14 @@
using Microsoft.VisualStudio.Text.Operations;
using Microsoft.VisualStudio.Utilities;
using Roslyn.Utilities;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.CSharp.SplitStringLiteral
{
[Export(typeof(VSCommanding.ICommandHandler))]
[Export(typeof(ICommandHandler))]
[ContentType(ContentTypeNames.CSharpContentType)]
[Name(nameof(SplitStringLiteralCommandHandler))]
[Order(After = PredefinedCompletionNames.CompletionCommandHandler)]
internal partial class SplitStringLiteralCommandHandler : VSCommanding.ICommandHandler<ReturnKeyCommandArgs>
internal partial class SplitStringLiteralCommandHandler : ICommandHandler<ReturnKeyCommandArgs>
{
private readonly ITextUndoHistoryRegistry _undoHistoryRegistry;
private readonly IEditorOperationsFactoryService _editorOperationsFactoryService;
......@@ -40,9 +39,9 @@ internal partial class SplitStringLiteralCommandHandler : VSCommanding.ICommandH
public string DisplayName => CSharpEditorResources.Split_string;
public VSCommanding.CommandState GetCommandState(ReturnKeyCommandArgs args)
public CommandState GetCommandState(ReturnKeyCommandArgs args)
{
return VSCommanding.CommandState.Unspecified;
return CommandState.Unspecified;
}
public bool ExecuteCommand(ReturnKeyCommandArgs args, CommandExecutionContext context)
......
......@@ -4,13 +4,13 @@
using Microsoft.CodeAnalysis.Editor.UnitTests;
using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces;
using Microsoft.CodeAnalysis.Test.Utilities;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
using Microsoft.VisualStudio.Text.Operations;
using Roslyn.Test.Utilities;
using Xunit;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.BlockCommentEditing
{
......@@ -686,7 +686,7 @@ protected override TestWorkspace CreateTestWorkspace(string initialMarkup)
protected override (ReturnKeyCommandArgs, string insertionText) CreateCommandArgs(ITextView textView, ITextBuffer textBuffer)
=> (new ReturnKeyCommandArgs(textView, textBuffer), "\r\n");
internal override VSCommanding.ICommandHandler<ReturnKeyCommandArgs> CreateCommandHandler(ITextUndoHistoryRegistry undoHistoryRegistry, IEditorOperationsFactoryService editorOperationsFactoryService)
internal override ICommandHandler<ReturnKeyCommandArgs> CreateCommandHandler(ITextUndoHistoryRegistry undoHistoryRegistry, IEditorOperationsFactoryService editorOperationsFactoryService)
=> new BlockCommentEditingCommandHandler(undoHistoryRegistry, editorOperationsFactoryService);
}
}
......@@ -5,13 +5,13 @@
using Microsoft.CodeAnalysis.Editor.UnitTests;
using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces;
using Microsoft.CodeAnalysis.Test.Utilities;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
using Microsoft.VisualStudio.Text.Operations;
using Roslyn.Test.Utilities;
using Xunit;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.BlockCommentEditing
{
......@@ -367,7 +367,7 @@ protected override TestWorkspace CreateTestWorkspace(string initialMarkup)
protected override (TypeCharCommandArgs, string insertionText) CreateCommandArgs(ITextView textView, ITextBuffer textBuffer)
=> (new TypeCharCommandArgs(textView, textBuffer, '/'), "/");
internal override VSCommanding.ICommandHandler<TypeCharCommandArgs> CreateCommandHandler(ITextUndoHistoryRegistry undoHistoryRegistry, IEditorOperationsFactoryService editorOperationsFactoryService)
internal override ICommandHandler<TypeCharCommandArgs> CreateCommandHandler(ITextUndoHistoryRegistry undoHistoryRegistry, IEditorOperationsFactoryService editorOperationsFactoryService)
=> new CloseBlockCommentCommandHandler();
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Linq;
using Microsoft.CodeAnalysis.Editor.CSharp.CommentSelection;
using Microsoft.CodeAnalysis.Editor.Implementation.CommentSelection;
using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces;
using Microsoft.CodeAnalysis.Test.Utilities;
using Roslyn.Test.Utilities;
using VSCommanding = Microsoft.VisualStudio.Commanding;
using Xunit;
using System.Linq;
using System;
using Microsoft.CodeAnalysis.Test.Utilities.CommentSelection;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Composition;
using Roslyn.Test.Utilities;
using Xunit;
namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.CommentSelection
{
......@@ -224,7 +224,7 @@ void M()
internal override AbstractCommentSelectionBase<ValueTuple> GetToggleCommentCommandHandler(TestWorkspace workspace)
{
return (AbstractCommentSelectionBase<ValueTuple>)workspace.ExportProvider.GetExportedValues<VSCommanding.ICommandHandler>()
return (AbstractCommentSelectionBase<ValueTuple>)workspace.ExportProvider.GetExportedValues<ICommandHandler>()
.First(export => typeof(CSharpToggleBlockCommentCommandHandler).Equals(export.GetType()));
}
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Linq;
using Microsoft.CodeAnalysis.Editor.Implementation.CommentSelection;
using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces;
using Microsoft.CodeAnalysis.Test.Utilities;
using Roslyn.Test.Utilities;
using VSCommanding = Microsoft.VisualStudio.Commanding;
using Xunit;
using System;
using Microsoft.CodeAnalysis.Test.Utilities.CommentSelection;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Composition;
using Roslyn.Test.Utilities;
using Xunit;
namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.CommentSelection
{
......@@ -1051,7 +1051,7 @@ void M()
internal override AbstractCommentSelectionBase<ValueTuple> GetToggleCommentCommandHandler(TestWorkspace workspace)
{
return (AbstractCommentSelectionBase<ValueTuple>)workspace.ExportProvider.GetExportedValues<VSCommanding.ICommandHandler>()
return (AbstractCommentSelectionBase<ValueTuple>)workspace.ExportProvider.GetExportedValues<ICommandHandler>()
.First(export => typeof(ToggleLineCommentCommandHandler).Equals(export.GetType()));
}
......
......@@ -5,9 +5,9 @@
using Microsoft.CodeAnalysis.Editor.UnitTests.CompleteStatement;
using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces;
using Microsoft.CodeAnalysis.Test.Utilities;
using Microsoft.VisualStudio.Commanding;
using Roslyn.Test.Utilities;
using Xunit;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.CompleteStatement
{
......@@ -3757,9 +3757,9 @@ public void Test()
VerifyTypingSemicolon(code, expected);
}
internal override VSCommanding.ICommandHandler GetCommandHandler(TestWorkspace workspace)
internal override ICommandHandler GetCommandHandler(TestWorkspace workspace)
{
return workspace.ExportProvider.GetExportedValues<VSCommanding.ICommandHandler>().OfType<CompleteStatementCommandHandler>().Single();
return workspace.ExportProvider.GetExportedValues<ICommandHandler>().OfType<CompleteStatementCommandHandler>().Single();
}
[WorkItem(32337, "https://github.com/dotnet/roslyn/issues/32337")]
......
......@@ -5,11 +5,11 @@
using Microsoft.CodeAnalysis.Editor.UnitTests.DocumentationComments;
using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces;
using Microsoft.CodeAnalysis.Test.Utilities;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Text.Operations;
using Roslyn.Test.Utilities;
using Xunit;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.DocumentationComments
{
......@@ -1991,7 +1991,7 @@ protected override char DocumentationCommentCharacter
get { return '/'; }
}
internal override VSCommanding.ICommandHandler CreateCommandHandler(
internal override ICommandHandler CreateCommandHandler(
IWaitIndicator waitIndicator,
ITextUndoHistoryRegistry undoHistoryRegistry,
IEditorOperationsFactoryService editorOperationsFactoryService)
......
......@@ -5,14 +5,14 @@
using System.Linq;
using Microsoft.CodeAnalysis.Editor.Shared.Extensions;
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor.Commanding;
using Microsoft.VisualStudio.Utilities;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.Implementation.InlineRename
{
[Export(typeof(VSCommanding.ICommandHandler))]
[Export(typeof(ICommandHandler))]
[ContentType(ContentTypeNames.RoslynContentType)]
[ContentType(ContentTypeNames.XamlContentType)]
[Name(PredefinedCommandHandlerNames.Rename)]
......@@ -39,19 +39,19 @@ internal partial class RenameCommandHandler
public string DisplayName => EditorFeaturesResources.Rename;
private VSCommanding.CommandState GetCommandState(Func<VSCommanding.CommandState> nextHandler)
private CommandState GetCommandState(Func<CommandState> nextHandler)
{
if (_renameService.ActiveSession != null)
{
return VSCommanding.CommandState.Available;
return CommandState.Available;
}
return nextHandler();
}
private VSCommanding.CommandState GetCommandState()
private CommandState GetCommandState()
{
return _renameService.ActiveSession != null ? VSCommanding.CommandState.Available : VSCommanding.CommandState.Unspecified;
return _renameService.ActiveSession != null ? CommandState.Available : CommandState.Unspecified;
}
private void HandlePossibleTypingCommand(EditorCommandArgs args, Action nextHandler, Action<SnapshotSpan> actionIfInsideActiveSpan)
......
......@@ -4,18 +4,17 @@
using Microsoft.CodeAnalysis.Editor.Shared.Extensions;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.Implementation.InlineRename
{
internal partial class RenameCommandHandler : IChainedCommandHandler<BackspaceKeyCommandArgs>, IChainedCommandHandler<DeleteKeyCommandArgs>
{
public VSCommanding.CommandState GetCommandState(BackspaceKeyCommandArgs args, Func<VSCommanding.CommandState> nextHandler)
public CommandState GetCommandState(BackspaceKeyCommandArgs args, Func<CommandState> nextHandler)
{
return GetCommandState(nextHandler);
}
public VSCommanding.CommandState GetCommandState(DeleteKeyCommandArgs args, Func<VSCommanding.CommandState> nextHandler)
public CommandState GetCommandState(DeleteKeyCommandArgs args, Func<CommandState> nextHandler)
{
return GetCommandState(nextHandler);
}
......
......@@ -3,14 +3,13 @@
using System;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.Implementation.InlineRename
{
internal partial class RenameCommandHandler :
IChainedCommandHandler<CutCommandArgs>, IChainedCommandHandler<PasteCommandArgs>
{
public VSCommanding.CommandState GetCommandState(CutCommandArgs args, Func<VSCommanding.CommandState> nextHandler)
public CommandState GetCommandState(CutCommandArgs args, Func<CommandState> nextHandler)
{
return nextHandler();
}
......@@ -23,7 +22,7 @@ public void ExecuteCommand(CutCommandArgs args, Action nextHandler, CommandExecu
});
}
public VSCommanding.CommandState GetCommandState(PasteCommandArgs args, Func<VSCommanding.CommandState> nextHandler)
public CommandState GetCommandState(PasteCommandArgs args, Func<CommandState> nextHandler)
{
return nextHandler();
}
......
......@@ -4,13 +4,12 @@
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
using Microsoft.VisualStudio.Text.Editor;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.Implementation.InlineRename
{
internal partial class RenameCommandHandler : VSCommanding.ICommandHandler<EscapeKeyCommandArgs>
internal partial class RenameCommandHandler : ICommandHandler<EscapeKeyCommandArgs>
{
public VSCommanding.CommandState GetCommandState(EscapeKeyCommandArgs args)
public CommandState GetCommandState(EscapeKeyCommandArgs args)
{
return GetCommandState();
}
......
......@@ -6,30 +6,29 @@
using Microsoft.CodeAnalysis.Editor.Shared.Extensions;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.Implementation.InlineRename
{
internal partial class RenameCommandHandler :
VSCommanding.ICommandHandler<LineStartCommandArgs>, VSCommanding.ICommandHandler<LineEndCommandArgs>,
VSCommanding.ICommandHandler<LineStartExtendCommandArgs>, VSCommanding.ICommandHandler<LineEndExtendCommandArgs>
ICommandHandler<LineStartCommandArgs>, ICommandHandler<LineEndCommandArgs>,
ICommandHandler<LineStartExtendCommandArgs>, ICommandHandler<LineEndExtendCommandArgs>
{
public VSCommanding.CommandState GetCommandState(LineStartCommandArgs args)
public CommandState GetCommandState(LineStartCommandArgs args)
{
return GetCommandState();
}
public VSCommanding.CommandState GetCommandState(LineEndCommandArgs args)
public CommandState GetCommandState(LineEndCommandArgs args)
{
return GetCommandState();
}
public VSCommanding.CommandState GetCommandState(LineStartExtendCommandArgs args)
public CommandState GetCommandState(LineStartExtendCommandArgs args)
{
return GetCommandState();
}
public VSCommanding.CommandState GetCommandState(LineEndExtendCommandArgs args)
public CommandState GetCommandState(LineEndExtendCommandArgs args)
{
return GetCommandState();
}
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.Implementation.InlineRename
{
internal partial class RenameCommandHandler :
VSCommanding.ICommandHandler<MoveSelectedLinesUpCommandArgs>, VSCommanding.ICommandHandler<MoveSelectedLinesDownCommandArgs>
ICommandHandler<MoveSelectedLinesUpCommandArgs>, ICommandHandler<MoveSelectedLinesDownCommandArgs>
{
public VSCommanding.CommandState GetCommandState(MoveSelectedLinesUpCommandArgs args)
public CommandState GetCommandState(MoveSelectedLinesUpCommandArgs args)
{
return VSCommanding.CommandState.Unspecified;
return CommandState.Unspecified;
}
public bool ExecuteCommand(MoveSelectedLinesUpCommandArgs args, CommandExecutionContext context)
......@@ -21,9 +19,9 @@ public bool ExecuteCommand(MoveSelectedLinesUpCommandArgs args, CommandExecution
return false;
}
public VSCommanding.CommandState GetCommandState(MoveSelectedLinesDownCommandArgs args)
public CommandState GetCommandState(MoveSelectedLinesDownCommandArgs args)
{
return VSCommanding.CommandState.Unspecified;
return CommandState.Unspecified;
}
public bool ExecuteCommand(MoveSelectedLinesDownCommandArgs args, CommandExecutionContext context)
......
......@@ -3,13 +3,12 @@
using System;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.Implementation.InlineRename
{
internal partial class RenameCommandHandler : IChainedCommandHandler<OpenLineAboveCommandArgs>
{
public VSCommanding.CommandState GetCommandState(OpenLineAboveCommandArgs args, Func<VSCommanding.CommandState> nextHandler)
public CommandState GetCommandState(OpenLineAboveCommandArgs args, Func<CommandState> nextHandler)
{
return GetCommandState(nextHandler);
}
......
......@@ -3,13 +3,12 @@
using System;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.Implementation.InlineRename
{
internal partial class RenameCommandHandler : IChainedCommandHandler<OpenLineBelowCommandArgs>
{
public VSCommanding.CommandState GetCommandState(OpenLineBelowCommandArgs args, Func<VSCommanding.CommandState> nextHandler)
public CommandState GetCommandState(OpenLineBelowCommandArgs args, Func<CommandState> nextHandler)
{
return GetCommandState(nextHandler);
}
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.Implementation.InlineRename
{
internal partial class RenameCommandHandler :
VSCommanding.ICommandHandler<ReorderParametersCommandArgs>,
VSCommanding.ICommandHandler<RemoveParametersCommandArgs>,
VSCommanding.ICommandHandler<ExtractInterfaceCommandArgs>,
VSCommanding.ICommandHandler<EncapsulateFieldCommandArgs>
ICommandHandler<ReorderParametersCommandArgs>,
ICommandHandler<RemoveParametersCommandArgs>,
ICommandHandler<ExtractInterfaceCommandArgs>,
ICommandHandler<EncapsulateFieldCommandArgs>
{
public VSCommanding.CommandState GetCommandState(ReorderParametersCommandArgs args)
public CommandState GetCommandState(ReorderParametersCommandArgs args)
{
return VSCommanding.CommandState.Unspecified;
return CommandState.Unspecified;
}
public bool ExecuteCommand(ReorderParametersCommandArgs args, CommandExecutionContext context)
......@@ -24,9 +22,9 @@ public bool ExecuteCommand(ReorderParametersCommandArgs args, CommandExecutionCo
return false;
}
public VSCommanding.CommandState GetCommandState(RemoveParametersCommandArgs args)
public CommandState GetCommandState(RemoveParametersCommandArgs args)
{
return VSCommanding.CommandState.Unspecified;
return CommandState.Unspecified;
}
public bool ExecuteCommand(RemoveParametersCommandArgs args, CommandExecutionContext context)
......@@ -35,9 +33,9 @@ public bool ExecuteCommand(RemoveParametersCommandArgs args, CommandExecutionCon
return false;
}
public VSCommanding.CommandState GetCommandState(ExtractInterfaceCommandArgs args)
public CommandState GetCommandState(ExtractInterfaceCommandArgs args)
{
return VSCommanding.CommandState.Unspecified;
return CommandState.Unspecified;
}
public bool ExecuteCommand(ExtractInterfaceCommandArgs args, CommandExecutionContext context)
......@@ -46,9 +44,9 @@ public bool ExecuteCommand(ExtractInterfaceCommandArgs args, CommandExecutionCon
return false;
}
public VSCommanding.CommandState GetCommandState(EncapsulateFieldCommandArgs args)
public CommandState GetCommandState(EncapsulateFieldCommandArgs args)
{
return VSCommanding.CommandState.Unspecified;
return CommandState.Unspecified;
}
public bool ExecuteCommand(EncapsulateFieldCommandArgs args, CommandExecutionContext context)
......
......@@ -6,28 +6,27 @@
using Microsoft.CodeAnalysis.Editor.Shared.Extensions;
using Microsoft.CodeAnalysis.Notification;
using Roslyn.Utilities;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.Implementation.InlineRename
{
internal partial class RenameCommandHandler : VSCommanding.ICommandHandler<RenameCommandArgs>
internal partial class RenameCommandHandler : ICommandHandler<RenameCommandArgs>
{
public VSCommanding.CommandState GetCommandState(RenameCommandArgs args)
public CommandState GetCommandState(RenameCommandArgs args)
{
var caretPoint = args.TextView.GetCaretPoint(args.SubjectBuffer);
if (!caretPoint.HasValue)
{
return VSCommanding.CommandState.Unspecified;
return CommandState.Unspecified;
}
if (!args.SubjectBuffer.TryGetWorkspace(out var workspace) ||
!workspace.CanApplyChange(ApplyChangesKind.ChangeDocument) ||
!args.SubjectBuffer.SupportsRename())
{
return VSCommanding.CommandState.Unspecified;
return CommandState.Unspecified;
}
return VSCommanding.CommandState.Available;
return CommandState.Available;
}
public bool ExecuteCommand(RenameCommandArgs args, CommandExecutionContext context)
......
......@@ -4,13 +4,12 @@
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
using Microsoft.VisualStudio.Text.Editor;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.Implementation.InlineRename
{
internal partial class RenameCommandHandler : VSCommanding.ICommandHandler<ReturnKeyCommandArgs>
internal partial class RenameCommandHandler : ICommandHandler<ReturnKeyCommandArgs>
{
public VSCommanding.CommandState GetCommandState(ReturnKeyCommandArgs args)
public CommandState GetCommandState(ReturnKeyCommandArgs args)
{
return GetCommandState();
}
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
using Microsoft.VisualStudio.Text.Editor;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.Implementation.InlineRename
{
internal partial class RenameCommandHandler : VSCommanding.ICommandHandler<SaveCommandArgs>
internal partial class RenameCommandHandler : ICommandHandler<SaveCommandArgs>
{
public VSCommanding.CommandState GetCommandState(SaveCommandArgs args)
public CommandState GetCommandState(SaveCommandArgs args)
{
return GetCommandState();
}
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
using Microsoft.CodeAnalysis.Editor.Shared.Extensions;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.Implementation.InlineRename
{
internal partial class RenameCommandHandler :
VSCommanding.ICommandHandler<SelectAllCommandArgs>
ICommandHandler<SelectAllCommandArgs>
{
public VSCommanding.CommandState GetCommandState(SelectAllCommandArgs args)
public CommandState GetCommandState(SelectAllCommandArgs args)
{
return GetCommandState();
}
......
......@@ -7,7 +7,6 @@
using Microsoft.CodeAnalysis.Editor.Shared.Extensions;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.Implementation.InlineRename
{
......@@ -15,7 +14,7 @@ internal partial class RenameCommandHandler :
IChainedCommandHandler<TabKeyCommandArgs>,
IChainedCommandHandler<BackTabKeyCommandArgs>
{
public VSCommanding.CommandState GetCommandState(TabKeyCommandArgs args, Func<VSCommanding.CommandState> nextHandler)
public CommandState GetCommandState(TabKeyCommandArgs args, Func<CommandState> nextHandler)
{
return GetCommandState(nextHandler);
}
......@@ -50,7 +49,7 @@ public void ExecuteCommand(TabKeyCommandArgs args, Action nextHandler, CommandEx
});
}
public VSCommanding.CommandState GetCommandState(BackTabKeyCommandArgs args, Func<VSCommanding.CommandState> nextHandler)
public CommandState GetCommandState(BackTabKeyCommandArgs args, Func<CommandState> nextHandler)
{
return GetCommandState(nextHandler);
}
......
......@@ -5,7 +5,6 @@
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
using Microsoft.CodeAnalysis.LanguageServices;
using Microsoft.CodeAnalysis.Text;
using VSCommanding = Microsoft.VisualStudio.Commanding;
using Microsoft.CodeAnalysis.Shared.Extensions;
namespace Microsoft.CodeAnalysis.Editor.Implementation.InlineRename
......@@ -13,7 +12,7 @@ namespace Microsoft.CodeAnalysis.Editor.Implementation.InlineRename
internal partial class RenameCommandHandler :
IChainedCommandHandler<TypeCharCommandArgs>
{
public VSCommanding.CommandState GetCommandState(TypeCharCommandArgs args, Func<VSCommanding.CommandState> nextHandler)
public CommandState GetCommandState(TypeCharCommandArgs args, Func<CommandState> nextHandler)
{
return GetCommandState(nextHandler);
}
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.Implementation.InlineRename
{
internal partial class RenameCommandHandler :
VSCommanding.ICommandHandler<UndoCommandArgs>, VSCommanding.ICommandHandler<RedoCommandArgs>
ICommandHandler<UndoCommandArgs>, ICommandHandler<RedoCommandArgs>
{
public VSCommanding.CommandState GetCommandState(UndoCommandArgs args)
public CommandState GetCommandState(UndoCommandArgs args)
{
return GetCommandState();
}
public VSCommanding.CommandState GetCommandState(RedoCommandArgs args)
public CommandState GetCommandState(RedoCommandArgs args)
{
return GetCommandState();
}
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Linq;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
using Microsoft.CodeAnalysis.Editor.Shared.Extensions;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.Implementation.InlineRename
{
internal partial class RenameCommandHandler :
VSCommanding.ICommandHandler<WordDeleteToStartCommandArgs>,
VSCommanding.ICommandHandler<WordDeleteToEndCommandArgs>
ICommandHandler<WordDeleteToStartCommandArgs>,
ICommandHandler<WordDeleteToEndCommandArgs>
{
public VSCommanding.CommandState GetCommandState(WordDeleteToStartCommandArgs args)
public CommandState GetCommandState(WordDeleteToStartCommandArgs args)
{
return GetCommandState();
}
public VSCommanding.CommandState GetCommandState(WordDeleteToEndCommandArgs args)
public CommandState GetCommandState(WordDeleteToEndCommandArgs args)
{
return GetCommandState();
}
......
......@@ -2,7 +2,6 @@
using System;
using System.Diagnostics;
using Microsoft.CodeAnalysis.Editor.Shared.Extensions;
using Microsoft.VisualStudio.InteractiveWindow;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
......@@ -14,13 +13,12 @@
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Text.Editor.Commanding;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.Interactive
{
internal abstract class InteractiveCommandHandler :
VSCommanding.ICommandHandler<ExecuteInInteractiveCommandArgs>,
VSCommanding.ICommandHandler<CopyToInteractiveCommandArgs>
ICommandHandler<ExecuteInInteractiveCommandArgs>,
ICommandHandler<CopyToInteractiveCommandArgs>
{
private readonly IContentTypeRegistryService _contentTypeRegistryService;
private readonly IEditorOptionsFactoryService _editorOptionsFactoryService;
......@@ -51,12 +49,12 @@ private string GetSelectedText(EditorCommandArgs args, CancellationToken cancell
return SendToInteractiveSubmissionProvider.GetSelectedText(editorOptions, args, cancellationToken);
}
VSCommanding.CommandState VSCommanding.ICommandHandler<ExecuteInInteractiveCommandArgs>.GetCommandState(ExecuteInInteractiveCommandArgs args)
CommandState ICommandHandler<ExecuteInInteractiveCommandArgs>.GetCommandState(ExecuteInInteractiveCommandArgs args)
{
return VSCommanding.CommandState.Available;
return CommandState.Available;
}
bool VSCommanding.ICommandHandler<ExecuteInInteractiveCommandArgs>.ExecuteCommand(ExecuteInInteractiveCommandArgs args, CommandExecutionContext context)
bool ICommandHandler<ExecuteInInteractiveCommandArgs>.ExecuteCommand(ExecuteInInteractiveCommandArgs args, CommandExecutionContext context)
{
var window = OpenInteractiveWindow(focus: false);
using (context.OperationContext.AddScope(allowCancellation: true, InteractiveEditorFeaturesResources.Executing_selection_in_Interactive_Window))
......@@ -71,12 +69,12 @@ bool VSCommanding.ICommandHandler<ExecuteInInteractiveCommandArgs>.ExecuteComman
return true;
}
VSCommanding.CommandState VSCommanding.ICommandHandler<CopyToInteractiveCommandArgs>.GetCommandState(CopyToInteractiveCommandArgs args)
CommandState ICommandHandler<CopyToInteractiveCommandArgs>.GetCommandState(CopyToInteractiveCommandArgs args)
{
return VSCommanding.CommandState.Available;
return CommandState.Available;
}
bool VSCommanding.ICommandHandler<CopyToInteractiveCommandArgs>.ExecuteCommand(CopyToInteractiveCommandArgs args, CommandExecutionContext context)
bool ICommandHandler<CopyToInteractiveCommandArgs>.ExecuteCommand(CopyToInteractiveCommandArgs args, CommandExecutionContext context)
{
var window = OpenInteractiveWindow(focus: true);
var buffer = window.CurrentLanguageBuffer;
......
......@@ -13,7 +13,6 @@
using Microsoft.VisualStudio.InteractiveWindow;
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
using Microsoft.VisualStudio.Commanding;
using VSCommanding = Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion;
namespace Microsoft.CodeAnalysis.Editor.CommandHandlers
......@@ -21,14 +20,14 @@ namespace Microsoft.CodeAnalysis.Editor.CommandHandlers
// This command handler must be invoked after the handlers specified in `Order` attribute
// (those handlers also implement `ICommandHandler<PasteCommandArgs>`),
// because it will intercept the paste command and skip the rest of handlers in chain.
[Export(typeof(VSCommanding.ICommandHandler))]
[Export(typeof(ICommandHandler))]
[ContentType(ContentTypeNames.RoslynContentType)]
[Name(PredefinedCommandHandlerNames.InteractivePaste)]
[Order(After = PredefinedCommandHandlerNames.Rename)]
[Order(After = PredefinedCommandHandlerNames.FormatDocument)]
[Order(After = PredefinedCommandHandlerNames.Commit)]
[Order(After = PredefinedCompletionNames.CompletionCommandHandler)]
internal sealed class InteractivePasteCommandHandler : VSCommanding.ICommandHandler<PasteCommandArgs>
internal sealed class InteractivePasteCommandHandler : ICommandHandler<PasteCommandArgs>
{
// The following two field definitions have to stay in sync with VS editor implementation
......@@ -75,9 +74,9 @@ public bool ExecuteCommand(PasteCommandArgs args, CommandExecutionContext contex
}
}
public VSCommanding.CommandState GetCommandState(PasteCommandArgs args)
public CommandState GetCommandState(PasteCommandArgs args)
{
return VSCommanding.CommandState.Unspecified;
return CommandState.Unspecified;
}
[MethodImpl(MethodImplOptions.NoInlining)] // Avoid loading InteractiveWindow unless necessary
......
......@@ -5,14 +5,13 @@
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
using Microsoft.VisualStudio.Text.Outlining;
using Microsoft.VisualStudio.Utilities;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.Implementation.Structure
{
[Export(typeof(VSCommanding.ICommandHandler))]
[Export(typeof(ICommandHandler))]
[ContentType(ContentTypeNames.RoslynContentType)]
[Name("Outlining Command Handler")]
internal sealed class OutliningCommandHandler : VSCommanding.ICommandHandler<StartAutomaticOutliningCommandArgs>
internal sealed class OutliningCommandHandler : ICommandHandler<StartAutomaticOutliningCommandArgs>
{
private readonly IOutliningManagerService _outliningManagerService;
......@@ -30,7 +29,7 @@ public bool ExecuteCommand(StartAutomaticOutliningCommandArgs args, CommandExecu
return false;
}
public VSCommanding.CommandState GetCommandState(StartAutomaticOutliningCommandArgs args)
public CommandState GetCommandState(StartAutomaticOutliningCommandArgs args)
{
var outliningManager = _outliningManagerService.GetOutliningManager(args.TextView);
var enabled = false;
......@@ -39,7 +38,7 @@ public VSCommanding.CommandState GetCommandState(StartAutomaticOutliningCommandA
enabled = outliningManager.Enabled;
}
return new VSCommanding.CommandState(isAvailable: !enabled);
return new CommandState(isAvailable: !enabled);
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor
{
/// <summary>
/// The base class of all command argument types used by ICommandHandler.
/// </summary>
internal abstract class CommandArgs
{
/// <summary>
/// The text buffer of where the caret is when the command happens.
/// </summary>
public ITextBuffer SubjectBuffer { get; }
/// <summary>
/// The text view that originated this command.
/// </summary>
public ITextView TextView { get; }
public CommandArgs(ITextView textView, ITextBuffer subjectBuffer)
{
this.TextView = textView ?? throw new ArgumentNullException(nameof(textView));
this.SubjectBuffer = subjectBuffer ?? throw new ArgumentNullException(nameof(subjectBuffer));
}
}
}
......@@ -14,11 +14,10 @@
using Microsoft.CodeAnalysis.Text;
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Text.Editor.Commanding;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.CommandHandlers
{
internal abstract class AbstractGoToCommandHandler<TLanguageService, TCommandArgs> : VSCommanding.ICommandHandler<TCommandArgs>
internal abstract class AbstractGoToCommandHandler<TLanguageService, TCommandArgs> : ICommandHandler<TCommandArgs>
where TLanguageService : class, ILanguageService
where TCommandArgs : EditorCommandArgs
{
......@@ -27,9 +26,9 @@ internal abstract class AbstractGoToCommandHandler<TLanguageService, TCommandArg
public abstract string DisplayName { get; }
protected abstract string _scopeDescription { get; }
protected abstract string ScopeDescription { get; }
protected abstract FunctionId _functionId { get; }
protected abstract FunctionId FunctionId { get; }
protected abstract Task FindAction(TLanguageService service, Document document, int caretPosition, IFindUsagesContext context);
......@@ -41,19 +40,19 @@ internal abstract class AbstractGoToCommandHandler<TLanguageService, TCommandArg
_streamingPresenter = streamingPresenter;
}
public VSCommanding.CommandState GetCommandState(TCommandArgs args)
public CommandState GetCommandState(TCommandArgs args)
{
// Because this is expensive to compute, we just always say yes as long as the language allows it.
var document = args.SubjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
var findUsagesService = document?.GetLanguageService<TLanguageService>();
return findUsagesService != null
? VSCommanding.CommandState.Available
: VSCommanding.CommandState.Unavailable;
? CommandState.Available
: CommandState.Unavailable;
}
public bool ExecuteCommand(TCommandArgs args, CommandExecutionContext context)
{
using (context.OperationContext.AddScope(allowCancellation: true, _scopeDescription))
using (context.OperationContext.AddScope(allowCancellation: true, ScopeDescription))
{
var subjectBuffer = args.SubjectBuffer;
if (!subjectBuffer.TryGetWorkspace(out var workspace))
......@@ -92,7 +91,7 @@ public bool ExecuteCommand(TCommandArgs args, CommandExecutionContext context)
string messageToShow = null;
var userCancellationToken = context.OperationContext.UserCancellationToken;
using (Logger.LogBlock(_functionId, KeyValueLogMessage.Create(LogType.UserAction), userCancellationToken))
using (Logger.LogBlock(FunctionId, KeyValueLogMessage.Create(LogType.UserAction), userCancellationToken))
{
StreamingGoTo(
document, caretPosition,
......
......@@ -8,7 +8,6 @@
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
using Microsoft.VisualStudio.Utilities;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.CommandHandlers
{
......@@ -18,11 +17,11 @@ namespace Microsoft.CodeAnalysis.Editor.CommandHandlers
/// in order to ensure that the interactive command can be exposed without the necessity
/// to load any of the interactive dll files just to get the command's status.
/// </summary>
[Export(typeof(VSCommanding.ICommandHandler))]
[Export(typeof(ICommandHandler))]
[ContentType(ContentTypeNames.RoslynContentType)]
[Name("Interactive Command Handler")]
internal class ExecuteInInteractiveCommandHandler
: VSCommanding.ICommandHandler<ExecuteInInteractiveCommandArgs>
: ICommandHandler<ExecuteInInteractiveCommandArgs>
{
private readonly IEnumerable<Lazy<IExecuteInInteractiveCommandHandler, ContentTypeMetadata>> _executeInInteractiveHandlers;
......@@ -42,16 +41,16 @@ private Lazy<IExecuteInInteractiveCommandHandler> GetCommandHandler(ITextBuffer
.SingleOrDefault();
}
bool VSCommanding.ICommandHandler<ExecuteInInteractiveCommandArgs>.ExecuteCommand(ExecuteInInteractiveCommandArgs args, CommandExecutionContext context)
bool ICommandHandler<ExecuteInInteractiveCommandArgs>.ExecuteCommand(ExecuteInInteractiveCommandArgs args, CommandExecutionContext context)
{
return GetCommandHandler(args.SubjectBuffer)?.Value.ExecuteCommand(args, context) ?? false;
}
VSCommanding.CommandState VSCommanding.ICommandHandler<ExecuteInInteractiveCommandArgs>.GetCommandState(ExecuteInInteractiveCommandArgs args)
CommandState ICommandHandler<ExecuteInInteractiveCommandArgs>.GetCommandState(ExecuteInInteractiveCommandArgs args)
{
return GetCommandHandler(args.SubjectBuffer) == null
? VSCommanding.CommandState.Unavailable
: VSCommanding.CommandState.Available;
? CommandState.Unavailable
: CommandState.Available;
}
}
}
......@@ -5,7 +5,6 @@
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Editor.Shared;
using Microsoft.CodeAnalysis.Editor.Shared.Extensions;
using Microsoft.CodeAnalysis.LanguageServices;
using Microsoft.CodeAnalysis.Shared.Extensions;
......@@ -17,16 +16,15 @@
using Microsoft.VisualStudio.Text.Outlining;
using Microsoft.VisualStudio.Utilities;
using Roslyn.Utilities;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.CommandHandlers
{
[Export(typeof(VSCommanding.ICommandHandler))]
[Export(typeof(ICommandHandler))]
[ContentType(ContentTypeNames.RoslynContentType)]
[Name(PredefinedCommandHandlerNames.GoToAdjacentMember)]
internal class GoToAdjacentMemberCommandHandler :
VSCommanding.ICommandHandler<GoToNextMemberCommandArgs>,
VSCommanding.ICommandHandler<GoToPreviousMemberCommandArgs>
ICommandHandler<GoToNextMemberCommandArgs>,
ICommandHandler<GoToPreviousMemberCommandArgs>
{
private readonly IOutliningManagerService _outliningManagerService;
......@@ -38,7 +36,7 @@ public GoToAdjacentMemberCommandHandler(IOutliningManagerService outliningManage
_outliningManagerService = outliningManagerService;
}
public VSCommanding.CommandState GetCommandState(GoToNextMemberCommandArgs args)
public CommandState GetCommandState(GoToNextMemberCommandArgs args)
{
return GetCommandStateImpl(args);
}
......@@ -48,7 +46,7 @@ public bool ExecuteCommand(GoToNextMemberCommandArgs args, CommandExecutionConte
return ExecuteCommandImpl(args, gotoNextMember: true, context);
}
public VSCommanding.CommandState GetCommandState(GoToPreviousMemberCommandArgs args)
public CommandState GetCommandState(GoToPreviousMemberCommandArgs args)
{
return GetCommandStateImpl(args);
}
......@@ -58,22 +56,22 @@ public bool ExecuteCommand(GoToPreviousMemberCommandArgs args, CommandExecutionC
return ExecuteCommandImpl(args, gotoNextMember: false, context);
}
private VSCommanding.CommandState GetCommandStateImpl(EditorCommandArgs args)
private CommandState GetCommandStateImpl(EditorCommandArgs args)
{
var subjectBuffer = args.SubjectBuffer;
var caretPoint = args.TextView.GetCaretPoint(subjectBuffer);
if (!caretPoint.HasValue || !subjectBuffer.SupportsNavigationToAnyPosition())
{
return VSCommanding.CommandState.Unspecified;
return CommandState.Unspecified;
}
var document = subjectBuffer.CurrentSnapshot.GetOpenDocumentInCurrentContextWithChanges();
if (document?.SupportsSyntaxTree != true)
{
return VSCommanding.CommandState.Unspecified;
return CommandState.Unspecified;
}
return VSCommanding.CommandState.Available;
return CommandState.Available;
}
private bool ExecuteCommandImpl(EditorCommandArgs args, bool gotoNextMember, CommandExecutionContext context)
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.VisualStudio.Commanding;
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.CommandHandlers
{
......@@ -11,7 +11,7 @@ namespace Microsoft.CodeAnalysis.Editor.CommandHandlers
/// without actually being instantiated as all other command handlers.
/// </summary>
internal interface IExecuteInInteractiveCommandHandler
: VSCommanding.ICommandHandler<ExecuteInInteractiveCommandArgs>
: ICommandHandler<ExecuteInInteractiveCommandArgs>
{
}
}
......@@ -12,7 +12,6 @@
using Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion;
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
using Microsoft.VisualStudio.Utilities;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.CommandHandlers
{
......@@ -33,7 +32,7 @@ namespace Microsoft.CodeAnalysis.Editor.CommandHandlers
/// It is called after <see cref="PredefinedCompletionNames.CompletionCommandHandler"/>.
/// </summary>
[Export]
[Export(typeof(VSCommanding.ICommandHandler))]
[Export(typeof(ICommandHandler))]
[ContentType(ContentTypeNames.RoslynContentType)]
[Name(PredefinedCommandHandlerNames.SignatureHelpAfterCompletion)]
[Order(After = PredefinedCompletionNames.CompletionCommandHandler)]
......@@ -56,17 +55,17 @@ internal class SignatureHelpAfterCompletionCommandHandler :
{
}
public VSCommanding.CommandState GetCommandState(EscapeKeyCommandArgs args, Func<VSCommanding.CommandState> nextHandler)
public CommandState GetCommandState(EscapeKeyCommandArgs args, Func<CommandState> nextHandler)
{
return nextHandler();
}
public VSCommanding.CommandState GetCommandState(UpKeyCommandArgs args, Func<VSCommanding.CommandState> nextHandler)
public CommandState GetCommandState(UpKeyCommandArgs args, Func<CommandState> nextHandler)
{
return nextHandler();
}
public VSCommanding.CommandState GetCommandState(DownKeyCommandArgs args, Func<VSCommanding.CommandState> nextHandler)
public CommandState GetCommandState(DownKeyCommandArgs args, Func<CommandState> nextHandler)
{
return nextHandler();
}
......
......@@ -13,7 +13,6 @@
using Microsoft.VisualStudio.Text.Editor.Commanding;
using Microsoft.VisualStudio.Text.Editor.Commanding.Commands;
using Microsoft.VisualStudio.Utilities;
using VSCommanding = Microsoft.VisualStudio.Commanding;
namespace Microsoft.CodeAnalysis.Editor.CommandHandlers
{
......@@ -33,7 +32,7 @@ namespace Microsoft.CodeAnalysis.Editor.CommandHandlers
/// It is called before <see cref="PredefinedCompletionNames.CompletionCommandHandler"/>.
/// </summary>
[Export]
[Export(typeof(VSCommanding.ICommandHandler))]
[Export(typeof(ICommandHandler))]
[ContentType(ContentTypeNames.RoslynContentType)]
[Name(PredefinedCommandHandlerNames.SignatureHelpBeforeCompletion)]
[Order(Before = PredefinedCompletionNames.CompletionCommandHandler)]
......@@ -55,7 +54,7 @@ internal class SignatureHelpBeforeCompletionCommandHandler :
{
}
private bool TryGetControllerCommandHandler<TCommandArgs>(TCommandArgs args, out VSCommanding.ICommandHandler commandHandler)
private bool TryGetControllerCommandHandler<TCommandArgs>(TCommandArgs args, out ICommandHandler commandHandler)
where TCommandArgs : EditorCommandArgs
{
AssertIsForeground();
......@@ -69,9 +68,9 @@ private bool TryGetControllerCommandHandler<TCommandArgs>(TCommandArgs args, out
return true;
}
private VSCommanding.CommandState GetCommandStateWorker<TCommandArgs>(
private CommandState GetCommandStateWorker<TCommandArgs>(
TCommandArgs args,
Func<VSCommanding.CommandState> nextHandler)
Func<CommandState> nextHandler)
where TCommandArgs : EditorCommandArgs
{
AssertIsForeground();
......@@ -97,7 +96,7 @@ private bool TryGetControllerCommandHandler<TCommandArgs>(TCommandArgs args, out
}
}
VSCommanding.CommandState IChainedCommandHandler<TypeCharCommandArgs>.GetCommandState(TypeCharCommandArgs args, Func<VSCommanding.CommandState> nextHandler)
CommandState IChainedCommandHandler<TypeCharCommandArgs>.GetCommandState(TypeCharCommandArgs args, Func<CommandState> nextHandler)
{
AssertIsForeground();
return GetCommandStateWorker(args, nextHandler);
......@@ -109,10 +108,10 @@ void IChainedCommandHandler<TypeCharCommandArgs>.ExecuteCommand(TypeCharCommandA
ExecuteCommandWorker(args, nextHandler, context);
}
VSCommanding.CommandState IChainedCommandHandler<InvokeSignatureHelpCommandArgs>.GetCommandState(InvokeSignatureHelpCommandArgs args, Func<VSCommanding.CommandState> nextHandler)
CommandState IChainedCommandHandler<InvokeSignatureHelpCommandArgs>.GetCommandState(InvokeSignatureHelpCommandArgs args, Func<CommandState> nextHandler)
{
AssertIsForeground();
return GetCommandStateWorker(args, nextHandler);
return CommandState.Available;
}
void IChainedCommandHandler<InvokeSignatureHelpCommandArgs>.ExecuteCommand(InvokeSignatureHelpCommandArgs args, Action nextHandler, CommandExecutionContext context)
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.CodeAnalysis.Editor
{
/// <summary>
/// Represents the various states that a command might have.
/// </summary>
internal struct CommandState
{
/// <summary>
/// If true, the command should be visible and enabled in the UI.
/// </summary>
public bool IsAvailable { get; }
/// <summary>
/// If true, the command should appear as checked (i.e. toggled) in the UI.
/// </summary>
public bool IsChecked { get; }
/// <summary>
/// If specified, returns the custom text that should be displayed in the UI.
/// </summary>
public string DisplayText { get; }
public CommandState(bool isAvailable = false, bool isChecked = false, string displayText = null)
: this()
{
this.IsAvailable = isAvailable;
this.IsChecked = isChecked;
this.DisplayText = displayText;
}
public static CommandState Available
{
get { return new CommandState(isAvailable: true); }
}
public static CommandState Unavailable
{
get { return new CommandState(isAvailable: false); }
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for automatic line ender command
/// </summary>
[ExcludeFromCodeCoverage]
internal class AutomaticLineEnderCommandArgs : CommandArgs
{
public AutomaticLineEnderCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for the Shift+Tab key combination being pressed.
/// </summary>
[ExcludeFromCodeCoverage]
internal class BackTabKeyCommandArgs : CommandArgs
{
public BackTabKeyCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for the backspace key being pressed.
/// </summary>
[ExcludeFromCodeCoverage]
internal class BackspaceKeyCommandArgs : CommandArgs
{
public BackspaceKeyCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
[ExcludeFromCodeCoverage]
internal class CommentSelectionCommandArgs : CommandArgs
{
public CommentSelectionCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
[ExcludeFromCodeCoverage]
internal class CommitUniqueCompletionListItemCommandArgs : CommandArgs
{
public CommitUniqueCompletionListItemCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for the copy command
/// </summary>
[ExcludeFromCodeCoverage]
internal class CopyCommandArgs : CommandArgs
{
public CopyCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for the copy to interactive command.
/// </summary>
[ExcludeFromCodeCoverage]
internal class CopyToInteractiveCommandArgs : CommandArgs
{
public CopyToInteractiveCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for the cut command
/// </summary>
[ExcludeFromCodeCoverage]
internal class CutCommandArgs : CommandArgs
{
public CutCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for the backspace key being pressed.
/// </summary>
[ExcludeFromCodeCoverage]
internal class DeleteKeyCommandArgs : CommandArgs
{
public DeleteKeyCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
[ExcludeFromCodeCoverage]
internal class DocumentEndCommandArgs : CommandArgs
{
public DocumentEndCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
[ExcludeFromCodeCoverage]
internal class DocumentStartCommandArgs : CommandArgs
{
public DocumentStartCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for the Down arrow key being pressed.
/// </summary>
[ExcludeFromCodeCoverage]
internal class DownKeyCommandArgs : CommandArgs
{
public DownKeyCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for the rename command.
/// </summary>
[ExcludeFromCodeCoverage]
internal class EncapsulateFieldCommandArgs : CommandArgs
{
public EncapsulateFieldCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for the escape key being typed.
/// </summary>
[ExcludeFromCodeCoverage]
internal class EscapeKeyCommandArgs : CommandArgs
{
public EscapeKeyCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for the execute in interactive command.
/// </summary>
[ExcludeFromCodeCoverage]
internal class ExecuteInInteractiveCommandArgs : CommandArgs
{
public ExecuteInInteractiveCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for the Edit.ExtractInterface command.
/// </summary>
[ExcludeFromCodeCoverage]
internal class ExtractInterfaceCommandArgs : CommandArgs
{
public ExtractInterfaceCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for the rename command.
/// </summary>
[ExcludeFromCodeCoverage]
internal class ExtractMethodCommandArgs : CommandArgs
{
public ExtractMethodCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for find references
/// </summary>
[ExcludeFromCodeCoverage]
internal class FindReferencesCommandArgs : CommandArgs
{
public FindReferencesCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for the Format Document command being invoked.
/// </summary>
[ExcludeFromCodeCoverage]
internal class FormatDocumentCommandArgs : CommandArgs
{
public FormatDocumentCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for the Format Selection command being invoked.
/// </summary>
[ExcludeFromCodeCoverage]
internal class FormatSelectionCommandArgs : CommandArgs
{
public FormatSelectionCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
[ExcludeFromCodeCoverage]
internal class GoToAdjacentMemberCommandArgs : CommandArgs
{
public GoToAdjacentMemberCommandArgs(ITextView textView, ITextBuffer subjectBuffer, NavigateDirection direction)
: base(textView, subjectBuffer)
{
Direction = direction;
}
public NavigateDirection Direction { get; }
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for Go To Definition.
/// </summary>
[ExcludeFromCodeCoverage]
internal class GoToDefinitionCommandArgs : CommandArgs
{
public GoToDefinitionCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for Go To Implementation.
/// </summary>
[ExcludeFromCodeCoverage]
internal sealed class GoToImplementationCommandArgs : CommandArgs
{
public GoToImplementationCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
[ExcludeFromCodeCoverage]
internal class InsertCommentCommandArgs : CommandArgs
{
public InsertCommentCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for Edit.InsertSnippet
/// </summary>
[ExcludeFromCodeCoverage]
internal class InsertSnippetCommandArgs : CommandArgs
{
public InsertSnippetCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
[ExcludeFromCodeCoverage]
internal class InvokeCompletionListCommandArgs : CommandArgs
{
public InvokeCompletionListCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
[ExcludeFromCodeCoverage]
internal class InvokeSignatureHelpCommandArgs : CommandArgs
{
public InvokeSignatureHelpCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
[ExcludeFromCodeCoverage]
internal class LineEndCommandArgs : CommandArgs
{
public LineEndCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
[ExcludeFromCodeCoverage]
internal class LineEndExtendCommandArgs : CommandArgs
{
public LineEndExtendCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
[ExcludeFromCodeCoverage]
internal class LineStartCommandArgs : CommandArgs
{
public LineStartCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
[ExcludeFromCodeCoverage]
internal class LineStartExtendCommandArgs : CommandArgs
{
public LineStartExtendCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for move selected lines down command
/// </summary>
[ExcludeFromCodeCoverage]
internal class MoveSelectedLinesDownCommandArgs : CommandArgs
{
public MoveSelectedLinesDownCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for move selected lines up command
/// </summary>
[ExcludeFromCodeCoverage]
internal class MoveSelectedLinesUpCommandArgs : CommandArgs
{
public MoveSelectedLinesUpCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
internal enum NavigateDirection
{
Up = -1,
Down = 1,
}
[ExcludeFromCodeCoverage]
internal class NavigateToHighlightedReferenceCommandArgs : CommandArgs
{
private readonly NavigateDirection _direction;
public NavigateToHighlightedReferenceCommandArgs(ITextView textView, ITextBuffer subjectBuffer, NavigateDirection direction)
: base(textView, subjectBuffer)
{
if (!Enum.IsDefined(typeof(NavigateDirection), direction))
{
throw new ArgumentException("direction");
}
_direction = direction;
}
public NavigateDirection Direction => _direction;
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
[ExcludeFromCodeCoverage]
internal class OpenLineAboveCommandArgs : CommandArgs
{
public OpenLineAboveCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
[ExcludeFromCodeCoverage]
internal class OpenLineBelowCommandArgs : CommandArgs
{
public OpenLineBelowCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for the Organize Document command being invoked.
/// </summary>
[ExcludeFromCodeCoverage]
internal class OrganizeDocumentCommandArgs : CommandArgs
{
public OrganizeDocumentCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for the page down key being pressed.
/// </summary>
[ExcludeFromCodeCoverage]
internal class PageDownKeyCommandArgs : CommandArgs
{
public PageDownKeyCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for the page up key being pressed.
/// </summary>
[ExcludeFromCodeCoverage]
internal class PageUpKeyCommandArgs : CommandArgs
{
public PageUpKeyCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
[ExcludeFromCodeCoverage]
internal class PasteCommandArgs : CommandArgs
{
public PasteCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
[ExcludeFromCodeCoverage]
internal class RedoCommandArgs : CommandArgs
{
public readonly int Count;
public RedoCommandArgs(ITextView textView, ITextBuffer subjectBuffer, int count = 1)
: base(textView, subjectBuffer)
{
this.Count = count;
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for the Refactor.RemoveParameters command.
/// </summary>
[ExcludeFromCodeCoverage]
internal class RemoveParametersCommandArgs : CommandArgs
{
public RemoveParametersCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for the rename command.
/// </summary>
[ExcludeFromCodeCoverage]
internal class RenameCommandArgs : CommandArgs
{
public RenameCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for the Refactor.ReorderParameters command.
/// </summary>
[ExcludeFromCodeCoverage]
internal class ReorderParametersCommandArgs : CommandArgs
{
public ReorderParametersCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for the Return arrow key being pressed.
/// </summary>
[ExcludeFromCodeCoverage]
internal class ReturnKeyCommandArgs : CommandArgs
{
public ReturnKeyCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for the file being saved.
/// </summary>
[ExcludeFromCodeCoverage]
internal class SaveCommandArgs : CommandArgs
{
public SaveCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
[ExcludeFromCodeCoverage]
internal class SelectAllCommandArgs : CommandArgs
{
public SelectAllCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for the Sort and Remove Unused Usings command being invoked.
/// </summary>
[ExcludeFromCodeCoverage]
internal class SortAndRemoveUnnecessaryImportsCommandArgs : CommandArgs
{
public SortAndRemoveUnnecessaryImportsCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for the Edit.Outlining.StartAutomaticOutlining command.
/// </summary>
[ExcludeFromCodeCoverage]
internal class StartAutomaticOutliningCommandArgs : CommandArgs
{
public StartAutomaticOutliningCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for Edit.SurroundWith
/// </summary>
[ExcludeFromCodeCoverage]
internal class SurroundWithCommandArgs : CommandArgs
{
public SurroundWithCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
[ExcludeFromCodeCoverage]
internal class SyncClassViewCommandArgs : CommandArgs
{
public SyncClassViewCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for the Tab key being pressed.
/// </summary>
[ExcludeFromCodeCoverage]
internal class TabKeyCommandArgs : CommandArgs
{
public TabKeyCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
namespace Microsoft.CodeAnalysis.Editor.Commands
{
/// <summary>
/// Arguments for the Toggle Completion Mode command begin invoked.
/// </summary>
[ExcludeFromCodeCoverage]
internal class ToggleCompletionModeCommandArgs : CommandArgs
{
public ToggleCompletionModeCommandArgs(ITextView textView, ITextBuffer subjectBuffer)
: base(textView, subjectBuffer)
{
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册