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 not applied when source file autosaved #547

Closed
AndrewGabelliTR opened this issue Oct 15, 2024 · 0 comments
Closed

Formatting not applied when source file autosaved #547

AndrewGabelliTR opened this issue Oct 15, 2024 · 0 comments
Labels
bug Issue identified by VS Code Team member as probable bug triage-needed Issue is not triaged.

Comments

@AndrewGabelliTR
Copy link

AndrewGabelliTR commented Oct 15, 2024

Diagnostic Data

  • Python version (& distribution if applicable, e.g., Anaconda): 3.12
  • Type of virtual environment used (e.g., conda, venv, virtualenv, etc.): venv
  • Operating system (and version): Win 11 Enterprise
  • Version of tool extension you are using: v2024.4.0

Behaviour

Expected Behavior

With auto save on in VSCode, Black formatting is not applied on auto saves.

Actual Behavior

Nothing. Blaxk formatting only occurs when pressing Ctrl-S.

Reproduction Steps:

Load Python file
Enabled VSCode auto save
Make a change that Black would correct
Observe file is auto saved but no formatting occurs
Press Ctrl-S
Observe Black formatting takes place.

Logs:

2024-10-15 15:06:52.624 [info] [Trace - 3:06:52 PM] Received response 'textDocument/formatting - (2)' in 37ms.
2024-10-15 15:06:52.670 [info] [Trace - 3:06:52 PM] Sending notification 'textDocument/didChange'.
2024-10-15 15:06:58.692 [info] [Trace - 3:06:58 PM] Sending notification 'textDocument/didChange'.
2024-10-15 15:07:01.176 [info] [Trace - 3:07:01 PM] Sending notification 'textDocument/didChange'.
2024-10-15 15:07:03.489 [info] [Trace - 3:07:03 PM] Sending request 'textDocument/formatting - (3)'.
2024-10-15 15:07:03.491 [info] [Trace - 3:07:03 PM] Received notification 'window/logMessage'.
2024-10-15 15:07:03.491 [info] /home/xxxxx/venv_312/bin/python3.12 -m black --stdin-filename /home/xxxxx/python/scratch.py -
2024-10-15 15:07:03.491 [info] [Trace - 3:07:03 PM] Received notification 'window/logMessage'.
2024-10-15 15:07:03.491 [info] CWD formatter: /home/xxxxx/python
2024-10-15 15:07:03.520 [info] [Trace - 3:07:03 PM] Received notification 'window/logMessage'.
2024-10-15 15:07:03.520 [info] reformatted /home/xxxxx/python/scratch.py

All done! ✨ 🍰 ✨
1 file reformatted.

2024-10-15 15:07:03.524 [info] [Trace - 3:07:03 PM] Received response 'textDocument/formatting - (3)' in 35ms.
2024-10-15 15:07:03.570 [info] [Trace - 3:07:03 PM] Sending notification 'textDocument/didChange'.

@AndrewGabelliTR AndrewGabelliTR added the bug Issue identified by VS Code Team member as probable bug label Oct 15, 2024
@github-actions github-actions bot added the triage-needed Issue is not triaged. label Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug triage-needed Issue is not triaged.
Projects
None yet
Development

No branches or pull requests

1 participant