js-emacs / js2-refactor.el

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

More fixes for js2r--local-name-node-p #102

Closed mishoo closed 6 years ago

mishoo commented 7 years ago

Fixes a few more cases where js2r-rename-var could fail to detect the symbol (see comments). One of them depends on a fix in js2-mode though (detecting the symbol in { name }, without that fix js2-node-at-point will return a name node only if the cursor is on the n).

NicolasPetton commented 6 years ago

Thanks for the PR!

Could you add a few regression tests as well?

mishoo commented 6 years ago

I tried back when I submitted the PR, something failed (can't remember exactly what) and I gave up. In any case, we depend on a fix in js2-mode — without that, a proper test would fail anyway.

I'll try adding some tests if/after my PR into js2-mode gets merged.

EDIT: it's been merged. I'll try again to write the tests tomorrow.

mishoo commented 6 years ago

I added some tests.