oni-php: Warn me when I'm trying to use a non-existent class
This commit is contained in:
parent
2b3048fc87
commit
2cbb137dd2
1 changed files with 6 additions and 3 deletions
|
@ -75,9 +75,12 @@ nil for some reason."
|
|||
(interactive (list (symbol-name (symbol-at-point))))
|
||||
(let* ((default-directory (project-root (project-current)))
|
||||
(classes (read (shell-command-to-string (concat (expand-file-name "find-php-class" oni-php-scripts-dir) " " class))))
|
||||
(class (if (> (length classes) 1)
|
||||
(completing-read "Use: " classes nil t)
|
||||
(car classes))))
|
||||
(class (cond
|
||||
((null classes)
|
||||
(user-error "Class ‘%s’ not found" class))
|
||||
((> (length classes) 1)
|
||||
(completing-read "Use: " classes nil t))
|
||||
(t (car classes)))))
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(search-forward "use ")
|
||||
|
|
Loading…
Reference in a new issue