Merge pull request #601 from devchat-ai/feat/add-plugin-version-service

feat: Add extension version retrieval endpoint and update GUI submodule
This commit is contained in:
boob.yang 2024-12-26 17:53:30 +08:00 committed by GitHub
commit 341380c8c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 1 deletions

2
gui

@ -1 +1 @@
Subproject commit c8836777f0d09ce1328166abec5cebc480a2590a
Subproject commit 2f6f379e917ace3d5a1dab1307c9446a08144d81

View File

@ -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,