[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.technology.dltk] Re: unable to find method declarations

Hi Chuck,

DLTK Indexer uses structure parser to report types, method, fields, etc and references into index.

The we search we use MatchLocator and MatchLocator parser to match and report AST nodes. For method declaration search
MethodLocator class are used to match for pattern.

Could you please put breakpoints to following places:enterMethod

For indexing check:
1) SourceIndexerRequestor.enterMethod(MethodInfo methodInfo)
This method will be called then we index module and report keys into index.
You could also check here for references.

Then we search using Search( For example from search dialog):
2) MatchLocatorParser.parseBodies(MethodDeclaration)
This method will be called then we we start processing of module. Module will be processed if some keys are associated
to this module, then we build index.

3) MethodLocator.match(MethodDeclaration node, MatchingNodeSet nodeSet)
This method will be called then declaration are matched from MatchLocatorParser.
Also this method will add AST node to list of search matches.

4) MatchLocator.reportMatching(ModuleDeclaration decl)
This method will locate structure model element for each of matches.

Also you could look at our Ruby, Tcl implementations.

IQueryParticipant:
This is for extensibility only. You do not need to look at them.

Python:
Does search for method declarations not work in Example?
If you have reproducible example could you please create a bug in Eclipse bug tracker.

Best regards,
Andrei Sobolev.

> Search for references is working in my language editor plugin.
> 
> Neither searching for declarations (from the search dialog) nor open 
> declaration (from the context menu after selecting a reference in another 
> file) is working for me now.
> 
> Obviously, there are two possible causes of this:
> a)    the module that contains the method I want is not being searched
> b)    it is being searched but it isn't matched
> 
> I'm pretty sure that the matching works, since it works to find references.
> So, I'm left to believe that the module that contains the method declaration 
> that I am searching for isn't being searched.
> 
> It appears that the problem may be as follows:
> IExtensionPoint extPoint = this.getExtensionPoint(pluginId, 
> extensionPointSimpleId);
> 
> pluginId "org.eclipse.dltk.ui"
> extensionPointSimpleId "queryParticipants"
> 
> This returns null:
> 
> if (extPoint == null)
> 
> return new IConfigurationElement[0];
> 
> I found org.eclipse.dltk.ui.search.IQueryParticipant
> 
> but apparently nobody implements that interface.
> 
> Do I need to implement this interface to be able to find declarations?
> 
> If so, how do I do that?
> 
> FYI - Finding declarations doesn't seem to work for Python either.
> 
> Chuck
> 
> 
> 
>