mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
Introduce IDE mode installer (#4877)
This commit is contained in:
25
packages/core/src/ide/detect-ide.ts
Normal file
25
packages/core/src/ide/detect-ide.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
export enum DetectedIde {
|
||||
VSCode = 'vscode',
|
||||
}
|
||||
|
||||
export function getIdeDisplayName(ide: DetectedIde): string {
|
||||
switch (ide) {
|
||||
case DetectedIde.VSCode:
|
||||
return 'VSCode';
|
||||
default:
|
||||
throw new Error(`Unsupported IDE: ${ide}`);
|
||||
}
|
||||
}
|
||||
|
||||
export function detectIde(): DetectedIde | undefined {
|
||||
if (process.env.TERM_PROGRAM === 'vscode') {
|
||||
return DetectedIde.VSCode;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
Reference in New Issue
Block a user