mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
framework detection excludes: method extracted to API
This commit is contained in:
+2
@@ -33,4 +33,6 @@ public abstract class DetectionExcludesConfiguration {
|
||||
public abstract void addExcludedFramework(@NotNull FrameworkType type);
|
||||
public abstract void addExcludedFile(@NotNull VirtualFile file, @Nullable FrameworkType type);
|
||||
public abstract void addExcludedUrl(@NotNull String url, @Nullable FrameworkType type);
|
||||
|
||||
public abstract boolean isExcludedFromDetection(@NotNull VirtualFile file, @NotNull FrameworkType frameworkType);
|
||||
}
|
||||
|
||||
+9
@@ -134,6 +134,15 @@ public class DetectionExcludesConfigurationImpl extends DetectionExcludesConfigu
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isExcludedFromDetection(@NotNull VirtualFile file, @NotNull FrameworkType frameworkType) {
|
||||
ensureOldSettingsLoaded();
|
||||
if (myExcludedFrameworks.contains(frameworkType.getId())) {
|
||||
return true;
|
||||
}
|
||||
return isFileExcluded(file, frameworkType.getId());
|
||||
}
|
||||
|
||||
private boolean isFileExcluded(@NotNull VirtualFile file, @Nullable String typeId) {
|
||||
if (myExcludedFiles.containsKey(typeId) && isUnder(file, myExcludedFiles.get(typeId))) return true;
|
||||
return typeId != null && myExcludedFiles.containsKey(null) && isUnder(file, myExcludedFiles.get(null));
|
||||
|
||||
+1
-7
@@ -26,9 +26,6 @@ import com.intellij.testFramework.PlatformTestCase;
|
||||
import com.intellij.testFramework.PsiTestUtil;
|
||||
import com.intellij.testFramework.TempFiles;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author nik
|
||||
*/
|
||||
@@ -91,10 +88,7 @@ public class ConvertingOldDetectionExcludesTest extends PlatformTestCase {
|
||||
}
|
||||
|
||||
private boolean isFileExcluded(VirtualFile file) {
|
||||
final List<VirtualFile> files = new ArrayList<VirtualFile>();
|
||||
files.add(file);
|
||||
getNewConfiguration().removeExcluded(files, new MockFrameworkType(FRAMEWORK_ID));
|
||||
return files.isEmpty();
|
||||
return getNewConfiguration().isExcludedFromDetection(file, new MockFrameworkType(FRAMEWORK_ID));
|
||||
}
|
||||
|
||||
public void testConvert() {
|
||||
|
||||
Reference in New Issue
Block a user