Skip to content
This repository was archived by the owner on Mar 6, 2022. It is now read-only.

Commit 9579af0

Browse files
committed
Normalize file path when delegating to transform action
1 parent d5f3d9f commit 9579af0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/LanguageServerCodeTransform/LspCommand/TransformCommand.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Phpactor\LanguageServer\Core\Command\Command;
1212
use Phpactor\LanguageServer\Core\Server\ClientApi;
1313
use Phpactor\LanguageServer\Core\Workspace\Workspace;
14+
use Phpactor\TextDocument\TextDocumentUri;
1415

1516
class TransformCommand implements Command
1617
{
@@ -47,7 +48,10 @@ public function __invoke(string $uri, string $transform): Promise
4748
$transformer = $this->transformers->get($transform);
4849
assert($transformer instanceof Transformer);
4950
$textEdits = $transformer->transform(
50-
SourceCode::fromStringAndPath($textDocument->text, $textDocument->uri),
51+
SourceCode::fromStringAndPath(
52+
$textDocument->text,
53+
TextDocumentUri::fromString($textDocument->uri)->path()
54+
),
5155
);
5256

5357
return $this->clientApi->workspace()->applyEdit(new WorkspaceEdit([

0 commit comments

Comments
 (0)