Repository navigation
Convert generic brackets to braces when pasting into cref - #85787
Conversation
|
Azure Pipelines: Successfully started running 2 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
This comment was marked as resolved.
This comment was marked as resolved.
Thanks! Agreed, I'll add an opt-out option (so default on) and follow the existing dotnet_fix_string_contents_on_paste setting (a PerLanguageOption2 checked by the handler, with a checkbox on the C# Advanced options page and VS options storage/automation registration) |
jasonmalinowski
left a comment
There was a problem hiding this comment.
Great feature! some small tweaks/additions for tests, but this is otherwise quite close.
|
I have added the opt-out option csharp_fix_cref_on_paste (default on) with a checkbox under Tools > Options > C# > Advanced, next to "Fix text pasted into string literals". |
Fixes #19197
When pasting into the value of a
crefattribute in a C# documentation comment,<and>in the pasted text are converted to{and}.Implementation
New
CrefPasteCommandHandler(C# only), modeled onStringCopyPasteCommandHandler:crefattribute value (between the quotes).VB is not included, since
(Of T)is already valid in crefs.Tests
CrefPasteCommandHandlerTestscovers empty and partially filled crefs, nested generics, generic methods, pasting over a selection, single-quoted crefs and undo. Negative cases: doc comment text, other attributes, before the attribute value, pasted quotes, regular code and string literals.Microsoft Reviewers: Open in CodeFlow