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:
phreakocious
2026-01-08 13:49:05 -06:00
committed by GitHub
parent f8138262fa
commit fbfad06307
2 changed files with 21 additions and 2 deletions

View File

@@ -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', () => {

View File

@@ -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;
}