You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by lk...@apache.org on 2020/10/28 15:20:03 UTC

[netbeans] branch delivery updated: Avoid registering the LSP client's hyperlink provider unless the given file is handled by the LSP client.

This is an automated email from the ASF dual-hosted git repository.

lkishalmi pushed a commit to branch delivery
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/delivery by this push:
     new cec7557  Avoid registering the LSP client's hyperlink provider unless the given file is handled by the LSP client.
cec7557 is described below

commit cec75573fc1c5f6add1bef21c52c86d88acfb872
Author: Jan Lahoda <jl...@netbeans.org>
AuthorDate: Tue Oct 27 20:04:07 2020 +0100

    Avoid registering the LSP client's hyperlink provider unless the given file is handled by the LSP client.
---
 .../netbeans/modules/lsp/client/bindings/HyperlinkProviderImpl.java    | 2 +-
 .../lsp/client/bindings/TextDocumentSyncServerCapabilityHandler.java   | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/ide/lsp.client/src/org/netbeans/modules/lsp/client/bindings/HyperlinkProviderImpl.java b/ide/lsp.client/src/org/netbeans/modules/lsp/client/bindings/HyperlinkProviderImpl.java
index eed30cd..f654c3e 100644
--- a/ide/lsp.client/src/org/netbeans/modules/lsp/client/bindings/HyperlinkProviderImpl.java
+++ b/ide/lsp.client/src/org/netbeans/modules/lsp/client/bindings/HyperlinkProviderImpl.java
@@ -77,7 +77,7 @@ public class HyperlinkProviderImpl implements HyperlinkProviderExt {
             }
             TokenSequence<?> ts = TokenHierarchy.get(doc).tokenSequence();
             if (ts == null) {
-                return null;
+                return ident;
             }
             ts.move(offset);
             if (ts.moveNext() && ts.token().id() == TextmateTokenId.TEXTMATE) {
diff --git a/ide/lsp.client/src/org/netbeans/modules/lsp/client/bindings/TextDocumentSyncServerCapabilityHandler.java b/ide/lsp.client/src/org/netbeans/modules/lsp/client/bindings/TextDocumentSyncServerCapabilityHandler.java
index efad9aa..4522c45 100644
--- a/ide/lsp.client/src/org/netbeans/modules/lsp/client/bindings/TextDocumentSyncServerCapabilityHandler.java
+++ b/ide/lsp.client/src/org/netbeans/modules/lsp/client/bindings/TextDocumentSyncServerCapabilityHandler.java
@@ -131,7 +131,6 @@ public class TextDocumentSyncServerCapabilityHandler {
             return; //ignore
 
         openDocument2PanesCount.computeIfAbsent(doc, d -> {
-            doc.putProperty(HyperlinkProviderImpl.class, true);
             doc.putProperty(TextDocumentSyncServerCapabilityHandler.class, true);
             ensureDidOpenSent(doc);
             doc.addDocumentListener(new DocumentListener() { //XXX: listener
@@ -289,6 +288,8 @@ public class TextDocumentSyncServerCapabilityHandler {
                 return ;
             }
 
+            doc.putProperty(HyperlinkProviderImpl.class, true);
+
             String uri = Utils.toURI(file);
             String[] text = new String[1];
 


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

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