-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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! |
...ures/Core/Implementation/DocumentationComments/AbstractDocumentationCommentCommandHandler.cs
Outdated
Show resolved
Hide resolved
…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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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