Skip to content

Share installed webR packages and attachment order with notebook language workers - #2009

Open
renkun-ken wants to merge 9 commits into
codex/webr-interactive-rich-viewersfrom
codex/webr-share-session-packages
Open

renkun-ken wants to merge 9 commits into
codex/webr-interactive-rich-viewersfrom
codex/webr-share-session-packages

Conversation

@renkun-ken

Copy link
Copy Markdown
Member

Summary

Give the language workers serving a webR Interactive session a read-only view of the actual installed packages and the session's package search order. On a settled cell the execution worker inventories .libPaths(); newly visible add-on packages are shared as digest-addressed, immutable Wasm filesystem images. This includes packages installed as WORKERFS mounts. Each notebook can see its own library while the execution worker is occupied. Ordinary project language clients keep their own context.

On desktop the detached agent publishes verified package images and an atomic catalogue scoped to its private session generation. On the web the extension host retains the corresponding immutable images for the owning notebook. Analysis mounts the files without downloading the packages again. Replacement or removal can require a fresh R namespace/DLL environment; in this case the extension restores open buffers and their current text versions before switching analysis workers.

This also uses the hover formatting and package-context API from languageserver #907. The code prefers a compatible published API. The release prerequisite to pin a Wasm build that exports it remains tracked in #2003.

Verification

  • Reproduced the original missing completions after installing data.table 1.18.6.1.
  • Verified library(data.t…), empty data.table:: and data.table::fread, unqualified completions after attachment, correct package masking, and disappearance after removal. Open documents survive language-worker replacement.
  • Exercised isolation between two notebooks and ordinary source files, reconnect/restart, and completion while execution was busy. No user workspace expressions are evaluated to derive the package catalogue.
  • Verified clean library() hover text, selected text copy and full-hover copy in desktop VS Code. The reported startIndex warning is from VS Code's notebook model; it did not recur in our copy tests.

Stacked on #2008. Tracks #2003.

… codex/webr-share-session-packages

# Conflicts:
#	src/webr/serverModules.json
… codex/webr-share-session-packages

# Conflicts:
#	src/languageService.ts
#	src/web/extension.ts
#	src/web/languageService.ts
#	src/webr/languageSession.ts

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant