XPathView scrolls to wrong hit

Using XPathView 0.3.5 with IDEA 4.0 (build 1179). Great plugin 8)

When I have the "Scroll first hit into visible area" option checked in
the IDE options, it scrolls to some other hit elsewhere in the file and
not the first hit. It consistently selects the same (erroneous) hit for
identical queries. I'm using a query which matches a particular element
anywhere in the tree: "//element". Changing the element changes which
hit it scrolls to.

Also, a feature request: Make the "Scroll first hit..." option move the
caret as well? Or at least make it an additional subsidiary option.

Thanks
Gordon

--
Gordon Tyler (Software Developer)
Quest Software <http://java.quest.com/>
260 King Street East, Toronto, Ontario M5A 4L5, Canada
Voice: 416-643-4846 | Fax: 416-594-1919

4 comments
Comment actions Permalink

Gordon Tyler wrote:

Using XPathView 0.3.5 with IDEA 4.0 (build 1179). Great plugin 8)


Thanks :D

When I have the "Scroll first hit into visible area" option checked in
the IDE options, it scrolls to some other hit elsewhere in the file and
not the first hit. It consistently selects the same (erroneous) hit for
identical queries. I'm using a query which matches a particular element
anywhere in the tree: "//element". Changing the element changes which
hit it scrolls to.


Hmm, sounds strange because I can't reproduce the problem. Can you attach a
screenshot of the problem and maybe even the document it happens with?

Also, a feature request: Make the "Scroll first hit..." option move the
caret as well? Or at least make it an additional subsidiary option.


Good idea. I'll add that in the next version.


Sascha

0
Comment actions Permalink

Sascha Weinreuter wrote:

Hmm, sounds strange because I can't reproduce the problem. Can you attach a
screenshot of the problem and maybe even the document it happens with?


Sorry, the document is proprietary information. I can tell you that it
uses a custom DTD and it's about 5000 lines long. The nodes are
sometimes as deep as 10 or more levels. It's well-formed and valid.

Perhaps it something to do with the ordering of the PSI nodes? Do you
sort the hits according to their character position within the document
or do you just take the first hit returned by PSI?

Thanks,
Gordon

--
Gordon Tyler (Software Developer)
Quest Software <http://java.quest.com/>
260 King Street East, Toronto, Ontario M5A 4L5, Canada
Voice: 416-643-4846 | Fax: 416-594-1919

0
Comment actions Permalink

Gordon Tyler wrote:

Sascha Weinreuter wrote:

Perhaps it something to do with the ordering of the PSI nodes? Do you
sort the hits according to their character position within the document
or do you just take the first hit returned by PSI?


Hmm, you may be right. I relied on the XPath engine to return the matching
nodes in document order, but it seems like this is not always the case.

I've attached a test build that keeps track of the lowest offset and scrolls
there. Please tell me if it works for you.

Sascha



Attachment(s):
xpath-view.jar
0
Comment actions Permalink

Sascha Weinreuter wrote:

Hmm, you may be right. I relied on the XPath engine to return the matching
nodes in document order, but it seems like this is not always the case.

I've attached a test build that keeps track of the lowest offset and
scrolls
there. Please tell me if it works for you.


It does indeed appear to be working correctly. Thanks 8)

Ciao,
Gordon

--
Gordon Tyler (Software Developer)
Quest Software <http://java.quest.com/>
260 King Street East, Toronto, Ontario M5A 4L5, Canada
Voice: 416-643-4846 | Fax: 416-594-1919

0

Please sign in to leave a comment.