tidalcycles / Tidal

Pattern language
http://tidalcycles.org/
GNU General Public License v3.0
2.22k stars 254 forks source link

Autocomplete for Emacs mode tidal.el #647

Open xmacex opened 4 years ago

xmacex commented 4 years ago

Is your feature request related to a problem? Please describe. Autocomplete in Emacs would be nice, to save typing and reduce typos.

Describe the function/feature you'd like When typing things, the editor would suggest defined symbols which match partial user input. Like you know an autocomplete.

Describe alternatives you've considered Emacs has (AFAIK) two autocomplete engines, Auto-Complete and Company. The latter, Company allows creation of backends quite nicely.

SCENE 1.

ENTER THE SKEPTIC

Tidal defaults to using GHCi as the Haskell environment. GHCi has this nice :complete repl "9" command for completing to 90s_was_an_era_of_excellent_rave_music, 909, 99luftballons etc. Company can also provide a bit of metadata for the Emacs to present to the user for a richer completing experience than just a list of symbols with a given prefix.

Additional context

SCENE 2.

emacs-tidal-autocomplete-in-the-works

I am lowkey (very lowkey) working on this here https://github.com/xmacex/Tidal/tree/autocomplete-for-emacs on a Company backend, and will make a PR to Tidal when it is somehow ready for showtime.

Currently (2020-05-12) it does successfully retrieve minimal completions of Haskell symbols, but there are all kinds of issues such as a bug caused by asynchronous execution, no nice metadata, SuperCollider/SuperDirt sounds are not completed, there are no tests or useful documentation, no error resilience e.g. in the case of non-GHCi Haskell environment etc. My Haskell skills are non-existent and I don't even understand how the whole contraption works, and my ELisp skills are trash, but I'm learning :)

ndr-brt commented 4 years ago

In atom-tidalcycles :browse Sound.Tidal.Context is used to retrieve tidal function names and build autocomplete data. In addition, hoogle is used to add documentaion.

xmacex commented 4 years ago

Thanks @ndr-brt!