Refactor is not working at all


#1

note: as new users can only upload one picture per post, there’s two links to images in imgur. Plus, new users can use two links per post, so.

Hello, I’m facing this problem for hours. The default keystroke of Refactor (https://atom.io/packages/refactor) is ctrl-alt-r, which is already used by the editor to reload. So what have I tried? Change the keystroke in the user/.atom/keymap.cson. I set them for:

'atom-text-editor':
  'ctrl-alt-u': 'refactor:rename'
  'enter': 'refactor:done'

So far so good, I opened the key binding resolver and checked: @rafaelcn types ctrl-alt-u. Guess what? It shows:

As expected! I checked again in Settings -> Keybindings -> ctrl-alt-u:

Ok, let’s try for real, I open a file that I want to refactor, type ctrl-alt-u and then… (expectation face :smiley:) nothing happens :sweat:

I’ve tried in a file as you can see in the image above, but, nothing happens, the three yellow underlined lines should be highlighted, shouldn’t? I wanna know if this is a Refactor problem, or is something related to my keymap.cson config, or even with Atom. Thanks in advance :smile:.


#2

Uploaded the images for you. Sorry the spam/troll protections got in your way :blush:

As to your issue, with the default theme, Keybinding Resolver lists all keys that could apply but if it actually triggers one, it shows up in green. So we need to diagnose why the keybinding is being recognized but not executed.

It looks like the refactor package requires additional plugins to work?

Do you have the js-refactor package installed?


#3

Yup, ‘js-refactor’ package is installed.


#4

Can you try manually executing the command from the Command Palette and see if anything happens?


#5

I did it, nothing happens as well.


#6

Ok, then it is possible that the command is being executed by Atom, but the package “refuses” it because there’s nothing to do (as far as it is concerned). I would take a look at the refactor package or js-refactor packages themselves for the solution.


#7

OK, I gonna look to see how it works as I don’t know how to code in coffee script and either how the Atom deals with packages :smile:.


#8

That’s why is not working @leedohm and everybody else: https://github.com/hax/refactor/issues/4


#9

Thanks for linking the issue for others. It will help interested parties in the future, I’m sure.