Skip to content

Conversation

@lydell
Copy link
Contributor

@lydell lydell commented Jan 3, 2026

Via the UI source maps feature we already have a way to open files from the browser. This re-uses that feature to make error locations in compile error messages clickable.

I needed to adjust the open editor feature a little to be able to re-use it. I ended up cleaning up that feature quite a bit, making it more prepared for vanilla Elm app use-cases (where we shouldn’t assume that the only source directory is called src for example). Bonus improvements:

  • Now uses :: instead of List.append for performance. (Remember that we do this on every element attribute list.)
  • Now uses a property instead of an attribute, so we don’t clutter the browser devtools web inspector view.

Note: When building, you need to add something like the following to StaticFiles.hs to bust cache:

x :: ()
x = ()

Via the UI source maps feature we already have a way to open files from
the browser. This re-uses that feature to make error locations in
compile error messages clickable.

I needed to adjust the open editor feature a little to be able to re-use
it. I ended up cleaning up that feature quite a bit, making it more
prepared for vanilla Elm app use-cases (where we shouldn’t assume that
the only source directory is called `src` for example).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants