Skip to content

Commit 19291a7

Browse files
authored
Merge pull request #5 from KMohZaid/main
notfy: give ack. when isort formatter runs
2 parents 590cecc + af97b9c commit 19291a7

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

pylsp_isort/plugin.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from isort.settings import KNOWN_PREFIX
88
from pylsp import hookimpl
99
from pylsp.config.config import Config
10-
from pylsp.workspace import Document
10+
from pylsp.workspace import Document, Workspace
1111

1212
logger = logging.getLogger(__name__)
1313

@@ -34,15 +34,21 @@ def pylsp_settings() -> Dict[str, Any]:
3434

3535

3636
@hookimpl(hookwrapper=True)
37-
def pylsp_format_document(config: Config, document: Document) -> Generator:
37+
def pylsp_format_document(
38+
config: Config, workspace: Workspace, document: Document
39+
) -> Generator:
3840
outcome = yield
39-
_format(outcome, config, document)
41+
with workspace.report_progress("format: isort"):
42+
_format(outcome, config, document)
4043

4144

4245
@hookimpl(hookwrapper=True)
43-
def pylsp_format_range(config: Config, document: Document, range: Range) -> Generator:
46+
def pylsp_format_range(
47+
config: Config, workspace: Workspace, document: Document, range: Range
48+
) -> Generator:
4449
outcome = yield
45-
_format(outcome, config, document, range)
50+
with workspace.report_progress("format: isort"):
51+
_format(outcome, config, document, range)
4652

4753

4854
def _format(

0 commit comments

Comments
 (0)