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:
commit
341380c8c4
2
gui
2
gui
@ -1 +1 @@
|
|||||||
Subproject commit c8836777f0d09ce1328166abec5cebc480a2590a
|
Subproject commit 2f6f379e917ace3d5a1dab1307c9446a08144d81
|
@ -18,6 +18,8 @@ import { getDiagnosticsInRange } from "./endpoints/documentRangeDiagnostics";
|
|||||||
import { getExtensionToolsPath } from "./endpoints/getToolsPath";
|
import { getExtensionToolsPath } from "./endpoints/getToolsPath";
|
||||||
import { getCollapsedCode } from "./endpoints/getCollapsedCode";
|
import { getCollapsedCode } from "./endpoints/getCollapsedCode";
|
||||||
|
|
||||||
|
import * as vscode from 'vscode';
|
||||||
|
|
||||||
const functionRegistry: any = {
|
const functionRegistry: any = {
|
||||||
/**
|
/**
|
||||||
* Official IDE Service Protocol Endpoints
|
* Official IDE Service Protocol Endpoints
|
||||||
@ -30,6 +32,19 @@ const functionRegistry: any = {
|
|||||||
keys: [],
|
keys: [],
|
||||||
handler: getLocalServicePort,
|
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": {
|
"/install_python_env": {
|
||||||
keys: ["command_name", "requirements_file"],
|
keys: ["command_name", "requirements_file"],
|
||||||
handler: installPythonEnv,
|
handler: installPythonEnv,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user