Auto-link scripts within an explored object. - #140
Merged
Conversation
…ith the corresponding files in the workspace.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds bulk auto-linking for scripts and notecards in explored objects, with optional automatic linking on publish.
Changes:
- Adds native and webview “Link All” actions.
- Refactors synchronization for bulk, background linking.
- Adds configuration and user documentation.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/webview/explorer/explorer.ts |
Adds the webview object-menu action. |
src/vscode/objectexplorerwebview.ts |
Handles bulk-link requests. |
src/synchservice.ts |
Implements bulk linking and publish integration. |
src/interfaces/configinterface.ts |
Defines the auto-link configuration key. |
src/extension.ts |
Registers the auto-link command. |
package.json |
Contributes the command, menu, and setting. |
doc/USER_GUIDE.md |
Documents bulk and automatic linking. |
Suppressed comments (3)
src/synchservice.ts:587
- The bulk loop reads each item's virtual file before
linkSlItemapplies the no-modify check. This causes an unnecessaryobject.content.getfor every no-modify item and turns a read failure intoerrorsinstead ofskippedNoModify; apply the permission check before reading.
const content = Buffer.from(
await vscode.workspace.fs.readFile(uri),
).toString("utf-8");
src/synchservice.ts:703
- This is the only automatic-link trigger, but
syncPublishedObjects()feeds objects returned bygetObjectList()directly tohandlePublish()during handshake/reconnect, so those objects never reach this branch. With the setting enabled, already-published objects therefore remain unlinked after reconnect even though links are ephemeral; reuse the guarded trigger from both ingestion paths.
) {
this.autoLinkedObjectIds.add(objectId);
void this.autoLinkObject(objectId);
src/synchservice.ts:703
autoLinkedObjectIdsis cleared only when the connection closes; the unpublish handler does not remove this ID. If the same object is unpublished and explored again in the same connection, this guard remains false and auto-linking is skipped even though the old mappings were evicted. Remove the ID when handling unpublish.
this.autoLinkedObjectIds.add(objectId);
void this.autoLinkObject(objectId);
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+134
to
+138
| async (node: ExplorerNode) => { | ||
| if (node.kind !== "object") { | ||
| return; | ||
| } | ||
| await synchService.autoLinkObject(node.object_id); |
Comment on lines
+491
to
+495
| const masterDoc = await vscode.workspace.openTextDocument(masterUri); | ||
| const masterEditor = options.reveal | ||
| ? await vscode.window.showTextDocument(masterDoc, { preview: false }) | ||
| : undefined; | ||
| const sync = await this.getOrCreateSync(masterDoc, parsed.language); |
Comment on lines
+510
to
+515
| if (existingSync) { | ||
| return { | ||
| outcome: "already-linked", | ||
| masterUri: existingSync.getMasterUri(), | ||
| }; | ||
| } |
Comment on lines
+626
to
+630
| `Auto-link complete for ${entry.object.object_name}: ` + | ||
| `${summary.linked} linked, ${summary.alreadyLinked} already linked, ` + | ||
| `${summary.noMatch} not matched, ${summary.skippedNoModify} skipped ` + | ||
| `(no modify), ${summary.errors} errors, ${summary.mismatches} differing.`, | ||
| ); |
Copilot stopped work on behalf of
Rider-Linden due to an error
September 11, 2026 22:19
This was referenced Sep 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An auto-link feature which links all files in an object with the corresponding files in the workspace.
Closes #137