Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [Dltk-dev] problem with dltk-search

Hi Sebastian,

Please see comments inline.

20.09.2011 00:48, Sebastian Rheinnecker пишет:

When i doubleclick on an element in the outlineview, the selection of
the editor is set correctly to the name of the declaration. This is a
sign that the namestart and nameend fields are set correctly. However,
if i doubleclick on the search results the selection is not set
correctly, altough both systems are using the same information?
Search view uses snapshot of positions during search.
So if files are changed after it, positions will be old ones.

If it point to different place without file modifications you could debug method
org.eclipse.dltk.internal.ui.search.DLTKSearchResultPage.showMatch(),
it is responsible for opening match from search results.


Another question would be: How do i implement own types of
Declarations independent from type/method/field declarations? I
figured that this would be very hard, since you have to implement own
Locator classes and extend PatternLocator to override the
patternLocator-Method. Am i right here?
You will need:
1. Custom MatchLocator - this will allow to pass any results to search view.
2. Correct search patterns - SearchPattern based classes.
3. Custom search page implementation - please refer to DLTKSearchPage as example.

Unfortunately DLTK is not support custom indexing and search kinds,
so you will need to map your custom items to some of existing declaration, reference kinds.

So it is possible, but little bit complicated.

Also you could look into new DLTK search, implemented by Zend guys.

Top level API are looks almost same, so no custom elements by default.
But i suppose it will be not very difficult to extend it instead of old DLTK index/search.

New indexind/search are in org.eclipse.dltk.core.index2 packages of org.eclipse.dltk.core plugin and org.eclipse.dltk.core.index* plugins.

Best regards,
Andrei Sobolev.


Back to the top