[emacs] Fix the project root tool
This commit is contained in:
parent
1a9ccb2554
commit
4b549f8a1f
1 changed files with 14 additions and 1 deletions
|
|
@ -523,13 +523,26 @@ Returns file path, modified status, major mode, size, line count, and more."
|
||||||
|
|
||||||
(gptel-make-tool
|
(gptel-make-tool
|
||||||
:name "get_project_root"
|
:name "get_project_root"
|
||||||
:function #'project-root
|
:function #'doty-tools--get-project-root
|
||||||
:description "Get the root directory of the current project."
|
:description "Get the root directory of the current project."
|
||||||
:args ()
|
:args ()
|
||||||
:category "reading"
|
:category "reading"
|
||||||
:confirm nil
|
:confirm nil
|
||||||
:include t)
|
:include t)
|
||||||
|
|
||||||
|
(ert-deftest doty-tools--test--get_project_root ()
|
||||||
|
"Tests for the emacs_insert_line tool."
|
||||||
|
(let* ((tf (make-temp-file "test-project-" t)))
|
||||||
|
(unwind-protect
|
||||||
|
(with-temp-buffer
|
||||||
|
(let ((default-directory tf))
|
||||||
|
(call-process "git" nil t nil "init" ".")
|
||||||
|
(should
|
||||||
|
(equal (file-name-as-directory tf)
|
||||||
|
(doty-tools--test--invoke-tool "get_project_root" ())))))
|
||||||
|
|
||||||
|
(delete-directory tf t))))
|
||||||
|
|
||||||
(defun doty-tools--search-project-regex (callback regex)
|
(defun doty-tools--search-project-regex (callback regex)
|
||||||
"Search the current project for instances of a given REGEX.
|
"Search the current project for instances of a given REGEX.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue