Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to tell IntelliJ IDEA not to look at files during a search/replace or during refactorings?

Basically my question is the topic ^

I have 4 files that are massive. I need to put them in resources under my maven project structure. Whenever I do a string-based refactoring or search/replace... I basically want the IDE to ignore these files altogether.

Yes, I know I can exclude them and do the replacements manually... but like I said, I want to remove any possibility that they can be modified through the IDE (without having to write-protect them I guess, or revert them all the time if the version control says they've been modified).

Is there any way I can exclude these files?

like image 731
egervari Avatar asked Apr 15 '11 21:04

egervari


2 Answers

There are two questions there:

1) How to exclude these files in string based refactoring such as search and replace

You can set up a custom scope when you do a find and replace. This custom scope is saved so you don't have to set it up every time you do a find and replace.

Open the find-and-replace window or the find-in-path window and you will see the scope section in the window with "Custom" as the last option. You can select the files that you want to include/exclude here.

2) How to prevent files from being modified in the IDE without write protecting them

This I'm not sure about. You can add them to a separate change list so that they will always be grouped away from your main set of changes or add them to the vc ignore list. But this doesn't stop the IDE from modifying them. Perhaps you should find out what is editing those files and stop that process?

like image 128
Rachel Avatar answered Nov 07 '22 17:11

Rachel


You can mark the directory as Excluded in "Project Structure->Modules"

enter image description here

like image 20
Ste Avatar answered Nov 07 '22 17:11

Ste