Skip to content

Add support for IDE installed in user's home directory - #1125

Merged
wojtekn merged 1 commit into
trunkfrom
add/support-for-ide-installed-in-user-dir
Mar 27, 2025
Merged

Add support for IDE installed in user's home directory#1125
wojtekn merged 1 commit into
trunkfrom
add/support-for-ide-installed-in-user-dir

Conversation

@wojtekn

@wojtekn wojtekn commented Mar 25, 2025

Copy link
Copy Markdown
Contributor

Related issues

Proposed Changes

Currently, Studio only checks for VS Code and PHPStorm in the system-wide /Applications directory. This change adds support for detecting these apps in the user's ~/Applications directory as well.

Testing Instructions

  1. Install VS Code or PHPStorm in your user's Applications folder (~/Applications)
  2. Verify that Studio detects the app in the user's Applications folder
  3. Verify that Studio still detects apps in the system-wide /Applications folder
  4. Verify that the detection still works on Windows

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
@wojtekn
wojtekn requested a review from a team March 25, 2025 14:46
@wojtekn wojtekn self-assigned this Mar 25, 2025

@ivan-ottinger ivan-ottinger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good and work as expected. 👌🏼

I have tested the PR with PHPStorm on macOS and Studio picked it up correctly in both locations (user's ~/Applications and system-wide /Applications).

@sejas sejas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the change. I confirm I was able to open VSCode and PHP Storm in MacOS.
This PR doesn't change the way we open the app using deep links: 👍

studio/src/ipc-handlers.ts

Lines 1097 to 1104 in 17e5b6e

if ( isInstalled( 'vscode' ) ) {
// Open site first to ensure the file is opened within the site context
await shell.openExternal( `vscode://file/${ server.details.path }?windowId=_blank` );
await shell.openExternal( `vscode://file/${ path }` );
} else if ( isInstalled( 'phpstorm' ) ) {
// Open site first to ensure the file is opened within the site context
await shell.openExternal( `phpstorm://open?file=${ path }` );
}

@wojtekn

wojtekn commented Mar 27, 2025

Copy link
Copy Markdown
Contributor Author

Thanks for reviewing and testing @ivan-ottinger and @sejas .

This PR doesn't change the way we open the app using deep links: 👍

Correct, it only changes the part that checks if apps are installed. The rest is unchanged and relies on deep links.

@wojtekn
wojtekn merged commit 3fe1f6b into trunk Mar 27, 2025
@wojtekn
wojtekn deleted the add/support-for-ide-installed-in-user-dir branch March 27, 2025 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants