question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

formatOnSaveMode appears broken

See original GitHub issue

Issue Type: Bug

I have the following settings:

    "editor.formatOnSave": true,
    "editor.formatOnSaveMode": "modifications",
    "editor.defaultFormatter": "ms-vscode.cpptools",

modifications is set so that if there’s no background source control, no formatting is performed. However, as of VSCode 1.60.0 (I didn’t update vscode-clangd version) this option is formatting the entire file, which is what modificationsIfAvailable is supposed to do.

After updating to the latest vscode-clangd this behaviour is still apparent.

modifications still limits its formatting to edited sections of code when source control is enabled, so that bit is working fine.

Extension version: 0.1.13 VS Code version: Code 1.60.0 (e7d7e9a9348e6a8cc8c03f877d39cb72e5dfb1ff, 2021-09-01T10:41:52.311Z) OS version: Windows_NT x64 10.0.19042 Restricted Mode: No

System Info
Item Value
CPUs Intel® Core™ i7-6800K CPU @ 3.40GHz (12 x 3398)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 23.91GB (15.76GB free)
Process Argv
Screen Reader no
VM 0%

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
HighCommander4commented, Sep 8, 2021
0reactions
dwilliamsoncommented, Oct 13, 2021

Works on latest 1.61, thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

VS-Code Prettier Format On Save doesn't work - Stack Overflow
Follow these steps: CTRL + SHIFT + P; Format Document (in pop-up bar); Select Format Document; Select Configure Default Formatter.
Read more >
VS Code tips — Format on save - YouTube
... worrying about checking in unformatted code Use the "editor. formatOnSaveMode " setting to control which lines in a file are formatted.
Read more >
August 2020 (version 1.49) - Visual Studio Code
We added a new command Format Modified Lines, which allows you to only format new and changed lines. There is a new setting...
Read more >
My Emacs Configuration - adventures in uncertainty
Setting it to 100mb seems to strike a nice balance between GC pauses ... NB: dap-go-setup appears to be broken, so you have...
Read more >
rust-analyzer/rustfmt formatting behavior has changed ... - Reddit
There is a new setting editor.formatOnSaveMode, which makes Format on Save only apply to modified lines.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found