oni-php: Add support to add first use statement
This commit is contained in:
parent
ecef5d97d9
commit
097630b001
1 changed files with 8 additions and 3 deletions
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
;; Author: Tom Willemse <tom@ryuslash.org>
|
;; Author: Tom Willemse <tom@ryuslash.org>
|
||||||
;; Keywords: local
|
;; Keywords: local
|
||||||
;; Version: 2024.1230.141448
|
;; Version: 2025.0122.121804
|
||||||
;; Package-Requires: (php-mode oni-yasnippet oni-flycheck oni-company oni-hydra ggtags fic-mode company-php)
|
;; Package-Requires: (php-mode oni-yasnippet oni-flycheck oni-company oni-hydra ggtags fic-mode company-php)
|
||||||
|
|
||||||
;; This program is free software; you can redistribute it and/or modify
|
;; This program is free software; you can redistribute it and/or modify
|
||||||
|
@ -83,8 +83,13 @@ nil for some reason."
|
||||||
(t (car classes)))))
|
(t (car classes)))))
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
(search-forward "use ")
|
|
||||||
(forward-paragraph)
|
(if (search-forward "use " nil t)
|
||||||
|
(forward-paragraph)
|
||||||
|
(search-forward "namespace ")
|
||||||
|
(forward-line)
|
||||||
|
(insert "\n"))
|
||||||
|
|
||||||
(let ((start (point)))
|
(let ((start (point)))
|
||||||
(insert "use " class ";\n")
|
(insert "use " class ";\n")
|
||||||
(pulse-momentary-highlight-region start (point))))))
|
(pulse-momentary-highlight-region start (point))))))
|
||||||
|
|
Loading…
Reference in a new issue