diff --git a/src/Psalm/Internal/LanguageServer/Server/TextDocument.php b/src/Psalm/Internal/LanguageServer/Server/TextDocument.php index b98b5161638..d495090e242 100644 --- a/src/Psalm/Internal/LanguageServer/Server/TextDocument.php +++ b/src/Psalm/Internal/LanguageServer/Server/TextDocument.php @@ -6,6 +6,7 @@ use Amp\Promise; use Amp\Success; +use InvalidArgumentException; use LanguageServerProtocol\CompletionList; use LanguageServerProtocol\Hover; use LanguageServerProtocol\Location; @@ -367,7 +368,7 @@ public function codeAction(TextDocumentIdentifier $textDocument, Range $range): try { $this->codebase->analyzer->analyzeFiles($this->project_analyzer, 1, false); - } catch (UnexpectedValueException $e) { + } catch (UnexpectedValueException | InvalidArgumentException $e) { error_log('codeAction errored on file ' . $file_path. ', Reason: '.$e->getMessage()); return new Success(null); }