IntelliJ: Autocopy folder content to an IntelliJ folder - intellij-idea

I have a question, which seemed easy at the beginning when I started working on it but I could not find an easy solution for it so far.
Is there a way to auto copy content from a folder to a current folder in my IntelliJ project?
Away from IntelliJ, this can be done programmatically; and I will need to add a file watcher to observe changes and apply them accordingly. Alternatively, I can create a scheduled task to do this.
However, I am inclined to avoid this as there must be an easy way to do this.

Related

How to remove non-project files from refactorings in Idea?

For some reason when I try to do a rename refactor, idea picks up code that is not even remotely close to my project. Furthermore, this code is read-only and I can't edit it! And Non-Project Access dialog is almost mockingly "ultimate" in its options: I can only choose whether I want to edit the non-project files this time or I want to do this ALWAYS. No option to skip these files altogether.
I tried to add these folders as a content root and exclude them - it didn't help. And I can't remove them, since they actually don't show up as files in the refactor preview (they are not referenced anywhere in the project view either), only {m} functions/method do with no option to remove them.
So the refactor rightfully fails because it can't edit RO files. So how would I solve this?

Why can't I rename package in intellij idea?

Why can't I change package name in intellij idea?
I want to change "java" package to something else, for example "junit" or "jtests":
But when I select Refactor -> Rename I wind up with the dialog window:
then I select Rename current, in the next window I enter desired package name:
and then, no matters whether I click Refactor or Preview button, nothing happens. Nothing at all: no errors, no warnings, no actions. Why can't I rename this package?
It seems to be a bug of IntelliJ IDEA. I found the solution on JetBrains forum. By invalidating the cache and restarting, I got the ability to rename this package.
For me invalidation didn't work. I made a new package and temporarily moved the classes out of the package I wanted to rename. It would disapear when I would rename them, so I would create them again.
Just a bug in intellij. Invalidate the caches and restart. Here's how, it's easy.
Only folders under java are part of the package qualified name.
Example:
If you have a file in a folder located under app/src/main/java/com/my/package then the package will be com.my.package
So, you only want to change folders under java.
However, regarding the "com" folder, the IDE does not provide an option to refactor package name. In this case, you need to manually rename all code occurrences of the old folder and invalidate the cache after renaming the folder.
File > Invalidate caches... > Clear system
For me it was due to memory problem, after increasing memory (heap size) it solved.

IntelliJ "File..." action is showing directories when I want it to just show files

I could swear that this wasn't the behavior on an older version. Is there any way to make it so the File... action only displays actual files, and not directories? It's incredibly frustrating to have to always be suggested a directory first instead of a file, since (in my opinion) jumping to a directory is totally useless - all it does is scroll you in the folder/projects view to that directory..
Edit: IntelliJ version is: IntelliJ IDEA 2017.3.2, Build #IU-173.4127.27.
As explained in comments on the Youtrack issue I opened, this is now intended behavior due to the directory being a better match than the file (case sensitivity).
This is resolved for me with these possible solutions:
Use Navigate > Class instead, as suggested by glytching. Works well for most purposes since it handles many languages just fine.
Type a . to ignore directories. This, for me, is easier to incorporate into muscle memory than hitting Shift to capitalize or hitting Up/Down to scroll around the list of suggestions.

MvcBuildViews and locating views

I have enabled MvcBuildViews task in my project file and I have found it finds and tries to build views that aren't in the project.
These views were totally out of date but not knowing whether to delete them or not from source I opted to relocate them (until I can find out) to a new folder called 'Obsolete'.
After relocating the view I try and build the project and it still somehow finds these views in the 'Obsolete' folder now.
How can I instruct the MvcBuildViews task to only compile views found in their usual search location and not everywhere in the project directory?
So after doing some more hunting I find that the MvcBuildViews uses the aspnet_compiler.exe under the hood. It appears the only solution if I want to hand pick the locations is to point it at the specific folders themselves. My other option is to move the views outside of the project.
http://msdn.microsoft.com/en-US/library/ms229863(v=vs.100).aspx

How to see a list of new non-version controlled files in IntelliJ

So I add new files to my project. At this point IntelliJ pops up a dialog asking me if I'd like to add these files to git/mercurial/svn etc.
I will always say No at this point because until I've fleshed the files out a little, perhaps got them to work with some context, perhaps decided to rename them, I'm not happy to add these new files to version control. Even if I can still rollback the 'add', I have to bare in mind the nuts and bolts of the underlying system. It's safer simply not to do it.
Now I'm ready to commit, I bring up the commit dialog box and the new files are nowhere to be found! If I go on a scouting expedition for them, I can add them individually from project files but this is error-prone.
How do I automatically get a list of all my new files which I previously delayed adding?
I found it, under the changes tab. I was looking for it only under the version control context menu from project files.