* Register commands and view to use centralized ExtensionRegistryInfo Replace hardcoded package.json imports and string literals with a centralized ExtensionRegistryInfo object that provides extension name and command definitions. This improves maintainability and ensures consistency across the codebase. * update view id * Fix environment variable serialization in vite config Wrap all process.env values with JSON.stringify to ensure proper string serialization and prevent undefined values from breaking the build configuration.
27 lines
896 B
TypeScript
27 lines
896 B
TypeScript
import type { EmptyRequest } from "@shared/proto/cline/common"
|
|
import { Empty } from "@shared/proto/cline/common"
|
|
import * as vscode from "vscode"
|
|
import { ExtensionRegistryInfo } from "@/registry"
|
|
import { telemetryService } from "@/services/telemetry"
|
|
import type { Controller } from "../index"
|
|
|
|
/**
|
|
* Opens the Cline walkthrough in VSCode
|
|
* @param controller The controller instance
|
|
* @param request Empty request
|
|
* @returns Empty response
|
|
*/
|
|
export async function openWalkthrough(_controller: Controller, _request: EmptyRequest): Promise<Empty> {
|
|
try {
|
|
await vscode.commands.executeCommand(
|
|
"workbench.action.openWalkthrough",
|
|
`saoudrizwan.${ExtensionRegistryInfo.name}#ClineWalkthrough`,
|
|
)
|
|
telemetryService.captureButtonClick("webview_openWalkthrough")
|
|
return Empty.create({})
|
|
} catch (error) {
|
|
console.error(`Failed to open walkthrough: ${error}`)
|
|
throw error
|
|
}
|
|
}
|