Fork me on GitHub
#portal
<
2022-12-14
>
pez08:12:11

Having troubles setting up the nrepl middleware in my portal-shadow example project.

pez15:12:26

Thomas Heller helped me fix this

pez16:12:30

Can I open the file for some data that has file metadata? Like I have for evaluation results when using the nrepl middleware.

djblue16:12:33

Yeah, the goto-definition command should work on nrepl eval results

pez16:12:52

It does! Thanks!

pez16:12:22

Is it possible to make VS Code's keybinding work? I somehow thing it is, but it was a while since I did any webview work.

djblue16:12:47

Currently this isn't supported, but it would be nice to leverage vscode key bindings in portal, just not sure how to do so or what it would look like.

skylize18:12:25

Do we have access to the window or document of the WebView? Seems likely that standard browser semantics would come into play here.

window.addEventListener('keydown', event => {
  // handle event
})

skylize19:12:41

This looks promising for the case you want a keybinding to reach the WebView that would otherwise be captured by Code first. https://stackoverflow.com/questions/52142903/are-there-any-contexts-when-specified-webview-panel-is-active-in-vscode-extensio

djblue19:12:36

I think the issue here is more around allowing configuration of portal shortcuts via vscode

skylize19:12:15

That is what I was referring to though. Offering a possible direction of thought regarding "not sure how to do so or what it would look like." Portal is running in a WebView, right? Does VS Code offer a direct connection between VS Code shortcuts and behaviors in a WebView? I have no idea. If so, great! Work on that. But I suspect that a WebView is mostly its own little island. If so, it would likely require the same process of listening for and responding to a KeyboardEvent that you would use in a browser.

pez19:12:19

I think that this might be quite tricky. But maybe Portal can register a definition provider, for the goto-definition case.