microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.66k stars 29.05k forks source link

Code is always formatted on save, even with option explicitly disabled #119893

Closed callumlocke closed 3 years ago

callumlocke commented 3 years ago

Issue Type: Bug

  1. Save a TypeScript or JavaScript file with some formatting issues.
  2. It automatically formats it, even with the "Format on save" option disabled.

I am used to toggling the editor.formatOnSave option on and off (using Formatting Toggle), but for some reason, starting just today, VS Code always formats it on save, even when the option is disabled.

Things I've tried:

And it still formats on save. Always.

Manually running "Save without formatting" from the command palette works, thankfully, but that is a real pain.

VS Code version: Code 1.54.3 (2b9aebd5354a3629c3aba0a5f5df49f43d6689f8, 2021-03-15T11:00:52.911Z) OS version: Darwin arm64 20.3.0

System Info |Item|Value| |---|---| |CPUs|undefined| |GPU Status|2d_canvas: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled| |Load (avg)|9, 10, 10| |Memory (System)|16.00GB (0.19GB free)| |Process Argv|--crash-reporter-id b7f24429-d0c2-46f2-8285-c0ca6ee53f2e| |Screen Reader|no| |VM|0%|
Extensions (53) Extension|Author (truncated)|Version ---|---|--- vscode-color-pick|ada|0.6.2 svelte-intellisense|ard|0.7.1 snapshot-tools|asv|0.4.0 vscode-mjml|att|1.6.0 change-color-format|bbu|1.0.0 color-info|bie|0.5.1 comment-tagged-templates|bie|0.3.1 markdown-preview-github-styles|bie|0.1.6 vscode-styled-jsx|bla|2.0.0 vscode-tailwindcss|bra|0.5.9 turbo-console-log|Cha|2.1.6 jsrefactor|cms|2.20.6 vscode-eslint|dba|2.1.19 EditorConfig|Edi|0.16.4 prettier-vscode|esb|6.3.1 vscode-open-in-github|fab|1.2.3 styled-components-extractor|Fal|0.0.7 vscode-firefox-debug|fir|2.9.2 vscode-svelte-snippets|fiv|0.5.0 vscode-pull-request-github|Git|0.24.0 beautify|Hoo|1.5.0 svg|joc|1.4.5 circleci-vscode|jod|0.2.2 minifyall|jos|2.5.8 vscode-styled-components|jpo|1.5.0 vscode-deno-extensionpack|jus|0.3.0 vscode-colorize|kam|0.11.0 theme-karyfoundation-themes|kar|20.0.3 deno-std-lib-snippets|lau|0.0.8 rainbow-csv|mec|1.8.1 dotenv|mik|1.0.1 vscode-edits-history|mis|0.1.6 vscode-docker|ms-|1.11.0 python|ms-|2021.3.680753044 jupyter|ms-|2021.3.684299474 remote-containers|ms-|0.163.2 remote-ssh|ms-|0.65.1 remote-ssh-edit|ms-|0.65.1 remote-wsl|ms-|0.54.6 vscode-typescript-tslint-plugin|ms-|1.3.3 vscode-streamdeck|nic|4.1.5 vscode-jest|Ort|3.2.0 convert-css-in-js|pau|1.1.3 material-icon-theme|PKi|4.6.0 vscode-yaml|red|0.17.0 react-snippets|run|0.1.3 partial-diff|ryu|1.4.2 gitconfig|sid|2.0.1 unique-window-colors|stu|1.0.51 control-snippets|svi|1.9.1 selectline-statusbar|tom|0.0.2 sort-lines|Tyr|1.9.0 haml|vay|1.0.1 (1 theme extensions excluded)
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383cf:30185419 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492:30256859 vstry914:30276682 pythonvsdeb440:30248342 pythonvsded773:30248341 pythonvspyt875:30259475 openwsldoc:30280162 vspre833:30267464 vshan820:30276952 ```
vscodebot[bot] commented 3 years ago

(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

jrieken commented 3 years ago

Please retry without extensions enabled. Select 'Extensions View > ... > Disable all Installed Extensions' and try again. Thanks.

screen shot 2018-05-09 at 08 45 10
callumlocke commented 3 years ago

That fixed it. Will take me a while to figure out which extension was the culprit but I guess I can close this as it's not an issue with VS Code. Thanks!

jrieken commented 3 years ago

That fixed it. Will take me a while to figure out which extension was the culprit but I guess I can close this as it's not

We have a tool for that: "F1 > Start Extension Bisect" (see https://code.visualstudio.com/blogs/2021/02/16/extension-bisect)