Running WebStorm (personal subscription) and IntelliJ CE side by side?

Hello,

I am working on a web project where I use IntelliJ to edit the Java, and I would like to use WebStorm for the non-java bits.

I am noticing a few issues ...

Setup: I have the same project open in both apps.

Firstly, I noticed that IntelliJ was having issues with running a debug configuration (it was thinking there was another config process running).

Secondly, when I went to edit a JS file in WebStorm, the program said "file does not belong to project ..." (not exact wording).

Thirdly, when I opened IntelliJ, it opened with the current file I had open in WebStorm (like, it was sharing prefs).

With all that said, going under the assumption that there are some preference collisions happening, is there a recommended way to run both apps without having them collide?

I have to use a web editor for non-java assets as IntelliJ CE doesn't have that built-in, and I can only afford a WebStorm subscription.

Thanks!

9 comments

Idea-based IDEs (IDEA, WebStorm, RubyMine, PHPStorm, PyCharm) have the same project format (.idea) but different settings/module types that aren't always compatible. So sharing .idea folder may results in losing your settings, etc.


If you like to work on the same sources in different IDEs, I'd suggest sharing the sources folder(s) but keeping the .idea folders separated: just create a new empty WebStorm project and add your sources root as additional content root in Preferences | Directories, Add content root

1

Interesting! I will give that a try!

I have it on my list to play with content roots as it's a feature I have not used yet.

Thanks for the help Elena, you rock!

I'll test that feature out today and report back my results.

Thanks!

0

Ok, I think I have it setup correctly.

WebStorm preferences:

Project view:

To summarize: In the above case, the new project created a content root located in ~/WebstormProjects/ap-site (which has it's own WebStorm .idea directory) and I added ~/dev/.../ap-site as an "Additional Content Root" (the project/.idea directory that IntelliJ is using).

This seems like a decent workaround for sharing projects between IntelliJ and WebStorm.

Questions:

  1. Other than looking at the project’s preferences, how do I know which directory is an "additional content root" and which is the (for lack of a better word) "primary" content root? I named them both the same ... Maybe I should have named one "ap-site-content-root" or "ap-site-webstorm"?
  2. Based on my screenshots above, does it look like I have things setup properly?

Side note/observation:

I noticed the default directory for newly-created WebStorm projects is: "~/WebstormProjects" … For consistency's/branding's sake, shouldn’t that be "~/WebStormProjects"? :) (I'm sure I can set this somewhere in the IDE ... Aha! Preferences > Appearance & Behavior > System Settings > Project Opening: Default directory)

Thanks for reading!

0

>Other than looking at the project’s preferences, how do I know which directory is an "additional content root" and which is the (for lack of a better word) "primary" content root?

there are no 'primary' and 'secondary' roots... And WebStorm shows a path next to each root in the Project toolwindow so that you can see what folder it is

>Based on my screenshots above, does it look like I have things setup properly?

Yes, your setup looks OK

1

> there are no 'primary' and 'secondary' roots... And WebStorm shows a path next to each root in the Project toolwindow so that you can see what folder it is

Interesting! Thank you for clarifying. :)

I think I need to read more about this feature to understand it better ... I hope I am not wasting your time here ... I do really appreciate your time and assistance, it's very helpful and illuminating.

Question:

With my setup using multiple content roots, which content root does WebStorm use for storing project-specific prefs (i.e. the .idea directory)? My assumption was, it was the "new" blank project that was created in ~/WebstormProjects/<project-name>?

Essentially, the reason why I assumed there was a "primary" content root is: I am thinking of this "new" blank project as the main project (which contains the .idea for the current WebStorm window's prefs) and the additional content root .idea (i.e. the IntelliJ project) are unaffected by what I do in WebStorm?

I guess what I'm asking is, if there is no primary content root, then what project does the current WebStorm window’s .idea/ prefs get stored?

Thank you so much for the help. I hope that my questions/this thread will help future readers (like me) new to WebStorm and additional content roots. :)

0

Interestingly, I just noticed an "untitled" directory show up in my ~/WebstormProjects/ directory.

I had deleted it about 10 mins ago, and it showed up again. It's last modified time was from a few minutes ago.

> I guess what I'm asking is, if there is no primary content root, then what project does the current WebStorm window’s .idea/ prefs get stored?

Maybe this untitled directory is the directory that is used to store the .idea prefs?

I do have a couple of WebStorm windows open for two projects with multiple content roots setup.

0

>With my setup using multiple content roots, which content root does WebStorm use for storing project-specific prefs (i.e. the .idea directory)? My assumption was, it was the "new" blank project that was created in ~/WebstormProjects/<project-name>?

yes:)

>I am thinking of this "new" blank project as the main project (which contains the .idea for the current WebStorm window's prefs) and the additional content root .idea (i.e. the IntelliJ project) are unaffected by what I do in WebStorm?

only .idea folder located in the project root is respected, .idea folders in nested directories/other content roots are ignored.

 

> if there is no primary content root, then what project does the current WebStorm window’s .idea/ prefs get stored?

it's a folder you choose in file selector dialog when opening the project. It is called a project root folder.

Each WebStorm project is a directory with .idea folder in its root. All files located in this directory and subdirectories belong to project, as well as files from external folders linked to it as content roots.

 

1

> it's a folder you choose in file selector dialog when opening the project. It is called a project root folder.

Ahhh, ok, so "project root" vs. "content root"... That makes sense now!

I also just found out which window the "untitled" project was being created by. I just deleted and recreated the project and now everything is good.

I also just discovered these menu options:

  • File > Rename Project…
  • File > Open Project > Manage Projects…

Cool! I think I understand now.

To summarize:

If you want to have WebStorm, IntelliJ, PHPStorm, etc. (idea-based apps) to share the same project, you can utilize "empty" projects (which are considered to be the "project root") and then add additional "content roots" to house the desired project(s) inside of this "empty" project. Doing this will allow each idea IDE have it's own .idea directory without risking collisions between apps. Only .idea directory at the root of the project is used, all others are ignored; this is why adding projects as additional "content roots" to the "empty" "project root" works, as the "project root" has it's own, root-level .idea directory, and ignores the child "content root" .idea directories.

Phew!

Ok, this is cool!

WebStorm is pretty awesome. Thanks so much for your help Elena! I REALLY appreciate you taking the time to guide me through this.

I will be spreading the word about WebStorm. This program is so much better than any other IDE/editor that I have used to date.

Have a great day!!!!

1

I also wanted to note, in WebStorm, it looks like if you want GIT changes to be show in the project sidebar, you have to do this:

  1. File > Preferences… > Version Control
  2. Click on any of the "Unregistered roots"
  3. Click "+" icon to register

Now, additional content roots will show/track GIT modifications in terms of file colors.

0

Please sign in to leave a comment.