Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

auto-complete #22

Open
miguel-negrao opened this issue May 21, 2016 · 6 comments
Open

auto-complete #22

miguel-negrao opened this issue May 21, 2016 · 6 comments

Comments

@miguel-negrao
Copy link

Would be nice to get auto-complete in the repl too... :-)

@lierdakil
Copy link
Contributor

It would be, but there are some architectural quirks in Atom that prevent this from working. I didn't find a way to work around that (yet). This probably will be implemented eventually, but it will take time. Probably quite a bit of it.

@miguel-negrao
Copy link
Author

In that case, perhaps a substitute for that would be to have a command which executes the currently selected text in a normal .hs file.

@lierdakil
Copy link
Contributor

Sorry it took so long.

ide-haskell-repl v0.2.1 has two new commands:

  • ide-haskell-repl:copy-selection-to-repl-input

    Will copy selection from currently active editor to REPL input, and focus REPL input.

  • ide-haskell-repl:run-selection-in-repl

    Will run selection from currently active editor in REPL as if you typed it in REPL input and executed it.

Both commands open REPL for current file if it's not already open.

@soiamsoNG
Copy link
Contributor

I think this can use haskell-ghc-mod to complete, as inside the editor. Do you mean can not use ghc-mod to do that or just can not pass simple Tab char to ghci ? Since ghci capture Tab in a more raw manner (use win_console.h in Win32 for example, an trigger the complete action)?

It would be, but there are some architectural quirks in Atom that prevent this from working. I didn't find a way to work around that (yet). This probably will be implemented eventually, but it will take time. Probably quite a bit of it.

@lierdakil
Copy link
Contributor

@soiamsoNG, the problem is not making ghc-mod work. The problem is making autocompletion itself work. autocomplete-plus package (which handles autocompletion in Atom) doesn't want to play nice with a custom-built editor instance. I didn't find time to investigate what can be done about that in much detail. And while on topic, interfacing with ghci's autocompletion would be even harder, and probably extremely brittle.

@lierdakil
Copy link
Contributor

lierdakil commented Feb 19, 2017

Okay, so basic implementation exists via #45, but there's still room for improvement. New autocomplete-plus API allows to bind autocomplete to custom text editors, so that problem is solved, for the most part. Now the issue is getting all completion info we can from ghc-mod (if available) instead of in addition to ghci, since ghc-mod provides more information.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants