Vscode-cpptools: The formatting tool is not working properly

Created on 16 Aug 2019  路  2Comments  路  Source: microsoft/vscode-cpptools

Type: LanguageService

Describe the bug

  • OS and Version: Windows 10.0.17763.678
  • VS Code Version: 1.37.1
  • C/C++ Extension Version: 0.24.1
  • After formatting, the formatted text is not replaced but appended to the end of the text.

To Reproduce

  1. Open a c++ file.
  2. Copy some source code into it.
  3. Right-click to format.
  4. See error.

Expected behavior
Replace old text with new text instead of appending directly to the end of the file.

Screenshots
1.gif

Additional context
The code I am going to format is that I copied it directly from the other place to the editing area.

Code Formatting Language Service bug duplicate

All 2 comments

I believe this is a duplicate of https://github.com/microsoft/vscode-cpptools/issues/4091 (although your repro steps are slightly different). The document is becoming corrupted when it's saved and the formatting is revealing the corrupted document.

Closing as duplicate.

Was this page helpful?
0 / 5 - 0 ratings