When I change the excluded directory it seems to automatically apply this to the other IDE as well.
It is expected. That's because the project settings are stored in the .idea
subfolder. All IDEA-based IDEs use the same .idea
settings format. So opening the same folder/project in different IDEs simply makes them use that already-made config (shared between IDEs).
Plus, both PhpStorm and WebStorm use the same module type ID (WEB_MODULE
) and can have only 1 module in total in a project. IntelliJ IDEA and some other IDEs (like PyCharm for example) can work with projects that can have more than one module and of different types.
Is there some way to keep this setting separate?
Yes, with the help of a small workaround: you need to store .idea
used by another IDE in another place. As simple as that.
The setup and steps:
- Lets assume that you have your project in
C:\Projects\MyProject
.
- Make a brand new empty project in another place, e.g.
C:\Projects\IDEProjectsStore\MyProject-frontend
. It will be used for a frontend.
- Go to
Settings/Preferences | Directories
and remove an existing Content Root (which will be C:\Projects\IDEProjectsStore\MyProject-frontend
from the previous step).
- Add new Content Root instead -- point to the actual project (
C:\Projects\MyProject
from step #1)
- Save and configure as needed.
What you will have now:
- This frontend project will now have its settings stored in
C:\Projects\IDEProjectsStore\MyProject-frontend\.idea
while another (original project with backend) will have them in C:\Projects\MyProject\.idea
.
- Projects (project-specific IDE settings) are stored in 2 separate places while they both use the same folder with the code.
Basically: a project in the IDE's eyes is an .idea
folder with a parent folder added as a Content Root by default. Our workaround keeps the second project in a different folder while sharing the same Content Root between them.
https://youtrack.jetbrains.com/issue/IDEA-170102/ -- that's a ticket that asks for a straightforward way of doing this.
I would like that backend
is marked as excluded when the project is opened in WebStorm and frontend
to be excluded when it is opened in PhpStorm.
Why do you need two IDEs for this?
In case if you do not know: PhpStorm = WebStorm + PHP + Database. You do not really need WebStorm here. Just install any missing plugins that come bundled with WebStorm.