You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2018/04/04 17:43:59 UTC

[GitHub] sdedic commented on a change in pull request #481: [NETBEANS-290] Provided support for hyperlink on dependencies.

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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists