2016-09-02 19:13:30 +00:00
|
|
|
<?php
|
|
|
|
declare(strict_types = 1);
|
|
|
|
|
|
|
|
namespace LanguageServer;
|
|
|
|
|
2016-11-14 09:25:44 +00:00
|
|
|
use JsonMapper;
|
|
|
|
|
2016-09-02 19:13:30 +00:00
|
|
|
class LanguageClient
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Handles textDocument/* methods
|
|
|
|
*
|
|
|
|
* @var Client\TextDocument
|
|
|
|
*/
|
|
|
|
public $textDocument;
|
|
|
|
|
2016-09-30 09:30:08 +00:00
|
|
|
/**
|
|
|
|
* Handles window/* methods
|
|
|
|
*
|
|
|
|
* @var Client\Window
|
|
|
|
*/
|
|
|
|
public $window;
|
2016-09-02 19:13:30 +00:00
|
|
|
|
2016-11-14 09:25:44 +00:00
|
|
|
/**
|
|
|
|
* Handles workspace/* methods
|
|
|
|
*
|
|
|
|
* @var Client\Workspace
|
|
|
|
*/
|
|
|
|
public $workspace;
|
|
|
|
|
2017-02-03 23:20:38 +00:00
|
|
|
/**
|
|
|
|
* Handles xcache/* methods
|
|
|
|
*
|
|
|
|
* @var Client\XCache
|
|
|
|
*/
|
|
|
|
public $xcache;
|
|
|
|
|
2016-10-31 10:47:21 +00:00
|
|
|
public function __construct(ProtocolReader $reader, ProtocolWriter $writer)
|
2016-09-02 19:13:30 +00:00
|
|
|
{
|
2016-10-31 10:47:21 +00:00
|
|
|
$handler = new ClientHandler($reader, $writer);
|
2016-11-14 09:25:44 +00:00
|
|
|
$mapper = new JsonMapper;
|
2016-10-31 10:47:21 +00:00
|
|
|
|
2016-11-14 09:25:44 +00:00
|
|
|
$this->textDocument = new Client\TextDocument($handler, $mapper);
|
2016-10-31 10:47:21 +00:00
|
|
|
$this->window = new Client\Window($handler);
|
2016-11-14 09:25:44 +00:00
|
|
|
$this->workspace = new Client\Workspace($handler, $mapper);
|
2017-02-03 23:20:38 +00:00
|
|
|
$this->xcache = new Client\XCache($handler);
|
2016-09-02 19:13:30 +00:00
|
|
|
}
|
|
|
|
}
|