-
Notifications
You must be signed in to change notification settings - Fork 274
Add Default IDE/Editor Integration #716
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Add Default IDE/Editor Integration #716
Conversation
| shell.openPath(item); | ||
| }); | ||
|
|
||
| async function checkCommandAvailable(command: string): Promise<boolean> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to put it in src/tools/process.ts
| }); | ||
| } | ||
|
|
||
| async function openInIde(path: string, isDirectory: boolean): Promise<void> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to put it in src/tools/ide.ts which doesn't exist yet.
This one I'll have to test on each platform. Is it an output from Claude?
| for (const ide of ideCommands) { | ||
| if (await checkCommandAvailable(ide.command)) { | ||
| const fullCommand = `${ide.command} "${normalizedPath}"`; | ||
| exec(fullCommand, (error) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using exec means the IDE process will be attached to the electron one (or am I wrong?)
If it is attached, I suggest to use node-pty in order to run the command outside of the current process like I did for VSCode so the IDE keeps opened even if the user closes the editor
|
|
||
| // On macOS, try JetBrains IDEs (PhpStorm, WebStorm, IntelliJ IDEA) | ||
| if (platform() === "darwin") { | ||
| exec(`open -a "PhpStorm" "${normalizedPath}"`, (error) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could use the same method than the part // Try each IDE in order in line 53
| { | ||
| type: "separator", | ||
| }, | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could replace "Open in Visual Studio"
|
|
||
| <ContextMenuItem className="flex items-center gap-2" onClick={() => ipcRenderer.send("editor:show-item", this.props.absolutePath)}> | ||
| <ImFinder className="w-4 h-4" /> {`Show in ${isDarwin ? "Finder" : "Explorer"}`} | ||
| {`Show in ${isDarwin ? "Finder" : "Explorer"}`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the import of "ImFinder " then to fix the lint issue
|
@bobicloudvision any news ? |
Summary
Adds "Open in Default IDE/Editor" across the editor, enabling users to open files and project directories in their preferred IDE or the system default editor. Implements detection for VS Code, Cursor, Sublime Text, PhpStorm, WebStorm, and IntelliJ IDEA, trying available options in priority order. Also updates double-click to open files in the default editor.
Changes Made
External Editor Support for Files
editor:open-withthat uses Electron'sshell.openPath()to respect OS file associationsDefault IDE Detection and Integration
UI Integration
Technical Implementation
openInIde()function inshell.tsthat detects file vs directory and handles each appropriatelycheckCommandAvailable()helper function to verify IDE command-line tools are installedopen -a) and Windows (CLI commands)Benefits