|
|
@@ -202,6 +202,7 @@ returned by `request`." |
|
|
|
** Magic Vars |
|
|
|
#+BEGIN_SRC elisp |
|
|
|
(defun $file () buffer-file-name) |
|
|
|
(defun $ext () (f-ext ($file))) |
|
|
|
(defun $cwd (&optional dir) |
|
|
|
(if dir |
|
|
|
dir |
|
|
@@ -1226,15 +1227,15 @@ Setup: run =M-x dap-go-setup= |
|
|
|
#+END_SRC |
|
|
|
|
|
|
|
#+BEGIN_SRC elisp |
|
|
|
(defun my/lsp-root (lsp--calculate-root session file) |
|
|
|
(defun my/lsp-find-root (lsp--find-root-interactively &rest args) |
|
|
|
(or |
|
|
|
(and (ts/repo/p file) |
|
|
|
(pcase (f-ext file t) |
|
|
|
(".rs" (my/rust/workspace-root file)) |
|
|
|
(and (ts/repo/p) |
|
|
|
(pcase (f-ext ($file) t) |
|
|
|
(".rs" (my/rust/workspace-root)) |
|
|
|
(_ nil))) |
|
|
|
(lsp--calculate-root session file))) |
|
|
|
(apply lsp--find-root-interactively args))) |
|
|
|
|
|
|
|
((advice-add 'lsp--calculate-root :around #'my/lsp-root) |
|
|
|
(advice-add 'lsp--find-root-interactively :around #'my/lsp-find-root) |
|
|
|
#+END_SRC |
|
|
|
|
|
|
|
** Counsel Search |
|
|
|