diff --git a/lisp/lib/projects.el b/lisp/lib/projects.el index ce7964421..ffd2aa9b1 100644 --- a/lisp/lib/projects.el +++ b/lisp/lib/projects.el @@ -150,8 +150,8 @@ If DIR is not a project, it will be indexed (but not cached)." #'counsel-projectile-find-file #'projectile-find-file))) ((and (bound-and-true-p vertico-mode) - (fboundp '+vertico/find-file-in)) - (+vertico/find-file-in default-directory)) + (fboundp '+vertico/consult-fd-or-find)) + (+vertico/consult-fd-or-find default-directory)) ((and (bound-and-true-p ivy-mode) (fboundp 'counsel-file-jump)) (call-interactively #'counsel-file-jump)) diff --git a/modules/completion/vertico/autoload/vertico.el b/modules/completion/vertico/autoload/vertico.el index 0b4219eaf..50059b68b 100644 --- a/modules/completion/vertico/autoload/vertico.el +++ b/modules/completion/vertico/autoload/vertico.el @@ -137,26 +137,6 @@ Supports exporting consult-grep to wgrep, file to wdeired, and consult-location (+vertico/embark-preview) (user-error (vertico-directory-enter))))) -(defvar +vertico/find-file-in--history nil) -;;;###autoload -(defun +vertico/find-file-in (&optional dir initial) - "Jump to file under DIR (recursive). -If INITIAL is non-nil, use as initial input." - (interactive) - (require 'consult) - (let* ((default-directory (or dir default-directory)) - (prompt-dir (consult--directory-prompt "Find" default-directory)) - (cmd (split-string-and-unquote +vertico-consult-fd-args " "))) - (find-file - (consult--read - (split-string (cdr (apply #'doom-call-process cmd)) "\n" t) - :prompt default-directory - :sort nil - :initial (if initial (shell-quote-argument initial)) - :add-history (thing-at-point 'filename) - :category 'file - :history '(:input +vertico/find-file-in--history))))) - ;;;###autoload (defun +vertico/jump-list (jump) "Go to an entry in evil's (or better-jumper's) jumplist." @@ -229,27 +209,23 @@ targets." (not (string-suffix-p "-argument" (cdr binding)))))))) ;;;###autoload -(defun +vertico--consult--fd-make-builder () - (let ((cmd (split-string-and-unquote +vertico-consult-fd-args))) - (lambda (input) - (pcase-let* ((`(,arg . ,opts) (consult--command-split input)) - (`(,re . ,hl) (funcall consult--regexp-compiler - arg 'extended t))) - (when re - (cons (append cmd - (list (consult--join-regexps re 'extended)) - opts) - hl)))))) - -(autoload #'consult--directory-prompt "consult") -;;;###autoload -(defun +vertico/consult-fd (&optional dir initial) +(defun +vertico/consult-fd-or-find (&optional dir initial) + "Runs consult-fd if fd version > 8.6.0 exists, consult-find otherwise. +See URL `https://github.com/minad/consult/issues/770'." (interactive "P") - (if doom-projectile-fd-binary - (pcase-let* ((`(,prompt ,paths ,dir) (consult--directory-prompt "Fd" dir)) - (default-directory dir) - (builder (consult--find-make-builder paths))) - (find-file (consult--find prompt builder initial))) + ;; TODO this condition was adapted from a similar one in lisp/doom-projects.el, to be replaced with a more robust check post v3 + (if (when-let* + ((bin (if (ignore-errors (file-remote-p default-directory nil t)) + (cl-find-if (doom-rpartial #'executable-find t) + (list "fdfind" "fd")) + doom-projectile-fd-binary)) + (version (with-memoization doom-projects--fd-version + (cadr (split-string (cdr (doom-call-process bin "--version")) + " " t)))) + ((ignore-errors (version-to-list version)))) + ;; TODO remove once fd 8.6.0 is widespread enough to be the minimum version for doom + (version< "8.6.0" version)) + (consult-fd dir initial) (consult-find dir initial))) ;;;###autoload diff --git a/modules/completion/vertico/config.el b/modules/completion/vertico/config.el index ac4bbad05..4058074e1 100644 --- a/modules/completion/vertico/config.el +++ b/modules/completion/vertico/config.el @@ -7,9 +7,6 @@ The completion/vertico module uses the orderless completion style by default, but this returns too broad a candidate set for company completion. This variable overrides `completion-styles' during company completion sessions.") -(defvar +vertico-consult-fd-args nil - "Shell command and arguments the vertico module uses for fd.") - (defvar +vertico-consult-dir-container-executable "docker" "Command to call for listing container hosts.") @@ -143,20 +140,21 @@ orderless." :before (list #'consult-recent-file #'consult-buffer) (recentf-mode +1)) - (setq consult-project-root-function #'doom-project-root + (setq consult-project-function #'doom-project-root consult-narrow-key "<" consult-line-numbers-widen t consult-async-min-input 2 consult-async-refresh-delay 0.15 consult-async-input-throttle 0.2 consult-async-input-debounce 0.1) - (unless +vertico-consult-fd-args - (setq +vertico-consult-fd-args - (if doom-projectile-fd-binary - (format "%s --color=never -i -H -E .git --regex %s" - doom-projectile-fd-binary - (if IS-WINDOWS "--path-separator=/" "")) - consult-find-args))) + (if doom-projectile-fd-binary + (setq consult-fd-args + '(doom-projectile-fd-binary + "--color=never" + ;; https://github.com/sharkdp/fd/issues/839 + "--full-path --absolute-path" + "--hidden --exclude .git" + (when IS-WINDOWS "--path-separator=/")))) (consult-customize consult-ripgrep consult-git-grep consult-grep @@ -306,9 +304,9 @@ orderless." (map! (:map embark-file-map :desc "Open target with sudo" "s" #'doom/sudo-find-file (:when (modulep! :tools magit) - :desc "Open magit-status of target" "g" #'+vertico/embark-magit-status) + :desc "Open magit-status of target" "g" #'+vertico/embark-magit-status) (:when (modulep! :ui workspaces) - :desc "Open in new workspace" "TAB" #'+vertico/embark-open-in-new-workspace)))) + :desc "Open in new workspace" "TAB" #'+vertico/embark-open-in-new-workspace)))) (use-package! marginalia diff --git a/modules/completion/vertico/packages.el b/modules/completion/vertico/packages.el index 84439288f..0189e2357 100644 --- a/modules/completion/vertico/packages.el +++ b/modules/completion/vertico/packages.el @@ -1,24 +1,21 @@ ;; -*- no-byte-compile: t; -*- ;;; completion/vertico/packages.el -(package! vertico - :recipe (:host github :repo "minad/vertico" - :files ("*.el" "extensions/*.el")) - :pin "a28370d07f35c5387c7a9ec2e5b67f0d4598058d") +(package! vertico :pin "cf8b2abf5207696c054c33214c86e3969d415054") (package! orderless :pin "b24748093b00b37c3a572c4909f61c08fa27504f") -(package! consult :pin "fe49dedd71802ff97be7b89f1ec4bd61b98c2b13") -(package! consult-dir :pin "ed8f0874d26f10f5c5b181ab9f2cf4107df8a0eb") +(package! consult :pin "e4d371235647a7f4967f093eff2125652796957c") +(package! consult-dir :pin "3f5f4b71ebe819392cb090cda71bd39a93bd830a") (when (and (modulep! :checkers syntax) (not (modulep! :checkers syntax +flymake))) - (package! consult-flycheck :pin "3f2a7c17cc2fe64e0c07e3bf90e33c885c0d7062")) -(package! embark :pin "9a44418c349e41020cdc5ad1bd21e8c77a429062") -(package! embark-consult :pin "9a44418c349e41020cdc5ad1bd21e8c77a429062") + (package! consult-flycheck :pin "d83f87581af74f7a2739d8b1b90c37da5ae3d310")) +(package! embark :pin "33c392cf3ce5b92ad73ed5c4f44dbca5d0741cde") +(package! embark-consult :pin "33c392cf3ce5b92ad73ed5c4f44dbca5d0741cde") -(package! marginalia :pin "866e50aee4f066b0903752c69b33e9b7cab93f97") +(package! marginalia :pin "ea356ebb1ddb8d6da78574b517155475cf52d46f") -(package! wgrep :pin "3132abd3750b8c87cbcf6942db952acfab5edccd") +(package! wgrep :pin "208b9d01cfffa71037527e3a324684b3ce45ddc4") (when (modulep! +icons) (package! nerd-icons-completion :pin "c2db8557a3c1a9588d111f8c8e91cae96ee85010")) @@ -26,4 +23,4 @@ (when (modulep! +childframe) (package! vertico-posframe :recipe (:host github :repo "tumashu/vertico-posframe") - :pin "7da6d648ff4202a48eb6647ee7dce8d65de48779")) + :pin "bc0e67cbbba4daaf6ce7b8701a0dc7797d468752")) diff --git a/modules/lang/python/packages.el b/modules/lang/python/packages.el index b67f9755d..6eb269de7 100644 --- a/modules/lang/python/packages.el +++ b/modules/lang/python/packages.el @@ -12,27 +12,27 @@ (when (modulep! +lsp) (unless (modulep! :tools lsp +eglot) (if (modulep! +pyright) - (package! lsp-pyright :pin "54a2acddfdd7c3d31cb804a042305a3c6e60cf81") - (package! lsp-python-ms :pin "f8e7c4bcaefbc3fd96e1ca53d17589be0403b828")))) + (package! lsp-pyright :pin "2f2631ae242d5770dbe6cb924e44c1ee5671789d") + (package! lsp-python-ms :pin "7bda327bec7b219d140c34dab4b1e1fbd41bc516")))) ;; Programming environment -(package! anaconda-mode :pin "1fd13a0f20fcc9e841e2d5c9af73c0b23f09cf39") +(package! anaconda-mode :pin "efd42aa8736d855a3c95e06e6daf4aa797290a93") (when (modulep! :completion company) - (package! company-anaconda :pin "da1566db41a68809ef7f91ebf2de28118067c89b")) + (package! company-anaconda :pin "dabc0adc9a0e56357e046de5fd4dbd8fc797e542")) ;; Environment management (package! pipenv :pin "3af159749824c03f59176aff7f66ddd6a5785a10") (package! pyvenv :pin "31ea715f2164dd611e7fc77b26390ef3ca93509b") (when (modulep! +pyenv) - (package! pyenv-mode :pin "b818901b8eac0e260ced66a6a5acabdbf6f5ba99")) + (package! pyenv-mode :pin "c93dc07e85494b4420e6c50160f38d6915c85684")) (when (modulep! +conda) - (package! conda :pin "6a6a27dad7ab696b41b54a1cb7591ca489133fec")) + (package! conda :pin "60e14d1e9793431b91913a5688e278bd91d56224")) (when (modulep! +poetry) - (package! poetry :pin "5ca52b221e57bb9dce7c89f62e7b01da1346a273")) + (package! poetry :pin "ca2cffb0b174e9d814ad95178af84b525dd2b64d")) ;; Testing frameworks (package! nose :pin "f8528297519eba911696c4e68fa88892de9a7b72") -(package! python-pytest :pin "33c921adaa6c9c8f7cceba2342114c6b406e0d7c") +(package! python-pytest :pin "bdfb3e81eedc6b76ed0c5f77079e7cc8adff7b00") ;; Import managements (package! pyimport :pin "c006a5fd0e5c9e297aa2ad71b2f02f463286b5e3") diff --git a/modules/lang/swift/packages.el b/modules/lang/swift/packages.el index e3ed615bd..3b38feb40 100644 --- a/modules/lang/swift/packages.el +++ b/modules/lang/swift/packages.el @@ -1,11 +1,11 @@ ;; -*- no-byte-compile: t; -*- ;;; lang/swift/packages.el -(package! swift-mode :pin "1244ee48de1895d33f55fed81fc90acda0c901f1") +(package! swift-mode :pin "84059659de4da89d3d2902611cebed6d0423bf06") (if (modulep! +lsp) (unless (modulep! :tools lsp +eglot) - (package! lsp-sourcekit :pin "468c641e35877e4e843f6b7c52a35937de562995")) + (package! lsp-sourcekit :pin "1cd5e7d2699598a97bdbcd289d9a88b249db474c")) (when (modulep! :completion company) (package! company-sourcekit :pin "a1860ad4dd3a542acd2fa0dfac2a388cbdf4af0c")) (when (and (modulep! :checkers syntax) diff --git a/modules/tools/debugger/packages.el b/modules/tools/debugger/packages.el index 208504513..bde6bede8 100644 --- a/modules/tools/debugger/packages.el +++ b/modules/tools/debugger/packages.el @@ -6,5 +6,5 @@ (package! realgud-trepan-ni :pin "0ec088ea343835e24ae73da09bea96bfb02a3130"))) (when (modulep! +lsp) - (package! dap-mode :pin "755845ae053bbfdd3f7b3dca13efa4be480370b5") + (package! dap-mode :pin "2f0c5b28578ce65ec746e4084ba72ba5c652ea79") (package! posframe :pin "017deece88360c7297265680d78a0bb316470716")) diff --git a/modules/tools/lookup/autoload/lookup.el b/modules/tools/lookup/autoload/lookup.el index 0a2002773..b72a52f4e 100644 --- a/modules/tools/lookup/autoload/lookup.el +++ b/modules/tools/lookup/autoload/lookup.el @@ -283,7 +283,7 @@ otherwise falling back to ffap.el (find-file-at-point)." (counsel-file-jump guess (doom-project-root))) ((and (modulep! :completion vertico) (doom-project-p)) - (+vertico/find-file-in (doom-project-root) guess)) + (+vertico/consult-fd-or-find (doom-project-root) guess)) ((find-file-at-point (ffap-prompter guess)))) t)) diff --git a/modules/tools/lsp/packages.el b/modules/tools/lsp/packages.el index 8ca5f8cd5..19fda1523 100644 --- a/modules/tools/lsp/packages.el +++ b/modules/tools/lsp/packages.el @@ -3,14 +3,14 @@ (if (modulep! +eglot) (progn - (package! eglot :pin "2b145778ba5e57f393e50aea76b28e518c401828") + (package! eglot :pin "f73594f58989fd2fd3bc6b2c1775c74e65a9eaa0") (when (modulep! :completion vertico) - (package! consult-eglot :pin "db9d41c9812a5a8a7b9a22fa7f3c314e37584d41")) + (package! consult-eglot :pin "049c6319b8a48ff66189d49592c7759f0b356596")) (when (and (modulep! :checkers syntax) (not (modulep! :checkers syntax +flymake))) (package! flycheck-eglot :pin "9ff8d0068be59b1450964b390349d75a68af21ed"))) - (package! lsp-mode :pin "d441f3d268a31a4a514af2db506a5eec47ee617d") - (package! lsp-ui :pin "0dd39900c8ed8145d207985cb2f65cedd1ffb410") + (package! lsp-mode :pin "02c5ba59ce3d1cede4aa689c530f16cccfb5e1d1") + (package! lsp-ui :pin "bc58c6664577d1d79060c6b32b7ad20e70ee19d0") (when (modulep! :completion ivy) (package! lsp-ivy :pin "9ecf4dd9b1207109802bd1882aa621eb1c385106")) (when (modulep! :completion helm)