1
0
Fork 0

Update options one by one to update all instance

pull/668/head
Jürgen Steitz 2017-03-04 09:25:09 +01:00
parent 1e73d08033
commit 1f90b4e393
2 changed files with 8 additions and 9 deletions

View File

@ -225,18 +225,17 @@ class Workspace
}
$changedOptions = $this->getChangedOptions($settings);
$this->options = $settings;
if (!empty(array_intersect($changedOptions, $this->options->getIndexerOptions()))) {
foreach (get_object_vars($settings) as $prop => $val) {
$this->options->$prop = $val;
}
if ($this->indexer && !empty(array_intersect($changedOptions, $this->options->getIndexerOptions()))) {
// check list of options that changed since last time against the list of valid indexer options
// start wiping from the main index
// wipe main index and start reindexing
$this->index->wipe();
// check for existing indexer and start indexing
if ($this->indexer) {
$this->indexer->index()->otherwise('\\LanguageServer\\crash');
}
$this->indexer->index()->otherwise('\\LanguageServer\\crash');
}
}

View File

@ -51,7 +51,7 @@ class DidChangeConfigurationTest extends ServerTestCase
if ($msg->body->method === 'window/logMessage' && $promise->state === Promise::PENDING) {
if ($msg->body->params->type === MessageType::ERROR) {
$promise->reject(new Exception($msg->body->params->message));
} elseif (strpos($msg->body->params->message, 'All 0 PHP files parsed') !== false) {
} elseif (strpos($msg->body->params->message, 'All 1 PHP files parsed') !== false) {
$promise->fulfill();
}
}