jasongilman / proto-repl

A Clojure Development Environment package for the Atom editor
https://atom.io/packages/proto-repl
MIT License
563 stars 50 forks source link

Cannot accept autocomplete suggestion using keyboard #256

Open WalterGR opened 7 years ago

WalterGR commented 7 years ago

Using:

Repro steps:

  1. Open a REPL.
  2. Type something that shows 1 more completions.
  3. Press enter.

Expected:

Autocomplete happens.

Actual:

Autocomplete dropdown is dismissed and a newline is entered in the REPL.

Notes:

rgdelato commented 7 years ago

You should be able to autocomplete by pressing "tab" (as opposed to pressing "enter"). If you would rather press enter, I think there should be a way to set that in your keymap.

Edit: Jason's suggested Atom config has these lines in the keymap.cson file:

# Allows using enter to select an autocomplete suggestion.
'.platform-darwin atom-text-editor[data-grammar~="clojure"].autocomplete-active':
  'enter': 'autocomplete-plus:confirm'
WalterGR commented 7 years ago

Thanks rgdelato. I see that's from Jason's Atom Clojure Setup - https://gist.github.com/jasongilman/d1f70507bed021b48625 . I hadn't looked at that since Jason added the keymap section.

I assumed completion was a proto-repl command, and didn't see anything in the command palette. Perhaps this could be mentioned in the readme.

WalterGR commented 7 years ago

FYI, making this even more confusing, I checked my autocomplete-plus settings, and for the following setting:

Keymap For Confirming A Suggestion

You should use the key(s) indicated here to confirm a suggestion from the suggestion list and have it inserted into the file.

The "tab and enter" option is selected.

Both tab and enter work in a .clj file. Only tab works in a REPL, unless I use the keymap.cson incantation above.

rgdelato commented 7 years ago

Hmm. You're right. I don't know then, looks like there's an issue.

Maybe it's caused by this? https://github.com/jasongilman/proto-repl/blob/master/keymaps/proto-repl.cson#L101-L105

rgdelato commented 7 years ago

Interestingly, the fix in Proto REPL's keymap doesn't actually seem to fix the Paredit issue that issue that people are seeing? Not sure what's up with that... https://github.com/jonspalding/lisp-paredit/issues/26#issuecomment-297849894

bjonica commented 6 years ago

@rgdelato I think it's because the keymap is missing overrides for ink-console. The issue you referenced proposes a user-side fix.