is there a way to have a line number with goto-definition? I found that it works nicely for files, but I couldn’t figure out line numbers were a thing there. From https://github.com/djblue/portal/blob/bf98fa0c4b11a5e27e0ece19480147c6da86b2ad/src/portal/runtime/jvm/editor.clj#L119-L130, I would not suspect such a thing, but I figured it wouldn’t hurt to ask 😄 (Also I might be looking at the wrong code)
Goto should work with file, line and column
There are a few ways to specify the info, but usually a map with that info is good enough
hmm when I press g d on
"/Users/stephan/Sources/foo/bar/factory_test.go"
I get to that tab in vscode, if I do the same on
"/Users/stephan/Sources/foo/bar/factory_test.go:31"
nothing happensoh ok that’s not a map
Currently, the code doesn't try to parse strings for that info
so I need
{"file": ..., "line": 31, "column": 0 }
?oh my it just works
🥳 thanks a lot
don’t even need "column": 0 (since I don’t have that info anyways)
If a value produces metadata that also looks like that (like vars) it will also work 👌
I’m currently pushing a JSON blob into /submit; how that would work with metadata is still beyond me
(I might have given it away already that I’m using this with Go 😅)
Yeah, it would need to be edn for metadata
That's pretty neat 👌
🤔 https://github.com/go-edn/edn maybe… maybe…
thanks again for your help!
Might also be cool to produce data for the log viewer 🤔
https://github.com/djblue/portal/blob/bf98fa0c4b11a5e27e0ece19480147c6da86b2ad/src/portal/ui/viewer/log.cljs#L65-L69? looks doable
(I had only looked at exception before and that was too specific)
how does symbol? look like in json?
I'll see about accepting something more json friendly 🤔
Although, it might be equally nice to provide a hook in the submit handler to transform data
I’m still getting into all this… so I won’t volunteer for a PR right away 😅 but I like it a lot, thanks for portal ✨