Skip to content

Format on save creates gibberish #3796

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

Closed
Shachlan opened this issue Jun 18, 2019 · 4 comments
Closed

Format on save creates gibberish #3796

Shachlan opened this issue Jun 18, 2019 · 4 comments
Labels
bug duplicate Language Service more info needed The issue report is not actionable in its current state

Comments

@Shachlan
Copy link

macOS 10.14.15
VSCode 1.35.1 (also seen on previous versions)
C/C++ version: 0.23.1 (also seen on previous versions)
Other extensions -
alesiong.clang-tidy-linter
austin.code-gnu-global
CADENAS.vscode-glsllint
christian-kohler.npm-intellisense
christian-kohler.path-intellisense
dbaeumer.vscode-eslint
eamodio.gitlens
eg2.vscode-npm-script
esbenp.prettier-vscode
firsttris.vscode-jest-runner
formulahendry.docker-explorer
ms-vscode.cpptools
msjsdiag.debugger-for-chrome
oderwat.indent-rainbow
PeterJausovec.vscode-docker
psioniq.psi-header
sburg.vscode-javascript-booster
sdras.night-owl
slevesque.shader
smulyono.reveal
VisualStudioExptTeam.vscodeintellicode

Happens also when other cpp extensions are disabled.

VScode auto-formats on save using clang-format, and adds garbage to the code file - random characters and words. This happens repeatedly - saving the file multiple times in a row without doing anything in-between still adds garbage on every save.
demonstration video - https://youtu.be/zxPHINAk9Tw

This is an occasional issue, so I don't know how to repro it. removing the ipch folder doesn't help. There are no special logs in the Output window.

@sean-mcmanus
Copy link
Contributor

Formatting works "in general", but it sounds like you're hitting an "unsupported scenario". Are you using a multi-root workspace? Does the Format Document command have the same effect? I would recommend setting the C_Cpp.formatting to Disabled and trying another C++ formatting extension to see if they have the same problem or not.

@sean-mcmanus sean-mcmanus added bug duplicate Language Service more info needed The issue report is not actionable in its current state labels Jun 18, 2019
@Shachlan
Copy link
Author

I'm using a regular workspace, and I'll try to repro manually.
Do you have a suggestion for an alternative formatting extension?

@sean-mcmanus
Copy link
Contributor

I think the other known problem can occur if you open a symlinked folder.

The only other formatting extension I'm familiar with is the "clang-format" extension.

@michelleangela
Copy link
Contributor

Closing this issue do to long inactivity. Please re-open for further investigation and with any updated information.

@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 duplicate Language Service more info needed The issue report is not actionable in its current state
Projects
None yet
Development

No branches or pull requests

3 participants