lang/javascript: refactor company/lookup config; bring back xref-js2
This commit is contained in:
parent
6ba9259735
commit
855ad2c0f1
2 changed files with 20 additions and 3 deletions
|
@ -80,12 +80,20 @@
|
||||||
(tide-setup)))
|
(tide-setup)))
|
||||||
(add-hook 'web-mode-hook #'+javascript|init-tide-in-web-mode)
|
(add-hook 'web-mode-hook #'+javascript|init-tide-in-web-mode)
|
||||||
:config
|
:config
|
||||||
(set! :company '(js2-mode typescript-mode) 'company-tide)
|
(add-hook 'tide-mode-hook #'eldoc-mode)
|
||||||
(set! :lookup '(js2-mode rjsx-mode typescript-mode)
|
|
||||||
|
;; code completion
|
||||||
|
(after! company
|
||||||
|
;; tide affects the global `company-backends', undo this so doom can handle
|
||||||
|
;; it buffer-locally
|
||||||
|
(setq-default company-backends (delq 'company-tide (default-value 'company-backends))))
|
||||||
|
(set! :company-backends 'tide-mode 'company-tide)
|
||||||
|
|
||||||
|
;; navigation
|
||||||
|
(set! :lookup 'tide-mode
|
||||||
:definition #'tide-jump-to-definition
|
:definition #'tide-jump-to-definition
|
||||||
:references #'tide-references
|
:references #'tide-references
|
||||||
:documentation #'tide-documentation-at-point)
|
:documentation #'tide-documentation-at-point)
|
||||||
(add-hook 'tide-mode-hook #'eldoc-mode)
|
|
||||||
|
|
||||||
;; resolve to `doom-project-root' if `tide-project-root' fails
|
;; resolve to `doom-project-root' if `tide-project-root' fails
|
||||||
(advice-add #'tide-project-root :override #'+javascript*tide-project-root)
|
(advice-add #'tide-project-root :override #'+javascript*tide-project-root)
|
||||||
|
@ -131,6 +139,12 @@
|
||||||
:n "r" #'+javascript/refactor-menu))
|
:n "r" #'+javascript/refactor-menu))
|
||||||
|
|
||||||
|
|
||||||
|
(def-package! xref-js2
|
||||||
|
:when (featurep! :feature lookup)
|
||||||
|
:commands xref-js2-xref-backend
|
||||||
|
:init (set! :lookup 'js2-mode :xref-backend #'xref-js2-xref-backend))
|
||||||
|
|
||||||
|
|
||||||
(def-package! nodejs-repl
|
(def-package! nodejs-repl
|
||||||
:commands nodejs-repl
|
:commands nodejs-repl
|
||||||
:init
|
:init
|
||||||
|
|
|
@ -14,3 +14,6 @@
|
||||||
(package! typescript-mode)
|
(package! typescript-mode)
|
||||||
(package! web-beautify)
|
(package! web-beautify)
|
||||||
|
|
||||||
|
(when (featurep! :feature lookup)
|
||||||
|
(package! xref-js2))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue