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

Build #25

Closed texastoland closed 9 years ago

texastoland commented 9 years ago

This is the big one. I'll just list features:

  1. Two standard build commands triggered with Super+[Shift]+B or Super+[Shift]+F7.
    • The first just check errors. Credit to @rtfeldman's tweet!
    • Run additionally builds output to an intelligent path.
  2. Errors are formatted for small space. They're navigable with Super+[Shift]+F4. Error highlighting is integrated with Highlight Build Errors (ST3 only) plugin if installed.
  3. Compile messages are both highlighted and colored including embedded source 🎨
  4. Ouput paths are configurable in elm-package.json. Keys not documented? No fear! There's a UI labeled Elm Build System in the Command Palette. It only requires a valid config in any ancestor directory of the edited file.
  5. Launch generated HTML in your browser from an Elm source file. It requires SideBarEnhancements (ST3 only) if installed or alternatively View In Browser plugin. Not building HTML? That path is configurable in the Command Palete too.
  6. Fully ST2/ST3 compatible.
rtfeldman commented 9 years ago

Tried it out, got this in the console:

Some new packages are needed. Here is the upgrade plan.

  Install:
    elm-lang/core 2.1.0

Do you approve of this plan? (y/n) elm-make: <stdin>: hGetLine: end of file
[Finished in 1.0s with exit code 1]
[shell_cmd: elm-make]
[dir: /Users/rtfeldman/code/elm-core/src]
[path: /usr/bin:/bin:/usr/sbin:/sbin]

I've seen the hGetLine: end of file error before (it's a Haskell thing), and we've worked around it by setting the LANG env var. I tried doing that in the build config...

{
  "env": {
    "LANG": "en_US.UTF-8"
  },
  "shell_cmd": "elm-make"
}

...but this time it didn't help.

Anyway, the error was happening because the file I was editing (Maybe.elm in core) happened to be in the src/ directory instead of the project root. elm-make needs to run in whatever directory elm-package.json lives in, so I hacked around it by doing this:

{
  "working_dir": "../",
  "shell_cmd": "elm-make"
}

...although naturally that's not a scalable solution. :smile:

rtfeldman commented 9 years ago

At that point the build ran and I saw the output in the console, which was pretty sweet!

I have Highlight Build Errors installed, but didn't see any inline. (I also tried uninstalling/reinstalling Highlight Build Errors, uninstalling/reinstalling elm-sublime, and restarting Sublime Text 3, but still no highlighting.)

Awesome progress @dnalot! :smiley:

rtfeldman commented 9 years ago

Same deal with SublimeREPL: I have it installed, but don't see Elm integrations.

screen shot 2015-08-03 at 9 04 30 pm

rtfeldman commented 9 years ago

Also, for reference, this is the version I had installed:

screen shot 2015-08-03 at 9 06 04 pm

texastoland commented 9 years ago

Mind reporting each in my fork?

  1. Re. src folder: Looking now!
  2. Re. Highlighting: do F4/Shift+F4 select your errors in the build panel?
  3. Re. REPL: do you see anything Elm or REPL related in the Console (Ctrl+`), especially at startup?
texastoland commented 9 years ago

Status:

  1. I couldn't repro the hGetLine issue. I'm supposed to be passing the --yes flag? I meant to account for it if you can raise the issue.
  2. Looks like an issue with elm-make prepending JSON with a message. I have a solution for that. Reported upstream elm-lang/elm-make#38. Issue in mine wouldn't hurt.
  3. Thanks for making dnalot/elm-sublime#1. I think it's an initialization order thing. I'd seen it intermittently but your log clarified it.
deadfoxygrandpa commented 9 years ago

I just remembered this, and so I don't forget it I'll write it down. the --output /dev/null trick doesn't work on Windows, but I just tried --output NUL and that seems to work, so we should probably do it that way on Windows.

texastoland commented 9 years ago

I already did it. Don't merge yet though! I just rebased.

texastoland commented 9 years ago

@rtfeldman All issues should be fixed 🙏

vilterp commented 9 years ago

Is it possible to hyperlink from errors in the console to the code?

rtfeldman commented 9 years ago

That would be very nice, if possible!

On Thu, Aug 6, 2015, 12:05 PM Pete Vilter notifications@github.com wrote:

Is it possible to hyperlink from errors in the console to the code?

— Reply to this email directly or view it on GitHub https://github.com/deadfoxygrandpa/Elm.tmLanguage/pull/25#issuecomment-128475651 .

texastoland commented 9 years ago

Yes but I'm still evaluating how to do it with the least amount of code. Basically it's completely custom navigation. Report it in either repo and I'll tag it as a feature!

vilterp commented 9 years ago

Reported in your fork (issue 3)

texastoland commented 9 years ago

@deadfoxygrandpa This one's ready to merge. I'll open a separate PR for a ST3 error in existing code. Also looking into #28 if you can take #29?

deadfoxygrandpa commented 9 years ago

OK, I'll merge it in. Thanks a lot for all this work.