Skip to content
This repository was archived by the owner on Sep 23, 2025. It is now read-only.

Commit 2f2853c

Browse files
committed
tweak data that is generated to be self-describing
1 parent da609f1 commit 2f2853c

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

extension/src/extension.ts

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ interface PresentWalkthroughPayload {
6767
base_uri: string;
6868
}
6969

70-
type WalkthroughElement =
70+
type WalkthroughElement =
7171
| string // ResolvedMarkdownElement (now serialized as plain string)
7272
| { comment: ResolvedComment }
7373
| { files: FileChange[] } // GitDiffElement - named field serializes as {"files": [...]}
@@ -267,23 +267,23 @@ export class DaemonClient implements vscode.Disposable {
267267
if (message.type === 'present_walkthrough') {
268268
try {
269269
const walkthroughPayload = message.payload as PresentWalkthroughPayload;
270-
270+
271271
this.outputChannel.appendLine(`Received walkthrough with base_uri: ${walkthroughPayload.base_uri}`);
272272
this.outputChannel.appendLine(`Walkthrough sections: ${Object.keys(walkthroughPayload).filter(k => k !== 'base_uri' && walkthroughPayload[k as keyof PresentWalkthroughPayload]).join(', ')}`);
273-
273+
274274
// Set base URI for file resolution
275275
if (walkthroughPayload.base_uri) {
276276
this.walkthroughProvider.setBaseUri(walkthroughPayload.base_uri);
277277
}
278-
278+
279279
// Show walkthrough in webview
280280
this.walkthroughProvider.showWalkthrough({
281281
introduction: walkthroughPayload.introduction,
282282
highlights: walkthroughPayload.highlights,
283283
changes: walkthroughPayload.changes,
284284
actions: walkthroughPayload.actions
285285
});
286-
286+
287287
// Send success response back through daemon
288288
this.sendResponse(message.id, { success: true });
289289
} catch (error) {
@@ -960,7 +960,7 @@ export function activate(context: vscode.ExtensionContext) {
960960
// 💡: Set up daemon client connection for message bus communication
961961
const daemonClient = new DaemonClient(context, outputChannel, syntheticPRProvider, walkthroughProvider);
962962
bus.setDaemonClient(daemonClient);
963-
963+
964964
daemonClient.start();
965965

966966
// Set up comment callback to send comments as feedback
@@ -999,7 +999,7 @@ export function activate(context: vscode.ExtensionContext) {
999999
// 💡: Set up universal selection detection for interactive code review
10001000
function setupSelectionDetection(bus: Bus): void {
10011001
const { context, outputChannel } = bus;
1002-
1002+
10031003
outputChannel.appendLine('Setting up universal selection detection...');
10041004

10051005
// 💡: Track current selection state
@@ -1068,9 +1068,12 @@ function setupSelectionDetection(bus: Bus): void {
10681068
try {
10691069
const relativePath = vscode.workspace.asRelativePath(filePath);
10701070
const referenceData = {
1071-
file: relativePath,
1072-
line: startLine,
1073-
selection: selectedText.length > 0 ? selectedText : undefined
1071+
relativePath: relativePath,
1072+
selectionRange: {
1073+
start: { line: startLine, column: startColumn },
1074+
end: { line: endLine, column: endColumn }
1075+
},
1076+
selectedText: selectedText,
10741077
};
10751078

10761079
await bus.sendToActiveTerminal(referenceData);
@@ -1266,7 +1269,7 @@ async function createCompactSelectionReference(
12661269
try {
12671270
const relativePath = vscode.workspace.asRelativePath(filePath);
12681271
const referenceId = crypto.randomUUID();
1269-
1272+
12701273
// Create reference data matching the expected format
12711274
const referenceData = {
12721275
file: relativePath,
@@ -1276,11 +1279,11 @@ async function createCompactSelectionReference(
12761279

12771280
// Store the reference using the bus
12781281
await bus.sendReferenceToActiveShell(referenceId, referenceData);
1279-
1282+
12801283
// Return compact reference tag
12811284
const compactRef = `<ssref id="${referenceId}"/>\n\n`;
12821285
bus.log(`Created compact reference ${referenceId} for ${relativePath}:${startLine}`);
1283-
1286+
12841287
return compactRef;
12851288
} catch (error) {
12861289
bus.log(`Failed to create compact reference: ${error}`);

0 commit comments

Comments
 (0)