steelbrain / intentions

Base package for showing intentions in Atom
MIT License
53 stars 11 forks source link

Can't trigger intentions list #65

Open mensch opened 7 years ago

mensch commented 7 years ago

I've been attempting to use the "Fix linter issue" intention, but I can't seem to trigger the list on macOS using the default command ctrl+enter. At first I thought the new Git commands were interfering (committing is also done using ctrl+enter), but after setting a new shortcut in my keymap.cson (ctrl+alt+enter) the list still isn't triggered.

I've tried the behaviour in JavaScript (linter-eslint), PHP (linter-php) and SCSS files (linter-stylehint) containing errors, but the menu nevers shows. Not sure if every linter package has an autofix intention, but I was under the impression that eslint does. I'm using Atom 1.18.0 on macOS Sierra and the error console doesn't show any errors when attempting to trigger the intentions.

steelbrain commented 7 years ago

Hi @mensch

Can you press cmd + . to toggle keybindings resolver and then press ctrl + enter and share with us the screenshot?

mensch commented 7 years ago

Hmm, that's weird. Using the keyboard of my Macbook Pro I'm able to trigger the intentions list. I originally reported the bug while using my work setup, where I work on a wired Apple keyboard. I'll try that setup again and make a screenshot.

After triggering the intentions list I'm not able to select the "Fix linter issue". Is there another shortcut or should I be able to click or navigate with the arrow keys?

screen shot 2017-07-04 at 19 49 19
steelbrain commented 7 years ago

You should be able to press enter / click the items in list, if it doesn't, let me know so I can investigate and eventually fix

mensch commented 7 years ago

Ah yes, you're right. When I press enter the error is automatically fixed. The intention isn't highlighted in the One Light theme though, hence my presumption it couldn't be selected. Only when I switch to the Atom Dark theme the highlighting is visible.

Clicking the intention doesn't work for me, this resembles bug #28, I believe. When I click the intention it disappears, but doesn't apply the fix. Retriggering the list with ctrl+enter shows the list in a flash and is dismissed automatically.

I'll try my external keyboard tonight to see if I can trigger the intention list.

Arcanemagus commented 7 years ago

Just a note, although fixing individual issues like that works, with ESLint you are much better off running the Linter Eslint: Fix issues command as that invokes ESLint's own fix mechanism which has conflict resolution between conflicting fixes. Applying all ESLint fixes from linter itself can lead to your file getting broken as each message is taken individually instead of as a whole.

mensch commented 7 years ago

Thanks for the tip @Arcanemagus!

Weird, the shortcut now works when using an external keyboard. The other issues (clicking and highlighting) remain, however.

pablooliveira commented 7 years ago

@mensch: maybe you are using vim-mode-plus ? In my case that was the problem, see #28.

dac09 commented 6 years ago

Hey, I seem to be having an issue where the intentions list is never triggered. The keybindings resolver is showing is definitely triggering correctly, but doesn't display anything. Do I have to install specific intentions-compatible packages? I'm currently looking for ESLint, Prettier, auto import, etc.

Arcanemagus commented 6 years ago

@dac09 Yes, you need something that provides intentions first, linter + linter-ui-default would do that for linter-eslint, but as stated above that isn't the best way to apply fixes from ESLint.