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

Formatting on type (break before curly braces) is not working for C/C++/C# languages (possibly some others too) #5243

Closed
interpol-kun opened this issue Apr 2, 2020 · 4 comments

Comments

@interpol-kun
Copy link

Issue Type: Bug

  1. Open fresh VSC, in the settings check format on Type, on Paste and on Save.
  2. Install official C/C++ or C# extension.
  3. For C/C++, change the formatting to follow Visual Studio style (Clang_format_style).
  4. Write any function with curly braces, for example.
  5. The formatting won't apply. Hit CTRL+S and it will apply now. Here's the example of formatting not applying on type, but applying on CRTL+S.

Expected behaviour:
VSCode should format the code on type like it does with JavaScript (here's the example) right outside the box.

VS Code version: Code - OSS 1.43.2 (0ba0ca52957102ca3527cf479571617f0de6ed50, 2020-03-25T01:43:18.461Z)
OS version: Linux x64 5.5.13-1-MANJARO

System Info
Item Value
CPUs Intel(R) Core(TM) i5-4690K CPU @ 3.50GHz (4 x 3998)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: disabled_software
skia_renderer: disabled_off_ok
video_decode: unavailable_off
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) 1, 1, 1
Memory (System) 23.37GB (0.72GB free)
Process Argv --no-sandbox --unity-launch --no-sandbox
Screen Reader no
VM 0%
@interpol-kun
Copy link
Author

Let's see where you will send me this time.

Will quote myself:

Also I have to add that that issue haunting me from the first day I started using VSCode. Is not an exclusive for me, it happens to a lot of people using the different languages. I have an opened issue for omnisharp since summer, and the devs seems to ignore it.
It is really a shame that the text editor can't do the basic formatting right without forcing you to try million of options and eventually open an issue.

@sean-mcmanus
Copy link
Contributor

Our formatOnType support is very limited and only applies when ';' is used. We're tracking this with #1419 . Issue #657 may also address this.

@interpol-kun
Copy link
Author

We're tracking this with #1419 .

The last activity for the issue was more than 2 years ago. How are you tracking that exactly? Looks like you've just swept that under the rug.

Do you even have the better formatOnType support in development? People are complaining, writing issues and asking questions all around Github, Reddit and other forums. Is it a common attitude to provide half-baked features or no native support at all for your official extensions? I am asking that because there is a literally the same problem with Microsoft's official C# extension.

I think it's time to find an editor that helps with writing the code, not making it harder by not having basic features and having problems that were solved for a few decades already.

@sean-mcmanus
Copy link
Contributor

Format on type improvements are not actively being developed, but #657 is set for Post-v1, which may bring in better format on type from Visual Studio.

You are correct that the formatting feature has not been a high priority for our extension (which has been focused on improving IntelliSense features) -- we actively track user feedback, such as from upvotes at https://github.com/microsoft/vscode-cpptools/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc (and surveys), and it looks like #657 is number 11 and we're working on some issues ranked 10 and below currently. If better formatting is desired, you could set C_Cpp.formatting to "Disabled" and try another formatting extension if a better one exists.

@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.
Projects
None yet
Development

No branches or pull requests

2 participants