1
0
Fork 0

Partial work on feedback

pull/308/head
Jürgen Steitz 2018-09-01 00:10:36 +02:00
parent a1e56543c3
commit a81bed93c7
4 changed files with 10 additions and 5 deletions

View File

@ -56,7 +56,7 @@ class Workspace
* the result for the first configuration item in the params). * the result for the first configuration item in the params).
* *
* @param ConfigurationItem[] $items * @param ConfigurationItem[] $items
* @return Promise * @return Promise <mixed[]>
*/ */
public function configuration(array $items): Promise public function configuration(array $items): Promise
{ {

View File

@ -341,9 +341,7 @@ class LanguageServer extends AdvancedJsonRpc\Dispatcher
// request configuration if it is supported // request configuration if it is supported
// support comes with protocol version 3.6.0 // support comes with protocol version 3.6.0
if ($this->clientCapabilities->workspace->configuration) { if ($this->clientCapabilities->workspace->configuration) {
$configurationitem = new ConfigurationItem(); $configuration = yield $this->client->workspace->configuration([new ConfigurationItem('php')]);
$configurationitem->section = 'php';
$configuration = yield $this->client->workspace->configuration([$configurationitem]);
$options = $this->mapper->map($configuration[0], new Options()); $options = $this->mapper->map($configuration[0], new Options());
} }

View File

@ -1,4 +1,5 @@
<?php <?php
declare(strict_types = 1);
namespace LanguageServer\Protocol; namespace LanguageServer\Protocol;
@ -17,4 +18,10 @@ class ConfigurationItem
* @var string|null * @var string|null
*/ */
public $section; public $section;
public function __construct(string $section = null, string $scopeUri = null)
{
$this->section = $section;
$this->scopeUri = $scopeUri;
}
} }

View File

@ -221,7 +221,7 @@ class Workspace
} }
$this->projectIndex->wipe(); $this->projectIndex->wipe();
$this->indexer->index()->otherwise('\\LanguageServer\\crash'); yield $this->indexer->index();
} }
} catch (\JsonMapper_Exception $exception) { } catch (\JsonMapper_Exception $exception) {
$this->client->window->showMessage( $this->client->window->showMessage(