ysgard / d-struct

Atom syntax highlighting and snippets for the D programming language.
MIT License
10 stars 7 forks source link

Improve dub integration #12

Open ysgard opened 7 years ago

ysgard commented 7 years ago

Right now, the dub 'integration' is pretty bare-bones - we open a terminal window in the project root and run dub build or dub run. It would be nice to take better advantage of Atom's UI.

MggMuggins commented 7 years ago

Agreed. And my Linux implementation isn't so pretty either. As I see it, there are two options:

  1. Pipe the output of dub (which you can do using Node.js streams) into a new tab in the editor, which is basically creating our own terminal emulator in atom
  2. Find a terminal emulator which has a decent API to depend on, and then have it open a new command and run those commands. I don't include doing fancier stuff without the terminal because using dub run has a terminal output, and more importantly, if your program tries to get anything from stdin, then it needs a terminal for that.
ysgard commented 7 years ago

I figured I'd go with (1), since that would already be a net gain and should be simple to implement. I've got most of the pieces in place, just trying to figure out how to handle this Promise that opening a new tab returns...

MggMuggins commented 7 years ago

xD I think promises are for asynchronous event handling and stuff. Kudos though, looking forward to seeing that! Actually, I think this terminal has an API for doing things: https://github.com/fusion809/terminal-fusion I don't know if there is a central API for opening something in a terminal in Atom, but it would be really cool if there were.