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

vscode ignores editor.formatOnSave = false set for language #173689

Closed
soredake opened this issue Feb 7, 2023 · 1 comment
Closed

vscode ignores editor.formatOnSave = false set for language #173689

soredake opened this issue Feb 7, 2023 · 1 comment
Assignees
Labels
*caused-by-extension Issue identified to be caused by an extension

Comments

@soredake
Copy link
Contributor

soredake commented Feb 7, 2023

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.75.0
  • OS Version: Windows 11 Pro

Steps to Reproduce:

  1. Add this to your user settings:
"editor.formatOnSave": true,
  "[properties]": {
    "editor.defaultFormatter": "foxundermoon.shell-format",
    "editor.formatOnSave": false
  },
  1. Create file.conf, put this code in this file:
profile-cond=p["estimated-vf-fps"]<50
  1. Press ctrl+s
  2. It will format it to this despite format on save is turned off:
    изображение
@jrieken
Copy link
Member

jrieken commented Feb 7, 2023

This is a problem with the extension. It doesn't register itself as formatter but just hooks into saving (and happens to run a formatting operation as part of that). We all the APIs to do it right, I have blogged about this (https://code.visualstudio.com/blogs/2016/11/15/formatters-best-practices) but the knowledge hasn't spread yet

@jrieken jrieken closed this as completed Feb 7, 2023
@jrieken jrieken added the *caused-by-extension Issue identified to be caused by an extension label Feb 7, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Mar 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*caused-by-extension Issue identified to be caused by an extension
Projects
None yet
Development

No branches or pull requests

2 participants