Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dynamic Languages Toolkit (DLTK) » unable to find method declarations
unable to find method declarations [message #23581] Thu, 08 May 2008 21:21 Go to next message
Charles Doucette is currently offline Charles DoucetteFriend
Messages: 125
Registered: July 2009
Senior Member
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
Re: unable to find method declarations [message #23709 is a reply to message #23581] Fri, 09 May 2008 21:34 Go to previous messageGo to next message
Charles Doucette is currently offline Charles DoucetteFriend
Messages: 125
Registered: July 2009
Senior Member
I have found out a lot more information;
but, I still don't know why searching for method declarations never works,
and searching for method references only works sometimes.

I know that for every project in your workspace, it may be indexed (by
method name declarations and/or references at least).
That indexing is done by IndexManager.rebuildIndex.
I'm not sure when that actually happens.
I tried to force index rebuilding by deleting the files in the index
directory.
However, the flag createIfMissing was usually not set.

Chuck

"Chuck Doucette" <cdoucette@vaultus.com> wrote in message
news:fvvqv3$n5b$1@build.eclipse.org...
> 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
>
>
>
>
Re: unable to find method declarations [message #24142 is a reply to message #23581] Tue, 20 May 2008 14:21 Go to previous message
Andrei Sobolev is currently offline Andrei SobolevFriend
Messages: 72
Registered: July 2009
Member
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
>
>
>
>
Previous Topic:completion proposals - not matched to prefix?
Next Topic:Ruby build path
Goto Forum:
  


Current Time: Thu Apr 25 15:40:09 GMT 2024

Powered by FUDForum. Page generated in 0.03558 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top