js-emacs / js2-refactor.el

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

Work when hashbang is present #96

Closed sandinmyjoints closed 7 years ago

sandinmyjoints commented 7 years ago

When I am working with a js file that starts with a hashbang like #!/usr/bin/env node, and I try to run a js2-refactor command, I get "js2r--guard: Can't refactor while buffer has parse errors". It would awesome if hashbangs didn't lead to parse errors!

magnars commented 7 years ago

Agreed! For this to work, the js2-mode parser that we're using needs to be changed to ignore the hashbang. It seems to be under development still: https://github.com/mooz/js2-mode