canGetDeclaration

Determine whether there could be a declaration in the context. The
implementation of this method should be very fast, as it is called from
the event thread to enable or disable dependency-related actions.

getTopLevelDeclarations

Some languages have a hierarchy of declarations. Objects further down in
the hierarchy can only be accessed through these top-level declarations.
For example, methods in a Java class can only be referenced directly
through a reference to the Java class. Or columns in a database table
might only be referenced through a reference to the table. In those
cases, it is possible to search for all references to a Node by
searching only for the top-level declarations. This improves performance
compared to searching for every declaration in the Node.
Implementations that do not have such a declaration hierarchy can simply
call DeclarationProvider.getDeclarations(Context,Node).