Support multi-caret when inserting doc comments#54741
Conversation
|
I'm ok with this (esp. with how minimal the code is). but would def want a test for this :) |
|
Is thsi fixing some reported issue? |
Yeah I forgot to add it. Will link it from PR description: #54391 |
|
Test infrastructure doesn't seem to be working with multi-caret (or possibly I can't write a proper test?). I'll look into how to fix that. |
|
@CyrusNajmabadi I was unable to write a test. Can you take a look so that we can get it merged? Thanks! |
…bstractDocumentationCommentCommandHandler.cs
|
@CyrusNajmabadi Can you take a look please? |
|
@Youssef1313 should be possible to write an integration test for this in the new integration test project |
sharwell
left a comment
There was a problem hiding this comment.
An integration test should be easy in the new integration test project
|
@sharwell Which project? Can you point me please? Thanks! |
|
The current tests have examples for how to do a bunch of different things. If you don't see a similar example for something you need, feel free to ask. |
|
@sharwell I couldn't find a test that does multi-caret. When I tried to do it I got [IdeFact]
[WorkItem(54391, "https://github.com/dotnet/roslyn/issues/54391")]
public async Task TypingCharacter_MultiCaret()
{
var code =
@"
//$$
class C1 { }
//$$
class C2 { }
//$$
class C3 { }
";
await SetUpEditorAsync(code, HangMitigatingCancellationToken);
await TestServices.Input.SendAsync('/');
var expected =
@"
/// <summary>
/// $$
/// </summary>
class C1 { }
/// <summary>
///
/// </summary>
class C2 { }
/// <summary>
///
/// </summary>
class C3 { }
";
await TestServices.EditorVerifier.TextContainsAsync(expected, cancellationToken: HangMitigatingCancellationToken);
} |
|
Also tried: //$$
class C1 { }
//[||]
class C2 { }
//[||]
class C3 { }But fails with |
|
@Youssef1313 I took the liberty of updating the test. The issues were:
All in all though, you did a great job (unsurprisingly 😁) |
|
@davidwengier Thanks a lot!! |
|
@Youssef1313 Do you have more up-to-date gif? Just curious. ;-) |
|
@MartyIX Oh looks like the software I used produced a bad GIF 😄 Will build the branch and update it soon. |

Fixes #54391