mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
fix: qwen vscode extension
This commit is contained in:
@@ -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(() => {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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]) {
|
||||
|
||||
Reference in New Issue
Block a user