Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions packages/vscode-extension/src/commands/indexCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ import * as vscode from 'vscode';
import { Context } from '@zilliz/claude-context-core';
import * as path from 'path';

/** Progress callback parameter type */
interface ProgressInfo {
phase: string;
current: number;
total: number;
percentage: number;
}

export class IndexCommand {
private context: Context;

Expand Down Expand Up @@ -66,7 +74,7 @@ export class IndexCommand {
// Clear existing index first
await this.context.clearIndex(
selectedFolder.uri.fsPath,
(progressInfo) => {
(progressInfo: ProgressInfo) => {
// Clear index progress is usually fast, just show the message
progress.report({ increment: 0, message: progressInfo.phase });
}
Expand All @@ -85,7 +93,7 @@ export class IndexCommand {
// Start indexing with progress callback
indexStats = await this.context.indexCodebase(
selectedFolder.uri.fsPath,
(progressInfo) => {
(progressInfo: ProgressInfo) => {
// Calculate increment from last reported percentage
const increment = progressInfo.percentage - lastPercentage;
lastPercentage = progressInfo.percentage;
Expand Down Expand Up @@ -156,7 +164,7 @@ export class IndexCommand {
}, async (progress) => {
await this.context.clearIndex(
workspaceFolders[0].uri.fsPath,
(progressInfo) => {
(progressInfo: ProgressInfo) => {
progress.report({
increment: progressInfo.percentage,
message: progressInfo.phase
Expand Down
10 changes: 9 additions & 1 deletion packages/vscode-extension/src/commands/syncCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ import * as vscode from 'vscode';
import { Context } from '@zilliz/claude-context-core';
import * as fs from 'fs';

/** Progress callback parameter type */
interface ProgressInfo {
phase: string;
current: number;
total: number;
percentage: number;
}

export class SyncCommand {
private context: Context;
private isSyncing: boolean = false;
Expand Down Expand Up @@ -59,7 +67,7 @@ export class SyncCommand {
try {
syncStats = await this.context.reindexByChange(
codebasePath,
(progressInfo) => {
(progressInfo: ProgressInfo) => {
const increment = progressInfo.percentage;
progress.report({
increment: increment,
Expand Down