use of com.intellij.ide.util.TipAndTrickBean in project intellij-community by JetBrains.
the class IdeResourcesTestCase method testTipFilesPresent.
public void testTipFilesPresent() {
Collection<String> errors = ContainerUtil.newTreeSet();
TipAndTrickBean[] tips = TipAndTrickBean.EP_NAME.getExtensions();
assertNotEmpty(Arrays.asList(tips));
for (TipAndTrickBean tip : tips) {
URL url = ResourceUtil.getResource(tip.getPluginDescriptor().getPluginClassLoader(), "/tips/", tip.fileName);
if (url == null) {
errors.add(tip.fileName);
}
}
assertEquals(tips.length + " tips are checked, the following files are missing:\n" + StringUtil.join(errors, "\n"), 0, errors.size());
}
use of com.intellij.ide.util.TipAndTrickBean in project intellij-community by JetBrains.
the class IdeResourcesTestCase method testFeatureTipsRegistered.
public void testFeatureTipsRegistered() {
ProductivityFeaturesRegistry registry = ProductivityFeaturesRegistry.getInstance();
Set<String> ids = registry.getFeatureIds();
assertNotEmpty(ids);
Collection<String> errors = ContainerUtil.newTreeSet();
for (String id : ids) {
FeatureDescriptor descriptor = registry.getFeatureDescriptor(id);
TipAndTrickBean tip = TipAndTrickBean.findByFileName(descriptor.getTipFileName());
if (tip == null) {
errors.add("<tipAndTrick file=\"" + descriptor.getTipFileName() + "\" feature-id=\"" + id + "\"/>");
}
}
assertEquals("Register the following extensions:\n" + StringUtil.join(errors, "\n"), 0, errors.size());
}
use of com.intellij.ide.util.TipAndTrickBean in project intellij-community by JetBrains.
the class IdeResourcesTestCase method testTipFilesDuplicates.
public void testTipFilesDuplicates() {
Collection<String> errors = ContainerUtil.newTreeSet();
TipAndTrickBean[] tips = TipAndTrickBean.EP_NAME.getExtensions();
assertNotEmpty(Arrays.asList(tips));
Set<String> visited = ContainerUtil.newLinkedHashSet();
for (TipAndTrickBean tip : tips) {
if (!visited.add(tip.fileName)) {
errors.add(tip.fileName);
}
}
assertEquals("The following tip files are registered more than once:\n" + StringUtil.join(errors, "\n"), 0, errors.size());
}
use of com.intellij.ide.util.TipAndTrickBean in project intellij-community by JetBrains.
the class PyCharmEduInitialConfigurator method patchRootAreaExtensions.
private static void patchRootAreaExtensions() {
ExtensionsArea rootArea = Extensions.getArea(null);
rootArea.unregisterExtensionPoint("com.intellij.runLineMarkerContributor");
for (ToolWindowEP ep : Extensions.getExtensions(ToolWindowEP.EP_NAME)) {
if (ToolWindowId.FAVORITES_VIEW.equals(ep.id) || ToolWindowId.TODO_VIEW.equals(ep.id) || EventLog.LOG_TOOL_WINDOW_ID.equals(ep.id) || ToolWindowId.STRUCTURE_VIEW.equals(ep.id)) {
rootArea.getExtensionPoint(ToolWindowEP.EP_NAME).unregisterExtension(ep);
}
}
for (DirectoryProjectConfigurator ep : Extensions.getExtensions(DirectoryProjectConfigurator.EP_NAME)) {
if (ep instanceof PlatformProjectViewOpener) {
rootArea.getExtensionPoint(DirectoryProjectConfigurator.EP_NAME).unregisterExtension(ep);
}
}
// unregister unrelated tips
for (TipAndTrickBean tip : Extensions.getExtensions(TipAndTrickBean.EP_NAME)) {
if (UNRELATED_TIPS.contains(tip.fileName)) {
rootArea.getExtensionPoint(TipAndTrickBean.EP_NAME).unregisterExtension(tip);
}
}
for (IntentionActionBean ep : Extensions.getExtensions(IntentionManager.EP_INTENTION_ACTIONS)) {
if ("org.intellij.lang.regexp.intention.CheckRegExpIntentionAction".equals(ep.className)) {
rootArea.getExtensionPoint(IntentionManager.EP_INTENTION_ACTIONS).unregisterExtension(ep);
}
}
final ExtensionPoint<ProjectAttachProcessor> point = Extensions.getRootArea().getExtensionPoint(ProjectAttachProcessor.EP_NAME);
for (ProjectAttachProcessor attachProcessor : Extensions.getExtensions(ProjectAttachProcessor.EP_NAME)) {
point.unregisterExtension(attachProcessor);
}
}
Aggregations