mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
add a registry option for Find in Path to drill into excluded dirs (IDEA-169299)
This commit is contained in:
@@ -38,6 +38,7 @@ import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.openapi.util.ProperTextRange;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VfsUtil;
|
||||
@@ -711,6 +712,11 @@ public class FindManagerTest extends DaemonAnalyzerTestCase {
|
||||
findModel.setProjectScope(false);
|
||||
findModel.setDirectoryName(excluded.getPath());
|
||||
assertSize(2, findUsages(findModel));
|
||||
|
||||
findModel.setDirectoryName(root.getPath());
|
||||
assertSize(0, findUsages(findModel));
|
||||
Registry.get("find.search.in.excluded.dirs").setValue(true, getTestRootDisposable());
|
||||
assertSize(2, findUsages(findModel));
|
||||
}
|
||||
|
||||
public void testFindInJavaDocs() {
|
||||
|
||||
@@ -317,7 +317,7 @@ class FindInProjectTask {
|
||||
}
|
||||
}
|
||||
else if (myDirectory != null) {
|
||||
final boolean checkExcluded = !ProjectFileIndex.SERVICE.getInstance(myProject).isExcluded(myDirectory);
|
||||
boolean checkExcluded = !ProjectFileIndex.SERVICE.getInstance(myProject).isExcluded(myDirectory) && !Registry.is("find.search.in.excluded.dirs");
|
||||
VirtualFileVisitor.Option limit = VirtualFileVisitor.limit(myFindModel.isWithSubdirectories() ? -1 : 1);
|
||||
VfsUtilCore.visitChildrenRecursively(myDirectory, new VirtualFileVisitor(limit) {
|
||||
@Override
|
||||
|
||||
@@ -347,6 +347,9 @@ ide.suggest.file.when.creating.filename.like.directory.description=When creating
|
||||
find.search.in.project.files=true
|
||||
find.search.in.project.files.description=Whether Find in Path searches in .idea, *.ipr, *.iml, *.iws files
|
||||
|
||||
find.search.in.excluded.dirs=false
|
||||
find.search.in.excluded.dirs.description=Whether Find in Path searches in excluded subdirectories of the scope directory
|
||||
|
||||
structureView.coalesceTime=500
|
||||
|
||||
keymap.show.alias.actions=false
|
||||
|
||||
@@ -207,6 +207,39 @@ public class RegistryValue {
|
||||
myChangedSinceStart = true;
|
||||
}
|
||||
|
||||
public void setValue(boolean value, Disposable parentDisposable) {
|
||||
final boolean prev = asBoolean();
|
||||
setValue(value);
|
||||
Disposer.register(parentDisposable, new Disposable() {
|
||||
@Override
|
||||
public void dispose() {
|
||||
setValue(prev);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void setValue(int value, Disposable parentDisposable) {
|
||||
final int prev = asInteger();
|
||||
setValue(value);
|
||||
Disposer.register(parentDisposable, new Disposable() {
|
||||
@Override
|
||||
public void dispose() {
|
||||
setValue(prev);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void setValue(String value, Disposable parentDisposable) {
|
||||
final String prev = asString();
|
||||
setValue(value);
|
||||
Disposer.register(parentDisposable, new Disposable() {
|
||||
@Override
|
||||
public void dispose() {
|
||||
setValue(prev);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
boolean isChangedSinceAppStart() {
|
||||
return myChangedSinceStart;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user