Skip to content
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

When copying and pasting C# code that contains errors, the auto-formatter kicks in and makes the code look bad #61545

Open
vsfeedback opened this issue May 26, 2022 · 3 comments
Labels
Area-IDE IDE-Formatter Code formatter and/or smart indent Investigation Required
Milestone

Comments

@vsfeedback
Copy link

vsfeedback commented May 26, 2022

This issue has been moved from a ticket on Developer Community.


[regression]
I update to the latest Internal Main build of Visual Studio every morning and I saw this start to creep up a couple of days ago. When I copy and paste C# code that contains errors within the Visual Studio editor, the paste completes successfully, but then some type of formatting kicks in that does bad things to the formatting of the code that I pasted:
B50692ab7fb1044edb6649e0d38f0a693637890967788526920_CodeFormattingIssue

If I invoke and undo command, then the formatting goes back to the way it was right after I pasted it.

It'd be nice if this could be fixed. :)


Original Comments

Feedback Bot on 5/25/2022, 06:58 PM:

(private comment, text removed)


Original Solutions

(no solutions)

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels May 26, 2022
@Neme12
Copy link
Contributor

Neme12 commented May 27, 2022

@CyrusNajmabadi could this be related to the new string pasting feature?
@sharwell or to some of the formatting fixes you did?

@CyrusNajmabadi
Copy link
Member

Unlikely. My stuff should only kick in inside a string. And it's also fully synchronous.

@sharwell
Copy link
Member

The only asynchronous portion of this operation is Add Missing Imports on Paste.

@vatsalyaagrawal vatsalyaagrawal added Investigation Required IDE-Formatter Code formatter and/or smart indent and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 2, 2022
@vatsalyaagrawal vatsalyaagrawal added this to the Backlog milestone Jun 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE IDE-Formatter Code formatter and/or smart indent Investigation Required
Projects
None yet
Development

No branches or pull requests

5 participants