fix: qwen vscode extension

This commit is contained in:
tanzhenxin
2025-08-19 18:20:40 +08:00
parent a19db16485
commit 303b6999f4
14 changed files with 72 additions and 70 deletions

View File

@@ -1093,7 +1093,7 @@ describe('loadCliConfig ideModeFeature', () => {
vi.mocked(os.homedir).mockReturnValue('/mock/home/user');
process.env.GEMINI_API_KEY = 'test-api-key';
delete process.env.SANDBOX;
delete process.env.GEMINI_CLI_IDE_SERVER_PORT;
delete process.env.QWEN_CODE_IDE_SERVER_PORT;
});
afterEach(() => {

View File

@@ -10,7 +10,8 @@ import * as path from 'path';
import * as os from 'os';
export const EXTENSIONS_DIRECTORY_NAME = path.join('.qwen', 'extensions');
export const EXTENSIONS_CONFIG_FILENAME = 'gemini-extension.json';
export const EXTENSIONS_CONFIG_FILENAME = 'qwen-extension.json';
export const EXTENSIONS_CONFIG_FILENAME_OLD = 'gemini-extension.json';
export interface Extension {
path: string;
@@ -68,12 +69,19 @@ function loadExtension(extensionDir: string): Extension | null {
return null;
}
const configFilePath = path.join(extensionDir, EXTENSIONS_CONFIG_FILENAME);
let configFilePath = path.join(extensionDir, EXTENSIONS_CONFIG_FILENAME);
if (!fs.existsSync(configFilePath)) {
console.error(
`Warning: extension directory ${extensionDir} does not contain a config file ${configFilePath}.`,
const oldConfigFilePath = path.join(
extensionDir,
EXTENSIONS_CONFIG_FILENAME_OLD,
);
return null;
if (!fs.existsSync(oldConfigFilePath)) {
console.error(
`Warning: extension directory ${extensionDir} does not contain a config file ${configFilePath}.`,
);
return null;
}
configFilePath = oldConfigFilePath;
}
try {

View File

@@ -631,8 +631,8 @@ export async function start_sandbox(
// Pass through IDE mode environment variables
for (const envVar of [
'GEMINI_CLI_IDE_SERVER_PORT',
'GEMINI_CLI_IDE_WORKSPACE_PATH',
'QWEN_CODE_IDE_SERVER_PORT',
'QWEN_CODE_IDE_WORKSPACE_PATH',
'TERM_PROGRAM',
]) {
if (process.env[envVar]) {