提交 52dada35 编写于 作者: D David Barbet 提交者: David Barbet

Switch to new toggle block comment command handler.

上级 f60304d1
......@@ -21,8 +21,7 @@ namespace Microsoft.CodeAnalysis.Editor.CSharp.CommentSelection
{
[Export(typeof(VSCommanding.ICommandHandler))]
[ContentType(ContentTypeNames.CSharpContentType)]
// TODO - Change to toggle handler.
[Name(PredefinedCommandHandlerNames.CommentSelection)]
[Name(PredefinedCommandHandlerNames.ToggleBlockComment)]
internal class CSharpToggleBlockCommentCommandHandler :
ToggleBlockCommentCommandHandler
{
......
......@@ -141,6 +141,12 @@ internal static class PredefinedCommandHandlerNames
/// </summary>
public const string SignatureHelpAfterCompletion = "Signature Help After Completion Command Handler";
/// <summary>
/// Command handler name for Toggle Block Comments.
/// </summary>
/// <remarks></remarks>
public const string ToggleBlockComment = "Toggle Block Comment Command Handler";
/// <summary>
/// Command handler name for Paste Content in Interactive Format.
/// </summary>
......
......@@ -25,7 +25,7 @@ namespace Microsoft.CodeAnalysis.Editor.Implementation.CommentSelection
internal abstract class AbstractToggleBlockCommentBase :
// Value tuple to represent that there is no distinct command to be passed in.
AbstractCommentSelectionBase<ValueTuple>,
VSCommanding.ICommandHandler<CommentSelectionCommandArgs>
VSCommanding.ICommandHandler<ToggleBlockCommentCommandArgs>
{
private static readonly CommentSelectionResult s_emptyCommentSelectionResult =
new CommentSelectionResult(new List<TextChange>(), new List<CommentTrackingSpan>(), Operation.Uncomment);
......@@ -47,14 +47,12 @@ internal abstract class AbstractToggleBlockCommentBase :
protected abstract Task<ImmutableArray<TextSpan>> GetBlockCommentsInDocument(Document document, ITextSnapshot snapshot,
CommentSelectionInfo commentInfo, CancellationToken cancellationToken);
// TODO - Change to toggle handler.
public VSCommanding.CommandState GetCommandState(CommentSelectionCommandArgs args)
public VSCommanding.CommandState GetCommandState(ToggleBlockCommentCommandArgs args)
{
return GetCommandState(args.SubjectBuffer);
}
// TODO - Change to toggle handler.
public bool ExecuteCommand(CommentSelectionCommandArgs args, CommandExecutionContext context)
public bool ExecuteCommand(ToggleBlockCommentCommandArgs args, CommandExecutionContext context)
{
return ExecuteCommand(args.TextView, args.SubjectBuffer, ValueTuple.Create(), context);
}
......
......@@ -20,8 +20,7 @@ namespace Microsoft.CodeAnalysis.Editor.Implementation.CommentSelection
{
[Export(typeof(VSCommanding.ICommandHandler))]
[ContentType(ContentTypeNames.RoslynContentType)]
// TODO - Change to toggle handler.
[Name(PredefinedCommandHandlerNames.CommentSelection)]
[Name(PredefinedCommandHandlerNames.ToggleBlockComment)]
internal class ToggleBlockCommentCommandHandler : AbstractToggleBlockCommentBase
{
[ImportingConstructor]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册