sdedic commented on a change in pull request #481: [NETBEANS-290] Provided
support for hyperlink on dependencies.
URL: https://github.com/apache/incubator-netbeans/pull/481#discussion_r179225386
##########
File path:
maven.grammar/src/org/netbeans/modules/maven/hyperlinks/HyperlinkProviderImpl.java
##########
@@ -453,5 +215,331 @@ private FileObject getPath(FileObject parent, String
path) {
}
return parent.getFileObject(path);
}
+
+ private class PomParserRunnable implements Runnable {
+
+ private final PomHyperlinkInfo hyperLinkInfo;
+ private final Document document;
+ private final int offset;
+
+ public PomParserRunnable(PomHyperlinkInfo hyperLinkInfo, Document
document, int offset) {
+ this.hyperLinkInfo = hyperLinkInfo;
+ this.document = document;
+ this.offset = offset;
+ }
+
+ @Override
+ public void run() {
+ TokenHierarchy th = TokenHierarchy.get(document);
+ TokenSequence<XMLTokenId> xml =
th.tokenSequence(XMLTokenId.language());
+ xml.move(offset);
+ xml.moveNext();
+ Token<XMLTokenId> token = xml.token();
Review comment:
it's often better to check moveNext()'s value than the result of token(),
but both work.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists