portal

Stephan Renatus 2023-03-25T19:31:38.290869Z

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)

✅ 1
djblue 2023-03-25T19:32:35.251599Z

Goto should work with file, line and column

djblue 2023-03-25T19:33:05.492209Z

There are a few ways to specify the info, but usually a map with that info is good enough

Stephan Renatus 2023-03-25T19:33:59.678259Z

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 happens

Stephan Renatus 2023-03-25T19:34:21.202259Z

oh ok that’s not a map

👍 1
djblue 2023-03-25T19:34:44.721939Z

Currently, the code doesn't try to parse strings for that info

Stephan Renatus 2023-03-25T19:34:52.760869Z

so I need

{"file": ..., "line": 31, "column": 0 }
?

👍 1
Stephan Renatus 2023-03-25T19:35:28.642739Z

oh my it just works

2
Stephan Renatus 2023-03-25T19:35:32.288989Z

🥳 thanks a lot

Stephan Renatus 2023-03-25T19:36:13.935379Z

don’t even need "column": 0 (since I don’t have that info anyways)

djblue 2023-03-25T19:36:27.119589Z

If a value produces metadata that also looks like that (like vars) it will also work 👌

Stephan Renatus 2023-03-25T19:37:02.743239Z

I’m currently pushing a JSON blob into /submit; how that would work with metadata is still beyond me

Stephan Renatus 2023-03-25T19:37:26.182989Z

(I might have given it away already that I’m using this with Go 😅)

🎉 1
djblue 2023-03-25T19:37:37.345179Z

Yeah, it would need to be edn for metadata

djblue 2023-03-25T19:38:03.205639Z

That's pretty neat 👌

Stephan Renatus 2023-03-25T19:38:04.940419Z

🤔 https://github.com/go-edn/edn maybe… maybe…

Stephan Renatus 2023-03-25T19:39:38.675669Z

thanks again for your help!

💯 1
djblue 2023-03-25T19:42:20.590849Z

Might also be cool to produce data for the log viewer 🤔

Stephan Renatus 2023-03-25T19:43:46.055919Z

(I had only looked at exception before and that was too specific)

Stephan Renatus 2023-03-25T19:45:17.136089Z

how does symbol? look like in json?

djblue 2023-03-25T19:46:18.483029Z

I'll see about accepting something more json friendly 🤔

djblue 2023-03-25T19:50:12.952779Z

Although, it might be equally nice to provide a hook in the submit handler to transform data

👍 1
Stephan Renatus 2023-03-25T20:02:11.611719Z

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

👍 1