Closed ajhager closed 8 years ago
Interesting! That might not be too tough, and it covers a ton of typical cases!
I have a PR 99% ready for this issue and elm-lang/package.elm-lang.org#35, but it involves minor changes to elm-compiler, elm-package, elm-make, and package.elm-lang.org, so I will coordinate that after work.
Just wanted to mention in case someone else was thinking of working on it soon.
Any word on this? I'm gonna try to get 0.16 out in the next week and this seems like a nice thing to add.
And should the format of the location be more precise? Like { "file": "src/Html.elm", "start": 110, "end": 113 }
or something? It feels like a pain to have to parse apart something like src/Html.elm#110-113
unless the intent was for it to go directly to github. I imagine people wanting to use this in editors too though.
And is there any reason to include column information here? I kind of feel like there is not, but I'm not certain.
Tracking from meta issue #98
getting line number [start - to] would be awesome. Allows showing code inline/popup in editors.
This is used in, for example, the golang docs to link to the original source files. This could also be used by other tooling for 'jump to definition'.
My suggestion is the
source
entry in the example docs json below, or something like it: