Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move notebook runtime URI fixing to the main-thread. (#4017)
Addresses #4016. Move the reviving of a URI to `ExtHostLanguageRuntime.$createLanguageRuntimeSession()` when starting a runtime. Fixes problem where sometimes the URI would get silently blown away by bad to-string conversion and then the runtime would not know where it was supposed to be running. Previously I added a URI "revival" step on the `JupyterKernel` code to deal with the fact that positron notebooks sometimes provide non-fully-formed URIs. Turns out this didn't actually work and just resulted in undefined variables due to the serialized URI-like object not having a`.toString()` method implemented. This caused the notebook to start from the vaunted `[Object object]` path. I thought it worked because in that scenario the kernel will still start, just at the project root path. The problems with this are immediately apparent when you try and run a notebook nested in a folder. Now we run `URI.revive()` in `ExtHostLanguageRuntime.$createLanguageRuntimeSession()` if there's a `notebookUri` present to convert from the serialized version back to a real URI. <!-- Thank you for submitting a pull request. If this is your first pull request you can find information about contributing here: * https://github.com/posit-dev/positron/blob/main/CONTRIBUTING.md We recommend synchronizing your branch with the latest changes in the main branch by either pulling or rebasing. --> <!-- Describe briefly what problem this pull request resolves, or what new feature it introduces. Include screenshots of any new or altered UI. Link to any GitHub issues but avoid "magic" keywords that will automatically close the issue. If there are any details about your approach that are unintuitive or you want to draw attention to, please describe them here. --> ### QA Notes The normal VSCode notebooks should be able to open resources relative to themselves. Like a csv with `pd.read_csv()`
- Loading branch information