Fix openFileInIDE to respect user's preferred editor#2730
Open
Fix openFileInIDE to respect user's preferred editor#2730
Conversation
The IPC handler was hardcoded to only check for VS Code and PhpStorm, ignoring the user's preferred editor preference. Now reads the preferred editor from user settings and falls back to the first installed editor from the supported editors list.
Tests cover: preferred editor usage, fallback to first installed editor, no editor available, site not found, file not found, priority order, and site-folder-first opening sequence.
Collaborator
📊 Performance Test ResultsComparing 79ab184 vs trunk site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
Use path.join() for file path assertions and mock winFindEditorPath so exec is called on Windows instead of falling back to shell.openExternal.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issues
Proposed Changes
The
openFileInIDEIPC handler was hardcoded to only check for VS Code and PhpStorm, ignoring the user's preferred editor setting configured in Settings > Preferences.This PR updates the handler to:
getUserEditor()supportedEditorConfigto get the correct URL scheme for the selected editorSUPPORTED_EDITORSpriority order) when no preference is setAll 8 supported editors (Antigravity, Cursor, VS Code, PhpStorm, Windsurf, WebStorm, Sublime Text, Zed) now work with the "open file in IDE" feature.
Testing Instructions
Apply this diff to test it:
npm startPre-merge Checklist