|
|
@ -260,10 +260,11 @@ group."
|
|
|
|
(with-current-buffer (phpinspect-buffer-buffer buffer)
|
|
|
|
(with-current-buffer (phpinspect-buffer-buffer buffer)
|
|
|
|
(save-excursion
|
|
|
|
(save-excursion
|
|
|
|
(goto-char start)
|
|
|
|
(goto-char start)
|
|
|
|
(delete-region start end)
|
|
|
|
(combine-after-change-calls
|
|
|
|
(dolist (statement statements)
|
|
|
|
(delete-region start end)
|
|
|
|
(phpinspect-codify-token (cdr statement))
|
|
|
|
(dolist (statement statements)
|
|
|
|
(insert-char ?\n))
|
|
|
|
(phpinspect-codify-token (cdr statement))
|
|
|
|
|
|
|
|
(insert-char ?\n)))
|
|
|
|
|
|
|
|
|
|
|
|
(if (looking-at "[[:blank:]\n]+")
|
|
|
|
(if (looking-at "[[:blank:]\n]+")
|
|
|
|
;; Delete excess trailing whitespace (there's more than 2 between the
|
|
|
|
;; Delete excess trailing whitespace (there's more than 2 between the
|
|
|
@ -279,6 +280,7 @@ group."
|
|
|
|
"Find types that are used in the current buffer and make sure
|
|
|
|
"Find types that are used in the current buffer and make sure
|
|
|
|
that there are import (\"use\") statements for them."
|
|
|
|
that there are import (\"use\") statements for them."
|
|
|
|
(interactive)
|
|
|
|
(interactive)
|
|
|
|
|
|
|
|
|
|
|
|
(if phpinspect-current-buffer
|
|
|
|
(if phpinspect-current-buffer
|
|
|
|
(let* ((buffer phpinspect-current-buffer)
|
|
|
|
(let* ((buffer phpinspect-current-buffer)
|
|
|
|
;; use buffer-reparse to ensure fully structurally correct
|
|
|
|
;; use buffer-reparse to ensure fully structurally correct
|
|
|
@ -346,6 +348,11 @@ that there are import (\"use\") statements for them."
|
|
|
|
(phpinspect-add-use-statements-for-missing-types
|
|
|
|
(phpinspect-add-use-statements-for-missing-types
|
|
|
|
used-types buffer (append imports namespace-imports) project token-meta)
|
|
|
|
used-types buffer (append imports namespace-imports) project token-meta)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(with-current-buffer (get-buffer-create "attempt-before-namespace-removal-code")
|
|
|
|
|
|
|
|
(erase-buffer)
|
|
|
|
|
|
|
|
(insert (with-current-buffer (phpinspect-buffer-buffer buffer) (buffer-string))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(phpinspect-remove-unneeded-use-statements
|
|
|
|
(phpinspect-remove-unneeded-use-statements
|
|
|
|
used-types buffer (append imports namespace-imports) token-meta)
|
|
|
|
used-types buffer (append imports namespace-imports) token-meta)
|
|
|
|
|
|
|
|
|
|
|
|