portal

pez 2022-12-14T08:30:11.709959Z

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

pez 2022-12-14T15:33:26.167039Z

Thomas Heller helped me fix this

pez 2022-12-14T16:10:30.706929Z

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

djblue 2022-12-14T16:16:33.568259Z

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

pez 2022-12-14T16:22:52.535509Z

It does! Thanks!

pez 2022-12-14T16:24:22.852309Z

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.

djblue 2022-12-14T16:28:47.061739Z

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.

skylize 2022-12-14T18:54:25.344279Z

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
})

skylize 2022-12-14T19:00:41.843119Z

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

djblue 2022-12-14T19:20:36.023429Z

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

skylize 2022-12-14T19:34:15.832969Z

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.

pez 2022-12-14T19:39:19.978539Z

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