From b60c39804aa88d50bc5bee68ecbe2d1b63a32b7f Mon Sep 17 00:00:00 2001 From: Daniel Leech Date: Sat, 16 Mar 2024 15:41:55 +0000 Subject: [PATCH] Add extensions to config --- doc/reference/configuration.rst | 4 ++-- lib/Indexer/Extension/IndexerExtension.php | 3 ++- lib/TextDocument/Exception/TextDocumentNotFound.php | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/reference/configuration.rst b/doc/reference/configuration.rst index a8911b5b9..9d5317f15 100644 --- a/doc/reference/configuration.rst +++ b/doc/reference/configuration.rst @@ -1614,7 +1614,7 @@ Type: array Glob patterns to include while indexing -**Default**: ``["\/**\/*.php"]`` +**Default**: ``["\/**\/*.php","\/**\/*.phar"]`` .. _param_indexer.exclude_patterns: @@ -1758,7 +1758,7 @@ Type: array File extensions (e.g. `php`) for files that should be indexed -**Default**: ``["php"]`` +**Default**: ``["php","phar"]`` .. _ObjectRendererExtension: diff --git a/lib/Indexer/Extension/IndexerExtension.php b/lib/Indexer/Extension/IndexerExtension.php index 4fb1b9748..399155df0 100644 --- a/lib/Indexer/Extension/IndexerExtension.php +++ b/lib/Indexer/Extension/IndexerExtension.php @@ -79,6 +79,7 @@ public function configure(Resolver $schema): void self::PARAM_INDEX_PATH => '%cache%/index/%project_id%', self::PARAM_INCLUDE_PATTERNS => [ '/**/*.php', + '/**/*.phar', ], self::PARAM_EXCLUDE_PATTERNS => [ '/vendor/**/Tests/**/*', @@ -92,7 +93,7 @@ public function configure(Resolver $schema): void self::PARAM_PROJECT_ROOT => '%project_root%', self::PARAM_REFERENCES_DEEP_REFERENCES => true, self::PARAM_IMPLEMENTATIONS_DEEP_REFERENCES => true, - self::PARAM_SUPPORTED_EXTENSIONS => ['php'], + self::PARAM_SUPPORTED_EXTENSIONS => ['php', 'phar'], ]); $schema->setDescriptions([ self::PARAM_ENABLED_WATCHERS => 'List of allowed watchers. The first watcher that supports the current system will be used', diff --git a/lib/TextDocument/Exception/TextDocumentNotFound.php b/lib/TextDocument/Exception/TextDocumentNotFound.php index 8385adbba..776975b34 100644 --- a/lib/TextDocument/Exception/TextDocumentNotFound.php +++ b/lib/TextDocument/Exception/TextDocumentNotFound.php @@ -13,6 +13,6 @@ public static function fromUri(TextDocumentUri $uri): self return new self(sprintf( 'Text document "%s" not found', $uri - ).(new Exception())->getTraceAsString()); + )); } }