Allow creating doc comments around existing comments#59763
Merged
davidwengier merged 5 commits intodotnet:mainfrom Mar 16, 2022
Merged
Allow creating doc comments around existing comments#59763davidwengier merged 5 commits intodotnet:mainfrom
davidwengier merged 5 commits intodotnet:mainfrom
Conversation
davidwengier
commented
Feb 25, 2022
| string.Format("Caret positioned incorrectly. Should have been {0}, but was {1}.", expectedPosition, endCaretPosition)); | ||
| var actualWithCaret = actual.Insert(endCaretPosition, "$$"); | ||
|
|
||
| Assert.Equal(expectedMarkup, actualWithCaret); |
Member
Author
There was a problem hiding this comment.
This makes it easier to reason about the caret position failure
davidwengier
commented
Feb 25, 2022
| protected override bool IsEndOfLineTrivia(SyntaxTrivia trivia) | ||
| => trivia.RawKind == (int)SyntaxKind.EndOfLineTrivia; | ||
|
|
||
| protected override bool IsSingleExteriorTrivia(DocumentationCommentTriviaSyntax documentationComment, bool allowWhitespace = false) |
Member
Author
There was a problem hiding this comment.
Nothing ever passed in a value for allowWhitespace
Contributor
Seems like a great idea to me :) |
src/Features/CSharp/Portable/DocumentationComments/CSharpDocumentationCommentSnippetService.cs
Outdated
Show resolved
Hide resolved
CyrusNajmabadi
approved these changes
Feb 25, 2022
Contributor
CyrusNajmabadi
left a comment
There was a problem hiding this comment.
can we do the same for VB?
Member
Author
I tried, but VB seemed to be surprisingly different as far as parsing doc comments go, so I need to spend more time on that. Good to at least get the idea validated. |
Member
Author
|
/azp run roslyn-integration-CI |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Maybe there is a reason this wasn't supported, and it's a bad idea, but its something that has bit me before because I'm very very silly, and since I saw someone else fall victim to it recently, I thought I'd see how you all feel.
Basically sometimes I write normal comments above my methods, and then on a PR someone tells me to make them XML comments, so I add a
/, commit and push. And then the build fails because I forgot that XML comments aren't that simple. This fixes that.Looks like this:
