vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

v0.30.0-insiders:i can not use format document and have to keep it 0.29

Open hengyuekang opened this issue 6 years ago • 6 comments

Type: LanguageService

Describe the bug

  • OS and Version:
  • VS Code Version:
  • C/C++ Extension Version:
  • Other extensions you installed (and if the issue persists after disabling them):
  • Does this issue involve using SSH remote to run the extension on a remote machine?:
  • A clear and concise description of what the bug is, including information about the workspace (i.e. is the workspace a single project or multiple projects, size of the project, etc).

Steps to reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

Logs
Insert logs here.

Screenshots

Additional context

hengyuekang avatar Aug 06 '20 03:08 hengyuekang

the same problem occured to me,2

Nov3n avatar Aug 06 '20 03:08 Nov3n

We changed the behavior of the "C_Cpp.clang_format_fallbackStyle" default value of "Visual Studio" to use the new vcFormat implementation. You can get the old behavior via changing the "C_Cpp.clang_format_fallbackStyle" to "Emulated Visual Studio".

Do you think we should change it so the default formatting behavior doesn't unexpectedly change for users without requiring user's change their settings?

sean-mcmanus avatar Aug 06 '20 17:08 sean-mcmanus

We changed the behavior of the "C_Cpp.clang_format_fallbackStyle" default value of "Visual Studio" to use the new vcFormat implementation. You can get the old behavior via changing the "C_Cpp.clang_format_fallbackStyle" to "Emulated Visual Studio".

Do you think we should change it so the default formatting behavior doesn't unexpectedly change for users without requiring user's change their settings?

I would say yes cause what I was experiencing before I switch back to 29 is the quick format ctrl K+F does not work any more.

bubbercn avatar Aug 09 '20 05:08 bubbercn

We changed the behavior of the "C_Cpp.clang_format_fallbackStyle" default value of "Visual Studio" to use the new vcFormat implementation. You can get the old behavior via changing the "C_Cpp.clang_format_fallbackStyle" to "Emulated Visual Studio".

Do you think we should change it so the default formatting behavior doesn't unexpectedly change for users without requiring user's change their settings?

yes,i think it is not necessary.

hengyuekang avatar Aug 09 '20 15:08 hengyuekang

There is an issue with 0.30.0-insiders in which the vcFormat engine was not correctly handling multi-byte characters. This will be addressed in the next insiders release. Also, we've restored the original behavior in which clang-format would fall back to passing a synthetic Visual Studio format description to clang-format if a fallback style of "Visual Studio" was specified. In the next insiders, it would be necessary to explicitly opt in to using vcFormat.

There isn't much information in this issue, so I'm going to close it assuming it relates to multi-byte characters, or changes in behavior due to falling back to a different format engine. If you are seeing issues when formatting with vcFormat, please open a new issue with repro details.

Colengms avatar Aug 11 '20 01:08 Colengms

This is fixed with 0.30.0-insiders2: https://github.com/microsoft/vscode-cpptools/releases/tag/0.30.0-insiders2 .

sean-mcmanus avatar Aug 12 '20 20:08 sean-mcmanus