提交 5baadd6b 编写于 作者: D David Barbet

Update toggle block comment data interface with documentation.

上级 0ec2bbb3
......@@ -50,7 +50,7 @@ public CSharpToggleBlockCommentDocumentDataProvider(SyntaxNode root)
/// <summary>
/// Get a location of itself or the end of the token it is located in.
/// </summary>
public int GetLocationAfterToken(int location)
public int GetEmptyCommentStartLocation(int location)
{
var token = _root.FindToken(location);
if (token.Span.Contains(location))
......
......@@ -7,7 +7,16 @@ namespace Microsoft.CodeAnalysis.Editor.Implementation.CommentSelection
{
interface IToggleBlockCommentDocumentDataProvider
{
int GetLocationAfterToken(int location);
/// <summary>
/// Gets the location to insert an empty comment.
/// </summary>
/// <param name="location"></param>
/// <returns></returns>
int GetEmptyCommentStartLocation(int location);
/// <summary>
/// Gets all block comments in a particular document.
/// </summary>
IEnumerable<TextSpan> GetBlockCommentsInDocument();
}
}
......@@ -165,7 +165,7 @@ public bool ExecuteCommand(CommentSelectionCommandArgs args, CommandExecutionCon
if (spanToAdd.IsEmpty)
{
// The location for the comment should be the caret or the location after the end of the token the caret is inside of.
var locationAfterToken = blockCommentDataProvider.GetLocationAfterToken(spanToAdd.Start);
var locationAfterToken = blockCommentDataProvider.GetEmptyCommentStartLocation(spanToAdd.Start);
spanToAdd = TextSpan.FromBounds(locationAfterToken, locationAfterToken);
}
......@@ -415,7 +415,7 @@ public ToggleBlockCommentDocumentDataProvider(ITextSnapshot textSnapshot, Commen
_commentInfo = commentInfo;
}
public int GetLocationAfterToken(int location)
public int GetEmptyCommentStartLocation(int location)
{
return location;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册