-
Notifications
You must be signed in to change notification settings - Fork 36
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
Always print something in the logs #55
Comments
@Bobronium The
This is definitely possible with the Progress APIs for LSP. Then in the params handle the progress token and respond accordingly to those params. I will file a separate issue for this. |
I think it's too broad of a fix (which for me looks more like a regression) for a specific use-case. When I'm trying to format file manually, I'd like to see error if black failed to do it. Actually, same goes with saving a file — I want to know tha the tool that is meant to reformat the file on save failed to do so. I think we can make it configurable to address #38, but I don't think that silencing errors as a default behaviour is a good practice. I'm happy to work on PR as well. |
The condition stdlib/python check is now split and adds specific logs. It also put the exact syntax error in logs. |
For another issue, this time with the extension iteslf
I wasn't getting any output to the console or any indication that anything is happening while trying to format certain files.
Had to hack in
vscode-black-formatter/bundled/formatter/format_server.py
to see what's going on(both
LSP_SERVER.show_message_log
were added by me):Got this output:
is_python
returnsFalse
whenast.parse(document.source)
fails. But why this check would exist in the first place? Black already does it, and outputs:Not only it indicates the error, but also shows the exact line that couldn't be parsed.
My proposal:
is_python
check and let black do its thingOriginally posted by @Bobronium in #52 (comment)
The text was updated successfully, but these errors were encountered: