1
0
Fork 0

oni-php: Make sure the use script runs in the right directory

This commit is contained in:
Tom Willemsen 2024-12-30 11:25:48 -08:00
parent ac7beb27fe
commit ed273e59d2

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
;; Version: 2024.1230.091219
;; Version: 2024.1230.094546
;; 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
@ -73,7 +73,8 @@ nil for some reason."
(defun oni-php-add-use (class)
"Try to add a use statement for CLASS under point."
(interactive (list (symbol-name (symbol-at-point))))
(let* ((classes (read (shell-command-to-string (concat (expand-file-name "find-php-class" oni-php-scripts-dir) " " class))))
(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))))