Merge pull request #374 from devchat-ai/update_ide_services

add new ide services
This commit is contained in:
boob.yang 2023-12-20 20:41:57 +08:00 committed by GitHub
commit 4944d48f8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,6 +30,39 @@ const functionRegistry: any = {
}
},
// eslint-disable-next-line @typescript-eslint/naming-convention
"/ide_language": {
"keys": [],
"handler": async () => {
const config = vscode.workspace.getConfiguration();
const language = config.get('workbench.editor.languageDetection') ? vscode.env.language : config.get('window.menuBarVisibility');
return language;
}
},
// eslint-disable-next-line @typescript-eslint/naming-convention
"/log_info": {
"keys": ["message"],
"handler": async (message: string) => {
logger.channel()?.info(message);
return true;
}
},
// eslint-disable-next-line @typescript-eslint/naming-convention
"/log_warn": {
"keys": ["message"],
"handler": async (message: string) => {
logger.channel()?.warn(message);
return true;
}
},
// eslint-disable-next-line @typescript-eslint/naming-convention
"/log_error": {
"keys": ["message"],
"handler": async (message: string) => {
logger.channel()?.error(message);
return true;
}
},
// eslint-disable-next-line @typescript-eslint/naming-convention
"/open_folder": {
"keys": ["folder"],
"handler": async (folder: string) => {