diff --git a/platform/lang-impl/src/com/intellij/find/findUsages/CustomUsageSearcher.java b/platform/lang-impl/src/com/intellij/find/findUsages/CustomUsageSearcher.java new file mode 100644 index 000000000000..61b2b5f6f291 --- /dev/null +++ b/platform/lang-impl/src/com/intellij/find/findUsages/CustomUsageSearcher.java @@ -0,0 +1,31 @@ +/* + * Copyright 2000-2011 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.intellij.find.findUsages; + +import com.intellij.openapi.extensions.ExtensionPointName; +import com.intellij.psi.PsiElement; +import com.intellij.usages.Usage; +import com.intellij.util.Processor; + +/** + * @author gregsh + */ +public abstract class CustomUsageSearcher { + public static final ExtensionPointName EP_NAME = ExtensionPointName.create("com.intellij.customUsageSearcher"); + + public abstract void processElementUsages(final PsiElement element, final Processor processor, final FindUsagesOptions options); +} diff --git a/platform/lang-impl/src/com/intellij/find/findUsages/FindUsagesManager.java b/platform/lang-impl/src/com/intellij/find/findUsages/FindUsagesManager.java index 5bff937c484d..8748875b854d 100644 --- a/platform/lang-impl/src/com/intellij/find/findUsages/FindUsagesManager.java +++ b/platform/lang-impl/src/com/intellij/find/findUsages/FindUsagesManager.java @@ -380,6 +380,14 @@ public class FindUsagesManager implements JDOMExternalizable { } }); handler.processElementUsages(element, usageInfoProcessor, options); + for (CustomUsageSearcher searcher : Extensions.getExtensions(CustomUsageSearcher.EP_NAME)) { + try { + searcher.processElementUsages(element, processor, options); + } + catch (Exception e) { + LOG.error(e); + } + } } Project project = ApplicationManager.getApplication().runReadAction(new Computable() { diff --git a/platform/platform-resources/src/META-INF/LangExtensionPoints.xml b/platform/platform-resources/src/META-INF/LangExtensionPoints.xml index 2f4573781ecf..6e15798e5d84 100644 --- a/platform/platform-resources/src/META-INF/LangExtensionPoints.xml +++ b/platform/platform-resources/src/META-INF/LangExtensionPoints.xml @@ -313,6 +313,7 @@ +