You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by "dbalek (via GitHub)" <gi...@apache.org> on 2023/05/29 08:26:39 UTC

[GitHub] [netbeans] dbalek commented on a diff in pull request #5991: Enable Micronaut HyperlinkProviders - deadlocks fixed.

dbalek commented on code in PR #5991:
URL: https://github.com/apache/netbeans/pull/5991#discussion_r1209062186


##########
enterprise/micronaut/src/org/netbeans/modules/micronaut/hyperlink/MicronautConfigHyperlinkProvider.java:
##########
@@ -80,10 +95,26 @@ public boolean isHyperlinkPoint(Document doc, int offset, HyperlinkType type) {
 
     @Override
     public int[] getHyperlinkSpan(Document doc, int offset, HyperlinkType type) {
-        int[] span = new int[2];
-        List<ConfigurationMetadataSource> sources = new ArrayList<>();
-        ConfigurationMetadataProperty property = MicronautConfigUtilities.resolveProperty(doc, offset, span, sources);
-        return property != null || !sources.isEmpty() ? span : null;
+        String mimeType = DocumentUtilities.getMimeType(doc);
+        if ("text/x-yaml".equals(mimeType)) {
+            List<int[]> spans = null;
+            synchronized (doc) {
+                spans = (List<int[]>) doc.getProperty(SPANS_PROPERTY_NAME);
+            }
+            if (spans != null) {
+                for (int[] span : spans) {
+                    if (span.length == 2 && span[0] <= offset && offset <= span[1]) {

Review Comment:
   Go to declaration usually works even if caret is placed at the identifier end position `someId|`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
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