js-emacs / js2-refactor.el

A JavaScript refactoring library for emacs
GNU General Public License v3.0
373 stars 47 forks source link

How to use with js2-minor-mode? #135

Closed minikN closed 2 years ago

minikN commented 2 years ago

Hello,

I'm trying to use js2-refactor with the js2-minor-mode. I'm on Emacs 28 and according to their docs, if working with React and JSX,

The currently recommended solution is to install Emacs 27 (you can build from source or e.g. install a snapshot from a PPA) and use js-mode as the major mode. To make use of the JS2 AST and the packages that integrate with it, we recommend js2-minor-mode. See here: https://github.com/mooz/js2-mode#react-and-jsx

So I added:

(add-hook 'js-mode-hook 'js2-minor-mode)
(add-hook 'js2-minor-mode-hook 'js2-refactor-mode)

But this doesn't work. On every js2r-* function I get the error: Wrong type argument: js2-node, nil. What am I missing?

Thanks in advance.

minikN commented 2 years ago

I got it fixed.