From 34a0e2ea1d20fe071d68514b7f12974c21391437 Mon Sep 17 00:00:00 2001 From: "bobo.yang" Date: Thu, 26 Dec 2024 17:18:31 +0800 Subject: [PATCH 1/2] feat: Add extension version retrieval endpoint - Add new endpoint /get_extension_version to services registry - Implement version fetch from package.json using vscode API - Return undefined if extension is not found --- src/ide_services/services.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/ide_services/services.ts b/src/ide_services/services.ts index b137f9f..35a6bdf 100644 --- a/src/ide_services/services.ts +++ b/src/ide_services/services.ts @@ -18,6 +18,8 @@ import { getDiagnosticsInRange } from "./endpoints/documentRangeDiagnostics"; import { getExtensionToolsPath } from "./endpoints/getToolsPath"; import { getCollapsedCode } from "./endpoints/getCollapsedCode"; +import * as vscode from 'vscode'; + const functionRegistry: any = { /** * Official IDE Service Protocol Endpoints @@ -30,6 +32,19 @@ const functionRegistry: any = { keys: [], handler: getLocalServicePort, }, + "/get_extension_version": { + keys: [], + handler: () => { + // 从package.json中获取版本号 + const extension = vscode.extensions.all.find(ext => + ext.packageJSON.name === 'devchat' // 只匹配 name,不匹配 publisher + ); + if (extension) { + return extension.packageJSON.version; + } + return undefined; + } + }, "/install_python_env": { keys: ["command_name", "requirements_file"], handler: installPythonEnv, From 010301432d59568d4703cb0b4fdbc9253091c542 Mon Sep 17 00:00:00 2001 From: "bobo.yang" Date: Thu, 26 Dec 2024 17:18:49 +0800 Subject: [PATCH 2/2] update gui submodule --- gui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui b/gui index c883677..2f6f379 160000 --- a/gui +++ b/gui @@ -1 +1 @@ -Subproject commit c8836777f0d09ce1328166abec5cebc480a2590a +Subproject commit 2f6f379e917ace3d5a1dab1307c9446a08144d81