mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
Add doom*project-root advice fn
This commit is contained in:
@ -77,6 +77,11 @@ state are passed in.")
|
||||
"Get the path to the root of your project."
|
||||
(let ((projectile-require-project-root strict-p))
|
||||
(ignore-errors (projectile-project-root))))
|
||||
|
||||
(defun doom*project-root (&rest _)
|
||||
"An advice function used to replace project-root-detection functions in other
|
||||
libraries."
|
||||
(doom-project-root))
|
||||
|
||||
(defmacro doom-project-has! (files)
|
||||
"Checks if the project has the specified FILES, relative to the project root,
|
||||
|
@ -87,9 +87,7 @@
|
||||
:commands tern-mode
|
||||
:init (add-hook 'js2-mode-hook #'tern-mode)
|
||||
:config
|
||||
;; Fix project detection
|
||||
(defun +javascript*tern-project-dir (&rest _) (doom-project-root))
|
||||
(advice-add #'tern-project-dir :override #'+javascript*tern-project-dir))
|
||||
(advice-add #'tern-project-dir :override #'doom*project-root))
|
||||
|
||||
|
||||
(def-package! company-tern
|
||||
|
@ -27,8 +27,6 @@
|
||||
(eldoc-mode +1)))
|
||||
(add-hook! (typescript-mode web-mode) #'+typescript|tide-setup)
|
||||
|
||||
(advice-add #'tide-project-root :override #'doom-project-root)
|
||||
|
||||
(map! :map typescript-mode-map
|
||||
:m "gd" #'tide-jump-to-definition
|
||||
:localleader
|
||||
@ -41,5 +39,7 @@
|
||||
(set! :company-backend 'typescript-mode '(company-tide))
|
||||
(setq tide-format-options
|
||||
'(:insertSpaceAfterFunctionKeywordForAnonymousFunctions t
|
||||
:placeOpenBraceOnNewLineForFunctions nil)))
|
||||
:placeOpenBraceOnNewLineForFunctions nil))
|
||||
|
||||
(advice-add #'tide-project-root :override #'doom*project-root))
|
||||
|
||||
|
Reference in New Issue
Block a user