Skip to content

Commit 8650aa9

Browse files
committed
Ignore error output in JSON
1 parent e55df75 commit 8650aa9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

phpstan.el

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,11 @@ it returns the value of `SOURCE' as it is."
312312
"Read JSON string from BUFFER."
313313
(with-current-buffer buffer
314314
(goto-char (point-min))
315+
;; Ignore STDERR
316+
(save-match-data
317+
(when (search-forward-regexp "^{" nil t)
318+
(backward-char 1)
319+
(delete-region (point-min) (point))))
315320
(if (eval-when-compile (and (fboundp 'json-serialize)
316321
(fboundp 'json-parse-buffer)))
317322
(with-no-warnings

0 commit comments

Comments
 (0)