feat(tazjin/emacs): add find-cargo-project
function
This is useful for eglot launching rust-analyzer when I'm outside of a depot project. Change-Id: I1fa1dc11e3eabe4bdedbd6389b55411641391c7e Reviewed-on: https://cl.tvl.fyi/c/depot/+/6176 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
This commit is contained in:
parent
598c197422
commit
e70ef017ff
1 changed files with 10 additions and 0 deletions
|
@ -293,6 +293,16 @@ the GPG agent correctly."
|
|||
|
||||
(add-to-list 'project-find-functions #'find-depot-project)
|
||||
|
||||
(defun find-cargo-project (dir)
|
||||
"Attempt to find the current project in `project-find-functions'
|
||||
by looking for a `Cargo.toml' file."
|
||||
(unless (equal "/" dir)
|
||||
(if (f-exists-p (f-join dir "Cargo.toml"))
|
||||
(cons 'transient dir)
|
||||
(find-cargo-project (f-parent dir)))))
|
||||
|
||||
(add-to-list 'project-find-functions #'find-cargo-project)
|
||||
|
||||
(defun magit-find-file-worktree ()
|
||||
(interactive)
|
||||
"Find a file in the current (ma)git worktree."
|
||||
|
|
Loading…
Reference in a new issue