title |
---|
11. Find Usages Provider |
A FindUsagesProvider
uses a word scanner to build an index of words in every file.
A scanner breaks the text into words and defines the context for each word.
Reference: Find Usages
- bullet list {:toc}
The SimpleFindUsagesProvider
implements FindUsagesProvider
.
Using the DefaultWordsScanner
ensures the scanner implementation is thread-safe.
See the comments in FindUsagesProvider
for more information.
{% include /code_samples/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleFindUsagesProvider.java %}
The SimpleFindUsagesProvider
implementation is registered with the IntelliJ Platform in the plugin configuration file using the com.intellij.lang.findUsagesProvider
extension point.
<extensions defaultExtensionNs="com.intellij">
<lang.findUsagesProvider language="Simple"
implementationClass="org.intellij.sdk.language.SimpleFindUsagesProvider"/>
</extensions>
Rebuild the project, and run simple_language_plugin
in a Development Instance.
The IDE now supports Find Usages for any property with a reference: