How to remove target folders from IDEA? - scala

I am using IntelliJ IDEA for scala development, and I find it really annoying that whenever I try and search in the project it returns results from compiled files like things in my target folder or compiled twirl templates etc.
Is there a way to remove this from my search index?
Should they even be visible at all in my "Project" pane?

Right-click the directory in the project tool window and select Mark Directory as -> Excluded, then the find in path action will not show any results from it.
Then, you can deselect the "Show excluded files" option of the project tool window to completely hide the directory.

Related

Eclipse to IntelliJ transfer

I have copied my src package structure from eclipse to intellij and it makes this structure within src folder:
How do I make it dz1.drugi so I can one click expand all to my classes?
Another question is how to select default project folder as it is "workspace" at \Users\{Name} for eclipse. Right now, when I create new project like this:
it saves it without workspace (or projects folder) at \Users\{Name}.
Click on the cog icon at the top-right of the explorer view, and check the "Flatten packages" option.
That said, If you get used to keyboard shortcuts top open classes and files, and navigate through recently opened files, you'll quickly see that you'll amost never use the explorer view anymore.
Project view has an option to compact empty middle packages, enable it. You can also use Flatten packages option. Actually, your question is a duplicate of this one.
IntelliJ IDEA remembers the last location you've used when creating a new project. Once you want to create another project, the location one level upper of the previous project directory would be suggested. So, create a project in C:\Users\someuser\workspace\myproject1 and IDE will suggest C:\Users\someuser\workspace\myproject2 for your new myproject2.

Eclipse Exclude/Include

I'm new to eclipse. I was having a problem with one of my classes so instead of commenting the whole thing out, I right-clicked and clicked exclude. Now I don't know how to bring it back into the project. Wouldn't it make sense for there to be an "include" button right next to exclude? Thanks.
To see everything that is excluded, examine the whole build path in the UI with Project Properties' Build Path.
To access, Right-click on project, Choose Properties and select Java Build Path. You can now browse and remove any exclusions you no longer desire.
See this screenshot if it helps.

Is it possible to prevent Eclipse's indexer from presenting matches for `.class` files?

I'm working on a new Eclipse workspace and my setup is very simple:
My source folder is named src, my classes folder is named classes and I have in my classpath also the classes from the build on the server located under server_classes.
When I use the Find Type option in Eclipse it shows me the .java files under src and the .class files under server_classes.
Is there anyway to instruct it ton exclude those files by default? (I want to keep them in the classpath - just not run into them by mistake when looking for a particular class)
When you open the Open Type window (ctrl-shift-t), at the top right there is a little black triangle. Click on that and select "Select Working Set..."
You can then create your own working set that only includes your source directory.
Open the Search Dialogue by pressing Ctrl+H, and select the "Java Search" Tab. The "Search In" Section should be self describing.
If you don't see a "Java Search" Tab press the Customize button.

Filter Empty Directories in Package Explorer View

Is there a way in eclipse to filter/hide empty directory trees in the package explorer view?
This is different than filtering directories like '.svn' or maven's target, or filtering empty packages. It's more trying to clean up empty directories trees that show up as a result of filter rules.
Context- We have a generic project in our workspace that uses filters to ignore non text based files(mp3s, jpgs, etc). It allows us to quickly edit our files in eclipse. The problem is because of the filters there are a lot of empty folders present. If eclipse can ignore any empty folders due to filters it would make the project cleaner.
Update- I filed a bug report in eclipse's buzilla system for those that wish to have this feature:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=334052
In Eclipse SDK (I use 3.6.2), to hide empty folders in the "Package Explorer":
At the top-right of the Package Explorer view, there's a downward-pointing triangle. If you hover your mouse pointer over it you'll see "View Menu".
Click the "View Menu"
Selected "Filters"
Put a check next to "Empty Packages"
Click OK
now your empty folders don't show any more.
This doesn't seem to be possible and could make for a good bug report.
As bug 157336 (build output contains unnecessary empty directories) comments:
"foo/bar/" is treated as "foo/bar/**".
So, as I understand it foo/bar/** should exclude the content of the directory and foo/bar should additionally exclude the directory itself.
Meaning you might have to add every empty directory yourself to the Exclude list, which is not practical.
Another solution would be to give Mylyn a try and see if its task context switching could hide any folder you don't need in the current task for you.

what can I do to make display the bin folder on eclipse?

can anyone help me solve the issue that I have ?
in fact when I create a project on eclipse, the bin folder doesn't display and I am able to create a javadoc for my project. I need help please.
I don't know what the reason for your question but you can see the bin directory in Project Explorer (not Package Explorer). Here you click the triangle and select Customize View... and remove the click on Java output folders
To change this behaviour and hide the “.class” files you need to do the following.
Find your class output folder in the “Project explorer” window. This is usually called “bin” or “target” for Maven projects
Right-click this folder and click “Properties”
Tick the “Derived” checkbox and click “OK”
“.class” files will now be hidden in future.
Source: http://ayubmalik.co.uk/2011/12/hide-class-files-when-opening-a-type-or-resource-in-eclipse-ide/
If your Eclipse version doesn't allow you to show "Java Output Folders" as mentioned by nanda, then try the Navigator View (From the main menu: Window > Show View > Navigator). The Navigator View shows the bin folder.
Your question is a bit vague but try right clicking on the project and choosing build path, and see if the output directory for your java classes is set to bin. It may not appear in your unless you add some Java source code