vscode-black-formatter: Black formatter does not format symlinked files (Black 24.1.1)
Today, my VS Code got updated to the following version: Version: 1.86.0 (Universal) Commit: 05047486b6df5eb8d44b2ecd70ea3bdf775fd937 Date: 2024-01-31T10:29:15.765Z Electron: 27.2.3 ElectronBuildId: 26495564 Chromium: 118.0.5993.159 Node.js: 18.17.1 V8: 11.8.172.18-electron.0 OS: Darwin arm64 23.2.0
I have Black Foramatter v2024.0.0.
I am not able to format my Python code after the VS Code update. The output log is following:
2024-02-02 14:06:12.247 [info] [Trace - 2:06:12 PM] Sending request 'textDocument/formatting - (1)'.
2024-02-02 14:06:12.263 [info] [Trace - 2:06:12 PM] Received notification 'window/logMessage'.
2024-02-02 14:06:12.263 [info] path/to/dir/miniconda3/envs/my_env/bin/python -m black --stdin-filename path/to/code/my_code.py -
2024-02-02 14:06:12.264 [info] [Trace - 2:06:12 PM] Received notification 'window/logMessage'.
2024-02-02 14:06:12.264 [info] CWD formatter: /path/path/path
2024-02-02 14:06:12.328 [info] [Trace - 2:06:12 PM] Received notification 'window/logMessage'.
2024-02-02 14:06:12.328 [info] No Python files are present to be formatted. Nothing to do 😴
But running black my_code.py
works perfectly fine. It doesn’t work only when I right click on my code and select format document with -> black formatter. Black formatter used to work perfectly before the VS Code update.
About this issue
- Original URL
- State: closed
- Created 5 months ago
- Comments: 28 (10 by maintainers)
I am also having this issue. No formatter is working in vscode for python files specifically.
@werwack The symlink issue is with black itself, it was fixed in version 24.0.0.
@side2k If you have dependency on specific version of black then I recommend doing this:
The above settings will make the extension use the bundled libs for communication, but black from your environment.
What is the version of black that you have in your terminal? can you update it to match the latest from the extension. also the equivalent way of launching it is this: