Add Default IDE/Editor Integration#716
Add Default IDE/Editor Integration#716bobicloudvision wants to merge 5 commits intoBabylonJS:masterfrom
Conversation
| shell.openPath(item); | ||
| }); | ||
|
|
||
| async function checkCommandAvailable(command: string): Promise<boolean> { |
There was a problem hiding this comment.
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.
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.
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.
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.
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.
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