majestic icon indicating copy to clipboard operation
majestic copied to clipboard

Support IntelliJ/WebStorm IDE

Open G-Rath opened this issue 4 years ago • 4 comments

While I have VSCode installed, I use IntelliJ/WebStorm for development.

IntelliJ supports being called from the command line, and will magically handle figuring out if it needs to open a new project or not, if it's already open.

i.e, from WSL I can do:

g-rath@CINDY:/c/Users/G-Rath$ idea64.exe "C:\Users\G-Rath\workspace\projects-personal\strongly-typed-event-emitter\test\src\index.spec.ts"

And it opens brings that project into focus, opening that file. (i.e when I've got multiple projects open, and it's in the background).

It would be cool if Majestic supported that - I'd be happy to be involved in a PR, but am pretty busy for the next couple of weeks so couldn't do it all by myself.

You could test for an .idea folder, or .iml file to determine if a folder should be opened using VSCode or IntelliJ.

G-Rath avatar Oct 24 '19 04:10 G-Rath

Hi @G-Rath ,

Majestic looks for an EDITOR value in path before assuming to open the file in code. What that means is, you can set your EDITOR path to Webstorm and clicking "Open in Editor" will open the file inside Webstorm.

rahulakrishna avatar Nov 01 '19 18:11 rahulakrishna

@rahulakrishna Why not add an option in the UI and store it in Local Storage. I am very against polluting my global PATH

TheJaredWilcurt avatar May 06 '20 19:05 TheJaredWilcurt

@TheJaredWilcurt , I did try using a package called env-editor to get a list of all locally installed editors and open it. It did not work reliably in my experience. However there seems to exist something called open-editor that may just work. Will try once more

rahulakrishna avatar May 08 '20 13:05 rahulakrishna

env-editor is used by open-editor, and from what I can see they only work on OSX.

Also many editors offer "portable" versions which will not be installed in the PATH or in a common "Program Files (x86)"-like location.

Even if you recursively scanned the entire hard drive and knew of the exact files you were looking for for every editor and could find them, often people have multiple editors installed, and there is no way to infer which one they would actually prefer to be the default.

I think auto-detecting (by hand or with a tool) is a cool idea and would allow you to more easily offer a list of options for the user to quickly pick from. But, ultimately you still need an option to pick the location of your editor manually. So that manual selection process should be included first (since it works for 100% of users), as a higher priority over any automated or guess-based approach (which only works for a portion of users).

TheJaredWilcurt avatar May 09 '20 12:05 TheJaredWilcurt