mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-10 22:21:22 -07:00
feat: add native Sublime Text support to IDE detection (#16083)
Co-authored-by: phreakocious <567063+phreakocious@users.noreply.github.com>
This commit is contained in:
@@ -114,6 +114,18 @@ describe('detectIde', () => {
|
||||
vi.stubEnv('ANTIGRAVITY_CLI_ALIAS', 'agy');
|
||||
expect(detectIde(ideProcessInfo)).toBe(IDE_DEFINITIONS.antigravity);
|
||||
});
|
||||
|
||||
it('should detect Sublime Text', () => {
|
||||
vi.stubEnv('TERM_PROGRAM', 'sublime');
|
||||
vi.stubEnv('ANTIGRAVITY_CLI_ALIAS', '');
|
||||
expect(detectIde(ideProcessInfo)).toBe(IDE_DEFINITIONS.sublimetext);
|
||||
});
|
||||
|
||||
it('should prioritize Antigravity over Sublime Text', () => {
|
||||
vi.stubEnv('TERM_PROGRAM', 'sublime');
|
||||
vi.stubEnv('ANTIGRAVITY_CLI_ALIAS', 'agy');
|
||||
expect(detectIde(ideProcessInfo)).toBe(IDE_DEFINITIONS.antigravity);
|
||||
});
|
||||
});
|
||||
|
||||
describe('detectIde with ideInfoFromFile', () => {
|
||||
|
||||
@@ -15,6 +15,7 @@ export const IDE_DEFINITIONS = {
|
||||
vscode: { name: 'vscode', displayName: 'VS Code' },
|
||||
vscodefork: { name: 'vscodefork', displayName: 'IDE' },
|
||||
antigravity: { name: 'antigravity', displayName: 'Antigravity' },
|
||||
sublimetext: { name: 'sublimetext', displayName: 'Sublime Text' },
|
||||
} as const;
|
||||
|
||||
export interface IdeInfo {
|
||||
@@ -51,6 +52,9 @@ export function detectIdeFromEnv(): IdeInfo {
|
||||
if (process.env['MONOSPACE_ENV']) {
|
||||
return IDE_DEFINITIONS.firebasestudio;
|
||||
}
|
||||
if (process.env['TERM_PROGRAM'] === 'sublime') {
|
||||
return IDE_DEFINITIONS.sublimetext;
|
||||
}
|
||||
return IDE_DEFINITIONS.vscode;
|
||||
}
|
||||
|
||||
@@ -87,8 +91,11 @@ export function detectIde(
|
||||
};
|
||||
}
|
||||
|
||||
// Only VSCode-based integrations are currently supported.
|
||||
if (process.env['TERM_PROGRAM'] !== 'vscode') {
|
||||
// Only VS Code and Sublime Text integrations are currently supported.
|
||||
if (
|
||||
process.env['TERM_PROGRAM'] !== 'vscode' &&
|
||||
process.env['TERM_PROGRAM'] !== 'sublime'
|
||||
) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user