public interface SymbolProvider
Modifier and Type | Interface and Description |
---|---|
static class |
SymbolProvider.Context
Represents search context.
|
static class |
SymbolProvider.Result
Represents a collection of SymbolDescriptors that match
the given search criteria.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancel the current operation, if possible.
|
void |
cleanup()
The Go To Symbol dialog is dismissed for now - free up resources if applicable.
|
void |
computeSymbolNames(SymbolProvider.Context context,
SymbolProvider.Result result)
Compute a list of SymbolDescriptors that match the given search text for the given
search type.
|
String |
getDisplayName()
Describe this provider for the user, in case we want to offer filtering
capabilities in the Go To Symbol dialog
|
String |
name()
Describe this provider with an internal name, in case we want to provide
some kind of programmatic filtering
|
String name()
String getDisplayName()
void computeSymbolNames(SymbolProvider.Context context, SymbolProvider.Result result)
SymbolProvider.cancel()
on the same symbol provider during the operation, in which
case the method can return incomplete results. If there is a "current project",
the Go To Symbol infrastructure will perform the search in two passes; first it
will call SymbolDescriptor.getSymbolName()
with the current project, which should be a reasonably
fast search, and display those symbols first. It will then call the method again
with a null project, which should return all symbols.
Note that a useful performance optimization is for the SymbolProvider to cache
a few of its most recent search results, and if the next search (e.g. more user
keystrokes) is a simple narrowing of the search, just filter the previous search
result. There is an explicit SymbolProvider.cleanup()
call that the Go To Symbol dialog
will make at the end of the dialog interaction, which can be used to clean up the cache.
context
- search context containg search text and type, optionally projectresult
- filled with symbol descriptors and optional messagevoid cancel()
void cleanup()