Skip to content

Update formatter in proxy #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions bin/proxy
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ use Phpactor\LanguageServerProtocol\InitializeParams;
use Phpactor\LanguageServer\Core\Rpc\NotificationMessage;
use Phpactor\LanguageServer\Core\Rpc\RequestMessage;
use Phpactor\LanguageServer\Core\Rpc\ResponseMessage;
use Phpactor\LanguageServer\Core\Server\Transmitter\MessageFormatter;
use Phpactor\LanguageServer\Core\Server\Transmitter\LspMessageFormatter;
use Phpactor\LanguageServer\Core\Server\Transmitter\LspMessageSerializer;

require __DIR__ . '/../vendor/autoload.php';

Expand Down Expand Up @@ -45,15 +46,15 @@ try {
exit(1);
}

$formatter = new MessageFormatter();
$formatter = new LspMessageFormatter(new LspMessageSerializer());

fwrite(STDOUT, $formatter->write(new RequestMessage(
fwrite(STDOUT, $formatter->format(new RequestMessage(
1,
'initialize',
json_decode(json_encode(new InitializeParams(new ClientCapabilities())), true)
)));

fwrite(STDOUT, $formatter->write($message));
fwrite(STDOUT, $formatter->format($message));

function error(string $message): void
{
Expand Down
Loading