From 6a4bc44f8a2f1ee08cb1a634f291043127b5548d Mon Sep 17 00:00:00 2001 From: KMohZaid <68484509+KMohZaid@users.noreply.github.com> Date: Mon, 19 Aug 2024 10:38:27 +0000 Subject: [PATCH 1/2] notfy: give ack. when black formatter runs --- pylsp_black/plugin.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pylsp_black/plugin.py b/pylsp_black/plugin.py index 5523896..f8d2138 100644 --- a/pylsp_black/plugin.py +++ b/pylsp_black/plugin.py @@ -34,8 +34,9 @@ @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) From 107452779a98bd5d77a810f704495602c4708cb2 Mon Sep 17 00:00:00 2001 From: KMohZaid <68484509+KMohZaid@users.noreply.github.com> Date: Mon, 7 Oct 2024 09:10:09 +0000 Subject: [PATCH 2/2] notify: ack. also when range formatting runs --- pylsp_black/plugin.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pylsp_black/plugin.py b/pylsp_black/plugin.py index f8d2138..5ce55fd 100644 --- a/pylsp_black/plugin.py +++ b/pylsp_black/plugin.py @@ -40,11 +40,12 @@ def pylsp_format_document(config, workspace, 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