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

Code formatter duplicates contents on save when in extension development host #4091

Closed
matter123 opened this issue Aug 15, 2019 · 4 comments
Closed
Labels
bug Feature: Code Formatting fixed Check the Milestone for the release in which the fix is or will be available. quick fix verified Bug has been reproduced Visual Studio Code Caused by (or depends on changes from) VS Code
Milestone

Comments

@matter123
Copy link

Type: LanguageService

Describe the bug

  • OS and Version: Mac OS 10.14.15
  • VS Code Version: 1.38.0-insider (ba69d8dcccaebbfaa94906503728eb7c3e45b9c1)
  • C/C++ Extension Version: 0.25.0-insiders
  • Other extensions you installed (and if the issue persists after disabling them): Issue persists after disabling all other extensions
  • A clear and concise description of what the bug is.

When saving a new file when in extenstion development host window, the code formatter duplicates the file.

To Reproduce

  1. Open an extension development host window
  2. Create a new file
  3. Set language to C++
  4. Copy the following contents
void
foo()
;
  1. Save
  2. Observe that the file contains
void foo();
void foo();

Expected behavior

File contains just void foo();
Screenshots

Before Save After Save
Screen Shot 2019-08-15 at 11 43 52 Screen Shot 2019-08-15 at 11 43 59
@sean-mcmanus
Copy link
Collaborator

sean-mcmanus commented Aug 15, 2019

Strange -- VS Code is sending us a didOpen and then sending us a didChange, which causes the file contents to get duplicated. I'll try filing a VS Code bug and see what they say.

microsoft/vscode#79252

It's not really a formatting bug, but an internal documentation corruption that the formatting makes visible.

@sean-mcmanus
Copy link
Collaborator

Should be fixed with 0.25.0.

@sean-mcmanus sean-mcmanus reopened this Aug 26, 2019
@sean-mcmanus sean-mcmanus modified the milestones: 0.25.0, 0.25.1 Aug 26, 2019
@sean-mcmanus
Copy link
Collaborator

sean-mcmanus commented Aug 26, 2019

It wasn't actually fixed -- 0.25.1 should have the fix (when it's released).

@sean-mcmanus
Copy link
Collaborator

Should be fixed with 0.25.1 now.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Feature: Code Formatting fixed Check the Milestone for the release in which the fix is or will be available. quick fix verified Bug has been reproduced Visual Studio Code Caused by (or depends on changes from) VS Code
Projects
None yet
Development

No branches or pull requests

2 participants