1
0
Fork 0

Let didChangeConfiguration decide what options are interesting for the indexer

pull/668/head
Jürgen Steitz 2017-03-04 13:02:16 +01:00
parent a06057b7a3
commit 23a40f069b
2 changed files with 4 additions and 16 deletions

View File

@ -11,11 +11,6 @@ class Options
*/ */
public $fileTypes = ['.php']; public $fileTypes = ['.php'];
/**
* List of options that affect the indexer
*/
private $indexerOptions = ['fileTypes'];
/** /**
* Validate/Filter input and set options for file types * Validate/Filter input and set options for file types
* *
@ -31,16 +26,6 @@ class Options
$this->fileTypes = !empty($fileTypes) ? $fileTypes : $this->fileTypes; $this->fileTypes = !empty($fileTypes) ? $fileTypes : $this->fileTypes;
} }
/**
* Get list with options that affect the indexer
*
* @return array
*/
public function getIndexerOptions(): array
{
return $this->indexerOptions;
}
/** /**
* Filter valid file type * Filter valid file type
* *

View File

@ -229,6 +229,9 @@ class Workspace
*/ */
public function didChangeConfiguration($settings = null): bool public function didChangeConfiguration($settings = null): bool
{ {
// List of options that affect the indexer
$indexerOptions = ['fileTypes'];
if ($settings === null) { if ($settings === null) {
return false; return false;
} }
@ -253,7 +256,7 @@ class Workspace
$this->options->$prop = $val; $this->options->$prop = $val;
} }
if ($this->indexer && !empty(array_intersect($changedOptions, $this->options->getIndexerOptions()))) { if ($this->indexer && !empty(array_intersect($changedOptions, $indexerOptions))) {
// check list of options that changed since last time against the list of valid indexer options // check list of options that changed since last time against the list of valid indexer options
// wipe main index and start reindexing // wipe main index and start reindexing