dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19.07k stars 4.04k forks source link

Summary Xml-Doc actively breaks code #75838

Open AlmightyLks opened 1 week ago

AlmightyLks commented 1 week ago

Version Used: VS22 Community 17.11.5

Steps to Reproduce:

  1. Create Project on newest VS installation
  2. Create a class
  3. Add an incomplete summary xml-doc "/// Bla"
  4. a) Try to break a line at the end of it. It duplicates the incomplete xml doc, creating a mess b) Go down a line manually, add a line break and start typing "///", it will auto-complete, and completely mess up the below code, skipping all empty lines, guaranteeing to break the code.

Expected Behavior: Either: Let me break a line with or without a convenient "///" prefix. Or, Ideally: Properly fix the xml comment and delete/replace the xml-doc it is trying to correct

Actual Behavior: Undesirable duplicate of summary tag and breaking of code

https://github.com/user-attachments/assets/782aede0-bae3-480d-b431-55a3ea1e0deb

AlmightyLks commented 15 hours ago

Found yet another parsing issue.
If roslyn picks up an already existing "<" or "/>" in the fixable line, it will then refuse to fix the summary for you. As soon as you remove them, roslyn is happy again

https://github.com/user-attachments/assets/438545ff-1958-42ac-8617-2a88386d3f73