I have the same directory structure in all my projects.
I would just like to exclude the same directories every time, instead of choosing each directory for every project and having to select Mark Directory as -> Excluded
For Example:
bower-components/, node-modules, etc...
Is that possible? I couldn't find that option.
Thanks!
Settings | Editor | File Types | Files and folders to ignore
(Note that applying it to node-modules might not be the best idea because if you do this, the JS support in IntelliJ IDEA will not see any declarations in any of the node modules that you use, so you'll lose on code completion and navigation support.)
Related
I have a Git repo with two directories:
backend (PHP/Laravel code)
frontend (TypeScript/Vue code)
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.
This is to ensure that searches/indexing only happen for the files that I would actually edit in that specific IDE.
When I change the excluded directory it seems to automatically apply this to the other IDE as well. Is there some way to keep this setting separate?
Comments:
I intentionally have both frontend and backend in one repository.
Opening the subdirectories in their own IDEA projects does not seem
to be an option because the Git integration only works when the
project is in the root folder of the repository.
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.
When I create a new file in IntelliJ IDEA, it gets automatically ignored by Subversion, no matter what, and it is impossible to commit the file. While in Spring Tool Suite all I need to do is right click and select Team>Add to version control in order to commit that new file. I have try several approaches with no success since many options are disabled.
When I create a new file in IntelliJ IDEA, it gets automatically ignored by Subversion
What do you mean by automatically? There is no any automatic rules - file is either configured as ignored, or not. Make sure there is no svn:ignore property set on the folder (probably not since other tools work).
Also, make sure nothing wrong is added to Settings | Version Control | Ignored Files. The description looks like you have the entire project or sources folder added there as ignored
Finally I found a solution: the problem was that a parent directory was being ignored by SVN, so I searched directory by directory starting with the current directory until I found a parent directory that had a configuration to ignore all directories, for this task I used tortoise, just right click and select TortoiseSVN>Properties look for ignored files and delete the directory you want to synchronize, if no you donĀ“t find the directory look for (*).
I've 2 projects in PhpStorm: one is working well while another won't work and I can't figure what make the first one working.
The first one is working well with library root for bower, npm and composer :
The second one is bower, npm are not detected as library root :
So the behaviour in PhpStorm is different, when I use the navigate file on second project, I see all the vendor file by default :
If I mark the directory as excluded, the ide don't understand the vendor class :
So how can we configure the IDE to mark a directory as library root ?
Thanks to #LazyOne comment, found the solution : Select Preferences | Languages & Frameworks | JavaScript | Libraries and click Add. Select the path you want to add and the folder will be marked as library root. Really useful for non standard path (not bower_components for example)
Found a solution that worked for me.
I opened the .idea folder (in sublime), searched all files for the text node_modules and removed the lines containing it.
In my case I had 2 entries
workspace.xml
<property name="ts.external.directory.path" value="$PROJECT_DIR$/node_modules/typescript/lib" />
project-name.iml
<content url="file://$MODULE_DIR$/node_modules" />
Now my node_modules directory is automatically marked as library root again
File > Settings > Directories
Remove any node_modules entries (right-hand side, x's)
Thank you to #Allisone for providing the manual solution.
Based on their response, I was able to replicate the solution using the settings.
As suggested here I managed to hide from my project list all *.o and *.lo files (e.g. myprogram.o) on CLion. Is there a way to hide also executable files (e.g. myprogram) without having to type down all their names? Maybe a wildcard?
Yes, you can use wildcards in Settings | Editor | File Types, ignore files and folders.
I'm using IntelliJ with Gulp (with the babel and sourecemap plugins) to help me transpile my source ES6 to ES5. What is the best way to mark these generated files?
They are being sent into a seperate dist folder but I want them to behave in the following way:
I don't want them to show up in usage/code search
I want their changes to be detected by the integrated source control
I have tagged them as excluded but I read in IntelliJ's docs that this will prevent the folder from being watched for changes. Anyone have a good way of doing this?
Excluding the dist folder via Mark directory as/Excluded is the right way to go: files in excluded folders are not indexed/show up in usage/code search, but they can be version controlled, so both your requirements are fulfilled.