Publish object inventories to external editor. - #5834
Conversation
There was a problem hiding this comment.
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.
…perations publish, get, write, delete, and create. Still quite a few bugs to work out.
62fbacb to
3a4fed4
Compare
|
@copilot Ignore your previous review and rereview this PR from scratch. |
Fresh pass complete. The material issues I found are:
I did not see a relevant failure on |
| if (!LLScriptEditorWSServer::launchVSCode(root_id, mContainer->mItemUUID)) | ||
| { | ||
| LLNotificationsUtil::add("GenericAlert", | ||
| LLSD().with("MESSAGE", LLTrans::getString("VSCodeLaunchFailed"))); |
There was a problem hiding this comment.
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?
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