deadfoxygrandpa / Elm.tmLanguage

Elm language syntax highlighting and tool integration for ST2/3
https://packagecontrol.io/packages/Elm%20Language%20Support
MIT License
122 stars 27 forks source link

elm-package support #39

Closed texastoland closed 8 years ago

texastoland commented 9 years ago

NOT Ready to merge

texastoland commented 9 years ago

@deadfoxygrandpa This should be good to go when you are.

texastoland commented 9 years ago

Never mind I remember one more thing needs fixed…

deadfoxygrandpa commented 8 years ago

@AppShipIt I was just revisiting this. Is the "one more thing" that needs to be fixed the "Remember selected build system" item? Would you mind explaining that to me so I can fix it? I'd like to incorporate this stuff and get it working.

Thanks again for all the help you provided.

texastoland commented 8 years ago

Likewise thanks for the opportunity to participate in an interesting project Alex!

ST's builtin Build system machinery does a lot of lifting for us but wasn't very extensible. I used it for both elm_make and elm_package commands. I wanted a GUI to pick which package to install from the web, but Build commands neither have any way to inject callbacks nor receive dynamic arguments. I built a custom ElmPackageInstallCommand that (source):

  1. sets the Build system to elm_package,
  2. passes dynamic arguments by attaching them as settings on the view (don't try static variables for this!),
  3. and runs the build system selected in step 1.

The unexpected side effect is next time you run the build it tries elm_package instead of elm_make. In practice, elm_make should probably always be default. ElmPackageCommand could probably just set it back on run?

NB last I checked, @evancz was revamping their project file, so our parser will need updated accordingly.

deadfoxygrandpa commented 8 years ago

I fixed this today by going in a slightly different direction, which was calling default_exec.ExecCommand's run method for the elm package command instead of going through the build system. It's functionally very similar and still uses the build output panel the same way, it just doesn't set the build system so it bypasses the issue you had.

Thanks again!