use of com.intellij.framework.detection.DetectionExcludesConfiguration in project intellij-community by JetBrains.
the class FacetImporter method isFacetDetectionDisabled.
protected boolean isFacetDetectionDisabled(Project project) {
final DetectionExcludesConfiguration excludesConfiguration = DetectionExcludesConfiguration.getInstance(project);
final FrameworkType frameworkType = FrameworkDetectionUtil.findFrameworkTypeForFacetDetector(myFacetType);
if (frameworkType == null)
return false;
return excludesConfiguration.isExcludedFromDetection(frameworkType);
}
use of com.intellij.framework.detection.DetectionExcludesConfiguration in project intellij-community by JetBrains.
the class FrameworkDetectionManager method doRunDetection.
private void doRunDetection() {
Set<Integer> detectorsToProcess;
synchronized (myLock) {
detectorsToProcess = new HashSet<>(myDetectorsToProcess);
detectorsToProcess.addAll(myDetectorsToProcess);
myDetectorsToProcess.clear();
}
if (detectorsToProcess.isEmpty())
return;
if (LOG.isDebugEnabled()) {
LOG.debug("Starting framework detectors: " + detectorsToProcess);
}
final FileBasedIndex index = FileBasedIndex.getInstance();
List<DetectedFrameworkDescription> newDescriptions = new ArrayList<>();
List<DetectedFrameworkDescription> oldDescriptions = new ArrayList<>();
final DetectionExcludesConfiguration excludesConfiguration = DetectionExcludesConfiguration.getInstance(myProject);
for (Integer id : detectorsToProcess) {
final List<? extends DetectedFrameworkDescription> frameworks = runDetector(id, index, excludesConfiguration, true);
oldDescriptions.addAll(frameworks);
final Collection<? extends DetectedFrameworkDescription> updated = myDetectedFrameworksData.updateFrameworksList(id, frameworks);
newDescriptions.addAll(updated);
oldDescriptions.removeAll(updated);
if (LOG.isDebugEnabled()) {
LOG.debug(frameworks.size() + " frameworks detected, " + updated.size() + " changed");
}
}
Set<String> frameworkNames = new HashSet<>();
for (final DetectedFrameworkDescription description : FrameworkDetectionUtil.removeDisabled(newDescriptions, oldDescriptions)) {
frameworkNames.add(description.getDetector().getFrameworkType().getPresentableName());
}
if (!frameworkNames.isEmpty()) {
String names = StringUtil.join(frameworkNames, ", ");
final String text = ProjectBundle.message("framework.detected.info.text", names, frameworkNames.size());
FRAMEWORK_DETECTION_NOTIFICATION.createNotification("Frameworks detected", text, NotificationType.INFORMATION, new NotificationListener() {
@Override
public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
showSetupFrameworksDialog(notification);
}
}
}).notify(myProject);
}
}
use of com.intellij.framework.detection.DetectionExcludesConfiguration in project intellij-community by JetBrains.
the class FacetImporter method disableFacetAutodetection.
private void disableFacetAutodetection(Module module, IdeModifiableModelsProvider provider) {
if (!isDisableFacetAutodetection(module))
return;
final DetectionExcludesConfiguration excludesConfiguration = DetectionExcludesConfiguration.getInstance(module.getProject());
final FrameworkType frameworkType = FrameworkDetectionUtil.findFrameworkTypeForFacetDetector(myFacetType);
if (frameworkType != null) {
for (VirtualFile file : provider.getContentRoots(module)) {
excludesConfiguration.addExcludedFile(file, frameworkType);
}
}
}
use of com.intellij.framework.detection.DetectionExcludesConfiguration in project intellij-community by JetBrains.
the class FrameworkDetectionManager method getValidDetectedFrameworks.
private List<? extends DetectedFrameworkDescription> getValidDetectedFrameworks() {
final Set<Integer> detectors = myDetectedFrameworksData.getDetectorsForDetectedFrameworks();
List<DetectedFrameworkDescription> descriptions = new ArrayList<>();
final FileBasedIndex index = FileBasedIndex.getInstance();
final DetectionExcludesConfiguration excludesConfiguration = DetectionExcludesConfiguration.getInstance(myProject);
for (Integer id : detectors) {
final Collection<? extends DetectedFrameworkDescription> frameworks = runDetector(id, index, excludesConfiguration, false);
for (DetectedFrameworkDescription framework : frameworks) {
descriptions.add(framework);
}
}
return FrameworkDetectionUtil.removeDisabled(descriptions);
}
Aggregations