Skip to content

Publish object inventories to external editor. - #5834

Merged
Rider-Linden merged 12 commits into
project/lua_editorfrom
rider/poc/object_publish
Jul 23, 2026
Merged

Publish object inventories to external editor.#5834
Rider-Linden merged 12 commits into
project/lua_editorfrom
rider/poc/object_publish

Conversation

@Rider-Linden

@Rider-Linden Rider-Linden commented May 19, 2026

Copy link
Copy Markdown
Contributor

Description

This is very much a work in progress.

This PR adds a set of commands to the JSON-RPC editor websocket that allow an external editor to read the contents of an object in world, read and write scripts and notecards in that object. Child prims in a linkset are treated as directories.

The feature is enabled via a debug variable for "tight editor integration"


Related plugin PR:
secondlife/sl-vscode-plugin#69

Checklist

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This WIP PR extends the external-editor WebSocket/JSON-RPC integration to support “tight” VS Code launching and publishing in-world object inventories (scripts/notecards) for an external editor to browse and edit.

Changes:

  • Add JSON-RPC methods for object inventory publish/update plus item content get/save and item create/delete, and add VS Code launch helpers.
  • Introduce async JSON-RPC method handling (coroutine-based) and improve WebSocket shutdown behavior by closing all connections on server stop.
  • Update viewer UI behavior/settings/strings and expand the JSON-RPC documentation to cover object content publishing and VS Code launch URIs.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
indra/newview/skins/default/xui/en/strings.xml Adds user-facing error strings for WebSocket server start and VS Code launch failures.
indra/newview/llscripteditorws.h Expands the script editor WS server interface to include object publishing/content APIs and VS Code launch helpers.
indra/newview/llscripteditorws.cpp Implements object inventory publishing, content read/write, item create/delete, prim inventory listeners, and VS Code launching.
indra/newview/llpreviewscript.cpp Routes “Edit in External Editor” through tight VS Code integration when enabled; refactors server startup via ensureServerRunning().
indra/newview/app_settings/settings.xml Adds ExternalEditorTightIntegration debug setting.
indra/llcorehttp/llwebsocketmgr.h Adds WSConnection::getSelfPtr() and WSServer::closeAllConnections().
indra/llcorehttp/llwebsocketmgr.cpp Closes all WS connections during server stop; implements getSelfPtr() and closeAllConnections().
indra/llcorehttp/lljsonrpcws.h Adds registerAsyncMethod() and storage for async handlers.
indra/llcorehttp/lljsonrpcws.cpp Dispatches async JSON-RPC methods via main-thread task + LLCoros coroutine and sends responses on completion.
doc/external-editor-json-rpc.md Updates/extends protocol docs to include VS Code launch URI and object content publishing interfaces.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread indra/newview/llscripteditorws.cpp
Comment thread indra/llcorehttp/lljsonrpcws.cpp
Comment thread indra/newview/llscripteditorws.cpp Outdated
Comment thread indra/newview/llscripteditorws.cpp
Comment thread doc/external-editor-json-rpc.md Outdated
Comment thread doc/external-editor-json-rpc.md
Comment thread doc/external-editor-json-rpc.md
@Rider-Linden
Rider-Linden force-pushed the rider/poc/object_publish branch from 62fbacb to 3a4fed4 Compare July 3, 2026 16:49
@Rider-Linden Rider-Linden changed the title [WIP] Publish object inventories to external editor. Publish object inventories to external editor. Jul 21, 2026
@Rider-Linden
Rider-Linden marked this pull request as ready for review July 21, 2026 18:57
@Rider-Linden

Copy link
Copy Markdown
Contributor Author

@copilot Ignore your previous review and rereview this PR from scratch.

Copilot AI commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

@copilot Ignore your previous review and rereview this PR from scratch.

Fresh pass complete. The material issues I found are:

  1. indra/newview/llscripteditorws.cpp: WebSocket callbacks are mutating viewer state from the background I/O thread.
  2. indra/newview/llscripteditorws.cpp: object.content.save still rejects empty content.
  3. indra/newview/llscripteditorws.cpp: linked prim descriptions are not preserved/updated in later publish refreshes and updates.
  4. indra/newview/llscripteditorws.cpp / doc/external-editor-json-rpc.md: child inventory object.update payloads do not match the documented schema.

I did not see a relevant failure on project/lua_editor; its recent PR checks are passing, and the current branch Build run is still in progress.

Comment thread indra/newview/llfloaterscripting.cpp Outdated
Comment thread indra/newview/llpanelcontents.cpp Outdated
Comment thread indra/newview/llpanelcontents.cpp Outdated
Comment thread indra/newview/llpanelcontents.cpp Outdated
Comment thread indra/newview/llpanelcontents.cpp Outdated
if (!LLScriptEditorWSServer::launchVSCode(root_id, mContainer->mItemUUID))
{
LLNotificationsUtil::add("GenericAlert",
LLSD().with("MESSAGE", LLTrans::getString("VSCodeLaunchFailed")));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be a good idea to provide more details. launchVSCode seems to provide more detailed errors, so may be make it generate the notification if some 'show_notification' bool was set as true?

Comment thread indra/newview/llscripteditorws.cpp Outdated
Comment thread indra/newview/llscripteditorws.cpp
Comment thread indra/newview/llviewerobject.cpp Outdated
@Rider-Linden
Rider-Linden merged commit a6a2f98 into project/lua_editor Jul 23, 2026
16 checks passed
@Rider-Linden
Rider-Linden deleted the rider/poc/object_publish branch July 23, 2026 00:41
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants