8000 notfy: give ack. when black formatter runs by KMohZaid · Pull Request #61 · python-lsp/python-lsp-black · GitHub
[go: up one dir, main page]

Skip to content

notfy: give ack. when black formatter runs #61

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

Open
8000 wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions pylsp_black/plugin.py
7230
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,18 @@


@hookimpl(tryfirst=True)
def pylsp_format_document(config, document):
return format_document(config, document)
def pylsp_format_document(config, workspace, document):
with workspace.report_progress("format: black"):
return format_document(config, document)


@hookimpl(tryfirst=True)
def pylsp_format_range(config, document, range):
def pylsp_format_range(config, workspace, document, range):
range["start"]["character"] = 0
range["end"]["line"] += 1
range["end"]["character"] = 0
return format_document(config, document, range)
with workspace.report_progress("format: black"):
return format_document(config, document, range)


@hookimpl
Expand Down
0