From ed273e59d23e837298088578417465e229056fec Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Mon, 30 Dec 2024 11:25:48 -0800 Subject: [PATCH] oni-php: Make sure the use script runs in the right directory --- oni-php/oni-php.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/oni-php/oni-php.el b/oni-php/oni-php.el index 941a6fe..2d10242 100644 --- a/oni-php/oni-php.el +++ b/oni-php/oni-php.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; 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))))