Skip to content

Auto-link scripts within an explored object. - #140

Merged
Rider-Linden merged 1 commit into
developfrom
rider/dogfood
Sep 11, 2026
Merged

Auto-link scripts within an explored object.#140
Rider-Linden merged 1 commit into
developfrom
rider/dogfood

Conversation

@Rider-Linden

Copy link
Copy Markdown
Collaborator

An auto-link feature which links all files in an object with the corresponding files in the workspace.

Closes #137

…ith the corresponding files in the workspace.
Copilot AI lite review requested due to automatic review settings September 11, 2026 22:02

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

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 linkSlItem applies the no-modify check. This causes an unnecessary object.content.get for every no-modify item and turns a read failure into errors instead of skippedNoModify; 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 by getObjectList() directly to handlePublish() 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

  • autoLinkedObjectIds is 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 thread src/extension.ts
Comment on lines +134 to +138
async (node: ExplorerNode) => {
if (node.kind !== "object") {
return;
}
await synchService.autoLinkObject(node.object_id);
Comment thread src/synchservice.ts
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 thread src/synchservice.ts
Comment on lines +510 to +515
if (existingSync) {
return {
outcome: "already-linked",
masterUri: existingSync.getMasterUri(),
};
}
Comment thread src/synchservice.ts
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.`,
);
@Rider-Linden
Rider-Linden merged commit 77e058a into develop Sep 11, 2026
4 of 5 checks passed
Copilot stopped work on behalf of Rider-Linden due to an error September 11, 2026 22:19
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.

Option to autolink all files in an object

2 participants