Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/ipc-types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ interface StartedSiteDetails extends StoppedSiteDetails {
type SiteDetails = StartedSiteDetails | StoppedSiteDetails;

type InstalledApps = {
antigravity: boolean;
vscode: boolean;
phpstorm: boolean;
webstorm: boolean;
windsurf: boolean;
cursor: boolean;
sublime: boolean;
zed: boolean;
terminal: boolean;
iterm: boolean;
warp: boolean;
Expand Down
9 changes: 9 additions & 0 deletions src/lib/is-installed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,30 +39,38 @@ function getLocalProgramsPath(): string {
// Define installation paths for each IDE by platform
const installationPaths: Record< string, PlatformPaths > = {
darwin: {
antigravity: [ 'Antigravity.app' ],
vscode: [ 'Visual Studio Code.app' ],
phpstorm: [ 'PhpStorm.app' ],
cursor: [ 'Cursor.app' ],
windsurf: [ 'Windsurf.app' ],
webstorm: [ 'WebStorm.app' ],
sublime: [ 'Sublime Text.app' ],
zed: [ 'Zed.app' ],
iterm: [ 'iTerm.app' ],
terminal: [ 'Terminal.app' ],
warp: [ 'Warp.app' ],
ghostty: [ 'Ghostty.app' ],
},
linux: {
antigravity: [ '/usr/bin/antigravity' ],
vscode: [ '/usr/bin/code' ],
phpstorm: [ '/usr/bin/phpstorm' ],
cursor: [ '/usr/bin/cursor' ],
windsurf: [ '/usr/bin/windsurf' ],
webstorm: [ '/usr/bin/webstorm' ],
sublime: [ '/usr/bin/subl' ],
zed: [ '/usr/bin/zed' ],
iterm: [],
terminal: [],
warp: [ '/usr/bin/warp' ],
ghostty: [],
},
win32: {
antigravity: [
path.win32.join( getLocalProgramsPath(), 'Antigravity' ),
path.win32.join( getProgramFilesPath(), 'Google\\Antigravity' ),
],
vscode: [
path.win32.join( getProgramFilesPath(), 'Microsoft VS Code' ),
path.win32.join( getLocalProgramsPath(), 'Microsoft VS Code' ),
Expand All @@ -88,6 +96,7 @@ const installationPaths: Record< string, PlatformPaths > = {
path.win32.join( getProgramFilesPath(), 'Sublime Text 4' ),
path.win32.join( getProgramFilesPath(), 'Sublime Text 3' ),
],
zed: [ path.win32.join( getLocalProgramsPath(), 'Zed' ) ],
iterm: [],
terminal: [],
warp: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,14 @@ describe( 'TerminalPicker', () => {
store.dispatch(
installedAppsApi.util.updateQueryData( 'getInstalledApps', undefined, () => {
return {
antigravity: false,
vscode: false,
phpstorm: false,
webstorm: false,
windsurf: false,
cursor: false,
sublime: false,
zed: false,
terminal: true,
iterm: true,
warp: false,
Expand All @@ -77,12 +79,14 @@ describe( 'TerminalPicker', () => {
installedAppsApi.util.updateQueryData( 'getInstalledApps', undefined, () => {
return {
// Editor properties
antigravity: false,
vscode: false,
phpstorm: false,
webstorm: false,
windsurf: false,
cursor: false,
sublime: false,
zed: false,
// Terminal properties
terminal: true,
iterm: true,
Expand Down
19 changes: 19 additions & 0 deletions src/modules/user-settings/lib/editor.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { __ } from '@wordpress/i18n';

export const SUPPORTED_EDITORS = [
'antigravity',
'cursor',
'vscode',
'phpstorm',
'windsurf',
'webstorm',
'sublime',
'zed',
] as const;
export type SupportedEditor = ( typeof SUPPORTED_EDITORS )[ number ];

Expand All @@ -18,6 +20,16 @@ export type SupportedEditorConfig = {
};

export const supportedEditorConfig: Record< SupportedEditor, SupportedEditorConfig > = {
antigravity: {
// translators: "Antigravity" is the brand name for an IDE and does not need to be translated
label: __( 'Antigravity' ),
url: ( path: string ) => `antigravity://file/${ path }?windowId=_blank`,
macOSBundleId: 'com.google.antigravity',
winPaths: [
'%LOCALAPPDATA%\\Programs\\Antigravity\\Antigravity.exe',
'%PROGRAMFILES%\\Google\\Antigravity\\Antigravity.exe',
],
},
vscode: {
// translators: "VS Code" is the brand name for an IDE and does not need to be translated
label: __( 'VS Code' ),
Expand Down Expand Up @@ -80,4 +92,11 @@ export const supportedEditorConfig: Record< SupportedEditor, SupportedEditorConf
'%PROGRAMFILES%\\Sublime Text 3\\sublime_text.exe',
],
},
zed: {
// translators: "Zed" is the brand name for an IDE and does not need to be translated
label: __( 'Zed' ),
url: ( path: string ) => `zed://file/${ path }`,
macOSBundleId: 'dev.zed.Zed',
winPaths: [ '%LOCALAPPDATA%\\Programs\\Zed\\zed.exe' ],
},
};
2 changes: 2 additions & 0 deletions src/modules/user-settings/lib/ipc-handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ import { loadUserData, updateAppdata } from 'src/storage/user-data';

export function getInstalledAppsAndTerminals(): InstalledApps {
return {
antigravity: isInstalled( 'antigravity' ),
vscode: isInstalled( 'vscode' ),
phpstorm: isInstalled( 'phpstorm' ),
webstorm: isInstalled( 'webstorm' ),
windsurf: isInstalled( 'windsurf' ),
cursor: isInstalled( 'cursor' ),
sublime: isInstalled( 'sublime' ),
zed: isInstalled( 'zed' ),
terminal: true, // Terminal.app is always available on macOS
iterm: isInstalled( 'iterm' ),
warp: isInstalled( 'warp' ),
Expand Down
15 changes: 12 additions & 3 deletions src/stores/tests/installed-apps-api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,14 @@ const createTestStore = () => {
const createMockInstalledApps = (
installedApps: Partial< InstalledApps > = {}
): InstalledApps => ( {
antigravity: false,
vscode: false,
phpstorm: false,
webstorm: false,
windsurf: false,
cursor: false,
sublime: false,
zed: false,
terminal: false,
iterm: false,
warp: false,
Expand Down Expand Up @@ -220,17 +222,24 @@ describe( 'Installed Apps API', () => {
const mockInstalledApps = createMockInstalledApps( { vscode: true, cursor: true } );
const result = selectUninstalledEditors( mockInstalledApps );

expect( result ).toHaveLength( 4 );
expect( result ).toHaveLength( 6 );
expect( result.map( ( [ editor ] ) => editor ) ).toEqual(
expect.arrayContaining( [ 'phpstorm', 'windsurf', 'webstorm', 'sublime' ] )
expect.arrayContaining( [
'antigravity',
'phpstorm',
'windsurf',
'webstorm',
'sublime',
'zed',
] )
);
} );

it( 'should return all editors when none are installed', () => {
const mockInstalledApps = createMockInstalledApps();
const result = selectUninstalledEditors( mockInstalledApps );

expect( result ).toHaveLength( 6 );
expect( result ).toHaveLength( 8 );
} );
} );

Expand Down