File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33namespace Phpactor \LanguageServer \Handler \TextDocument ;
44
55use Amp \Promise ;
6+ use Phpactor \LanguageServerProtocol \DocumentFormattingParams ;
67use Phpactor \LanguageServerProtocol \FormattingOptions ;
78use Phpactor \LanguageServerProtocol \ServerCapabilities ;
8- use Phpactor \LanguageServerProtocol \TextDocumentIdentifier ;
99use Phpactor \LanguageServerProtocol \TextEdit ;
1010use Phpactor \LanguageServer \Core \Formatting \Formatter ;
1111use Phpactor \LanguageServer \Core \Handler \CanRegisterCapabilities ;
@@ -33,12 +33,12 @@ public function methods(): array
3333 /**
3434 * @return Promise<array<int,TextEdit[]>|null>
3535 */
36- public function formatting (TextDocumentIdentifier $ textDocument , FormattingOptions $ options ): Promise
36+ public function formatting (DocumentFormattingParams $ params , FormattingOptions $ options ): Promise
3737 {
38- return call (function () use ($ textDocument ) {
38+ return call (function () use ($ params ) {
3939 $ token = WorkDoneToken::generate ();
4040 yield $ this ->notifier ->create ($ token );
41- $ document = $ this ->workspace ->get ($ textDocument ->uri );
41+ $ document = $ this ->workspace ->get ($ params -> textDocument ->uri );
4242 $ this ->notifier ->begin ($ token , 'Formatting document ' );
4343 try {
4444 $ formatted = yield $ this ->formatter ->format ($ document );
You can’t perform that action at this time.
0 commit comments