Is there any way to tell IntelliJ IDEA not to watch files during search / replace or during refactoring?

Basically my question is the topic ^

I have 4 files that are massive. I need to place them in resources as part of my maven project structure. Whenever I do string-based refactoring or search / replace ... I basically want the IDE to completely ignore these files.

Yes, I know that I can exclude them and manually replace them ... but, as I said, I want to remove any possibility that they can be changed via the IDE (without having to protect them from writing, I think, or return them all the time if version control says they have been changed).

Can these files be excluded?

+7
source share
3 answers

There are two questions:

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

You can customize the custom scope when searching and replacing. This custom area is saved, so you donโ€™t need to customize it every time you find and replace.

Open the search and replace window or the search box on the way, and you will see the scope section in the window with โ€œCustomโ€ as the last parameter. You can select the files you want to include / exclude here.

2) How to prevent file changes in the IDE without write protection

This I am not sure. You can add them to a separate changelist so that they are always grouped separately from the main changeset or add them to the vc ignore list. But this does not stop the IDE from modifying them. Perhaps you need to find out what is editing these files and stop this process?

+13
source

You can mark the directory as "Excluded" in "Project Structure โ†’ Modules"

enter image description here

+2
source

You can mark this directory as "Root Generated Sources Root"

0
source

All Articles