mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-28 01:07:49 +08:00
stub_indexes.md: more clarification, sample
This commit is contained in:
parent
053b2e9703
commit
97a513402b
@ -83,7 +83,7 @@ Stub index implementation classes are registered in the `com.intellij.stubIndex`
|
||||
To put data into an index, you implement the method `IStubElementType.indexStub()` ([example: `JavaClassElementType.indexStub()`](%gh-ic%/java/java-psi-impl/src/com/intellij/psi/impl/java/stubs/JavaClassElementType.java)).
|
||||
This method accepts an `IndexSink` as a parameter and puts in the index ID and the key for each index in which the element should be stored.
|
||||
|
||||
To access the data from an index, the following instance methods are used:
|
||||
To access the data from an index, the following instance methods are used on the singleton instance managed by the implementation:
|
||||
|
||||
* `AbstractStubIndex.getAllKeys()/processAllKeys()` returns the list of all keys (processes all keys) in the index for the specified project (for example, the list of all class names found in the project).
|
||||
|
||||
@ -91,6 +91,8 @@ To access the data from an index, the following instance methods are used:
|
||||
|
||||
* `AbstractStubIndex.get()` returns the collection of PSI elements corresponding to a certain key (for example, classes with the specified short name) in the specified scope.
|
||||
|
||||
**Example**: [`JavaAnnotationIndex`](%gh-ic%/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaAnnotationIndex.java)
|
||||
|
||||
## Related Forum Discussions
|
||||
|
||||
* [Lifecycle of stub creation](https://intellij-support.jetbrains.com/hc/en-us/community/posts/206121959-Lifecycle-of-stub-creation/comments/206143885)
|
||||
|
Loading…
x
Reference in New Issue
Block a user