rundis / elm-light

Elm language plugin for Light Table
https://rundis.gitbooks.io/elm-light-guide/content/
MIT License
133 stars 10 forks source link

elm-lang.org connection and windows debug #10

Closed kosir closed 8 years ago

kosir commented 8 years ago

Hi, sorry to use this as help forum. I probably deleted elm-lang.org connection and I don't know how to add it back (as seen on the video). I can connect to my project, but connection to http://elm-lang-org is not shown. I also miss a lot of docs (I can find just some of them). Also, at home I use windows (7 and 10), and debug is not working. At work I use ubuntu and debug is working fine. I use latest version as for today is 0.3.2. Thanks in advance for any reply. But I must say that your plugin is beautiful thing, thank you so much!!!

kosir commented 8 years ago

Oh I figured that out... If I open http://elm-lang.org in browser, this connection is automatically added. I can also report some other observations: lint on ubuntu just underline text and code completion not working good on ubuntu, also inline docs not working at all on ubuntu with CTRL+D (on windows yes). Can I make a suggestion? It would be more convenient for me if inline docs would work like this: when cursor is on function name -> keyboard shotcut -> open documentation for that function (not inline).

Next, when I save file and run ELM: View current elm file in browser (elm-reactor) and if page was already opened in browser, browser doesn't refresh page, so I must refresh it manually. It would be great if page would be refreshed.

Again, thank you so much for this plugin!!! It helped me to make my first steps with elm in a simple and user friendly way.

rundis commented 8 years ago

No worries ! It's not like the issue tracker is swamped with issues. Glad to see that people are using it :-)

Ubuntu: I just tested on Ubuntu 14,04 with the latest version of the plugin.

Future advice for issue submission:

cheers Magnus

rundis commented 8 years ago

Sorry. A bit premature to close the issue without giving you a chance to respond :-)

kosir commented 8 years ago

Thank you for such an exhaustive answer! You can close it now :) Thanks again for fantastic plugin!

mordrax commented 8 years ago

I might be a bit late to the show, but since @kosir showed me how to connect to elm-lang again :) here's my auto-browser refresh scripts.

In LT's user.keymap do something like this [:editor.elm "ctrl-s" :save :elm-format :clear-console :elm.make-project :elm.lint] the elm.make-project is the one you want. I also lint on save, and clear the console so don't get stale errors.

You need something like this in your elm-package.json: "make-info": {"main": "src/main.elm", "out": "dist/js/cotw.js"},

Then you can just use browser-sync to refresh your browser like this:

// I have it in a script dev.sh
elm-reactor &
http-server dist &
browser-sync start --proxy "localhost:8080" --files "dist/js/cotw.js" &
browser-sync start --proxy "localhost:8000" --files "**/*.elm" &

This starts the reactor on 8000 and the last line watches elm files and refreshes port 8000 whenever there are changes to any elm files.

It also kicks off a simple http-server serving up a directory (in my case, my dist dir). This has a simple index.html with some external CSS and references my elm.js output. So I watch this file (mine is named cotw.js) and refresh 8080 whenever this file changes.

This means that I can go to localhost:8000 and watch for any compile errors if elm-light or the linter isn't refreshed. And I can go to localhost:8080 to see my elm script embedded in a webpage.

Hope this helps.