For navigable index, store also the declaration's position.
authorJan Lahoda <jlahoda@netbeans.org>
Wed, 22 Aug 2012 08:31:07 +0200
changeset 8542d6591b8b42c
parent 853 8d169fc210ea
child 859 f248452bfd5d
For navigable index, store also the declaration's position.
remoting/server/indexer/usages/src/org/netbeans/modules/jackpot30/indexer/usages/IndexerImpl.java
     1.1 --- a/remoting/server/indexer/usages/src/org/netbeans/modules/jackpot30/indexer/usages/IndexerImpl.java	Tue Aug 21 13:33:42 2012 +0200
     1.2 +++ b/remoting/server/indexer/usages/src/org/netbeans/modules/jackpot30/indexer/usages/IndexerImpl.java	Wed Aug 22 08:31:07 2012 +0200
     1.3 @@ -227,6 +227,7 @@
     1.4  
     1.5                                  if (NAVIGABLE) {
     1.6                                      currentClassDocument.add(new Field("declarationSignature", Common.serialize(ElementHandle.create(el)), Store.YES, Index.NOT_ANALYZED));
     1.7 +                                    currentClassDocument.add(new Field("declarationPosition", Long.toString(trees.getSourcePositions().getStartPosition(getCurrentPath().getCompilationUnit(), node)), Store.YES, Index.NO));
     1.8                                  }
     1.9  
    1.10                                  IndexAccessor.getCurrent().getIndexWriter().addDocument(currentClassDocument);
    1.11 @@ -295,6 +296,7 @@
    1.12  
    1.13                              if (NAVIGABLE) {
    1.14                                  currentFeatureDocument.add(new Field("declarationSignature", Common.serialize(ElementHandle.create(el)), Store.YES, Index.NOT_ANALYZED));
    1.15 +                                currentFeatureDocument.add(new Field("declarationPosition", Long.toString(trees.getSourcePositions().getStartPosition(getCurrentPath().getCompilationUnit(), getCurrentPath().getLeaf())), Store.YES, Index.NO));
    1.16                              }
    1.17  
    1.18                              IndexAccessor.getCurrent().getIndexWriter().addDocument(currentFeatureDocument);