In intelliJ/Eclipse is there away to never open files from bin or target or build? or warn? - eclipse

I just lost another 20 minutes because my IDE (sometimes I use IntelliJ, sometimes I use Eclipse) opened a file that was from the "bin, target, or build" folder... and I mistakenly thought it was from the src folder.
As I developer I almost always want the source code to look at, not build output artifacts... is there away to make the IDE either not present these as choices, or have it warn me visually that the file is not source (like surrounding the editor in a thick band of zebra stripped yellow and black lines? )

In IDEA output folders are excluded by default and are not visible in the Project View. Navigation to files from excluded folders also will not work. Double check that these folders are marked as Excluded in the Project Structure | Sources tab.

In Eclipse I use package explorer to navigate between source files, jsp, etc. It does not show any build/target/bin folders and there possibility to configure filters for it (Small down faced arrow next to titlebar)

Related

VSCode: open files related to a given project on a specific editor side

I am working on a vscode workspace, and in this workspace I have two separate projects that I need to constantly open files from one or the other. The explorer window on the left shows both projects, and were added using the Add folder to workspace... option if it's useful to know.
Now, since the projects have similar structure (both have an api.py file for example), I started keeping the open files from project1 on the left side of the editor, and I'm using the right side for project2. When I open a new file, it gets placed on the side of the screen that I have currently focused.
What I would like, is to know if there's an option to force files from project1 to stay on the left, and files from project2 to stay on the right.
The image below shows what I am trying to accomplish
This issue appears to be exactly on point:
Open files from folders in a fixed editor group.
Unfortunately, it was put on the backlog candidate list and didn't get the necessary votes and so was closed. So no built-in way to do this. Might be a good extension candidate.

How do I configure Eclipse and Maven to not duplicate folder listings?

Help me please. The problem I'm having is that in Eclipse In the Package Explorer, a Maven project that contains sub Maven projects displays duplicates of the same folders. In addition this causes the 'Ctrl + click' to not work.
So for example if you have a folder hierarchy, and almost each folder is another sub project, such as the following....
1/projectX-dev
2/projectX-dev/web-services
3/projectX-dev/web-services/mapping-data
4/projectX-dev/web-services/mapping-organizations
5/projectX-dev/web-services/metrixs
6/projectX-dev/web-services/metrixs/data-ingest
7/projectX-dev/web-services/metrixs/organization-feeds
Then in my package explorer I would have 7 listed items because each folder has its own .pom file. So for example expanding 5 it would contain the code that is also present in 6 & 7 because it is the parent folder which of course makes sense, but this is most annoying because now there are three locations where I can go to get at information where all I would want is for #1 to be displayed.
In addition to the layout annoyance, in Eclipse it seems that if I open a file under one of the listings over another then the 'Ctrl + click' to navigate to imported class methods no longer is supported. I am growing tired of this and need some clarification on how to just import the Maven projects and have it where the 'Ctrl + click' functions and the display in the Package Explorer would be 1/projectX-dev and that is it. I don't want all the other listings just the main parent folder.
As you can see in the image, the expanded folder netops-nice-jira-dev has items which are all listed at the top level as other projects. i.e. ui-extensions & web-services. The rest-service is a project also and it resides inside of the web-services project. So it is pissing me off how if I open a file from one location it allows for the proper interaction with the file such as Ctrl Click to track methods whereas with opening the file from another location it acts like a plain text file. 1 I don't want all these items to be duplicated in my view I just want the main top level project to be displayed and keep it simple to navigate down the structure rather than trying to find the proper place to open a file from.
Any suggestions on how to NOT display all the projects that are within the project?
The friggin previous people who put together this project created Eclipse projects within Eclipse project folders and everything was added to the Eclipse project view so things are all screwy.
If I open files from one project normal IDE functions will work, if I open the files from within one of the many other projects then the IDE functions don't work where i'm being told the project does not exist on the build path.
How frustrating!

Eclipse - different folder-/file colors per project

I'm looking for a way to optically mark different projects in the eclipse "Project Explorer".
From time to time I have to work with several opened projects, to copy files and folders from old to new projects. (I know it is possible to compare folders.. but it is not always the best way)
So it would be really convenient to apply a different color for the main project. E.g. having displayed the folders of that project in green instead of yellow - so this would avoid copy-pasting in the wrong 'direction'.
Any ideas? Or other tips?
Edit:
Added image
Eclipse isnt exploded make-up-bag :D
If you have your projects unter Version-Controll, you can specify custom file/folder/project-decorators with markant Text-Labels.
Therefore see Window->Preferences->Team->...->Label Decoration

Adding files to separate targets in Xcode 4

Since upgrading to xcode 4, I can't find where to specify what Target a resource belongs to. Previously, I selected the file and hit command+i, but this now seems to run the program, rather than bring up the info box for that file.
Select the project file in the document explorer. On the Right margin of the Xcode window make sure to display the right drawer view if it isn't already there (it usually has Object library and Quick Help). In the top margin, click on the icon that looks like a document (rather than the one with the waves that is quick help). The target membership and the other info from the old Get Info command is there.
Select the project file in the document explorer pane, select your target from the list, select the build phases tab and add/remove your resources in the copy bundle resources phase or source code in the compile sources phase.
Right click on a folder (eg. resource) on the document explorer (which is the left column with all your files and folders in your project), select Add Files to "Project Name". Below you will see check boxes that determine the file's association with each target.
#makdad - This also works for the 'blue folder' situation.
Note: if you already have a file in xcode, the only way you can add targets to a file that's in a 'blue folder' is to remove the file and follow the steps stated above.

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.