7
7
from isort .settings import KNOWN_PREFIX
8
8
from pylsp import hookimpl
9
9
from pylsp .config .config import Config
10
- from pylsp .workspace import Document
10
+ from pylsp .workspace import Document , Workspace
11
11
12
12
logger = logging .getLogger (__name__ )
13
13
@@ -34,15 +34,21 @@ def pylsp_settings() -> Dict[str, Any]:
34
34
35
35
36
36
@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 :
38
40
outcome = yield
39
- _format (outcome , config , document )
41
+ with workspace .report_progress ("format: isort" ):
42
+ _format (outcome , config , document )
40
43
41
44
42
45
@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 :
44
49
outcome = yield
45
- _format (outcome , config , document , range )
50
+ with workspace .report_progress ("format: isort" ):
51
+ _format (outcome , config , document , range )
46
52
47
53
48
54
def _format (
0 commit comments