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

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


The following commit(s) were added to refs/heads/master by this push:
     new 4fde34f  [NETBEANS-2343]: Only use the LSP HyperlinkProvider for files 
that are covered by some LSPBindings.
     new 9807ca5  Merge pull request #1369 from jlahoda/NETBEANS-2343
4fde34f is described below

commit 4fde34fd099696eda2ae0ddb38c329ba3be2f5ba
Author: Jan Lahoda <[email protected]>
AuthorDate: Thu Jul 11 20:30:43 2019 +0200

    [NETBEANS-2343]: Only use the LSP HyperlinkProvider for files that are 
covered by some LSPBindings.
---
 .../netbeans/modules/lsp/client/bindings/HyperlinkProviderImpl.java  | 5 +++++
 .../lsp/client/bindings/TextDocumentSyncServerCapabilityHandler.java | 2 ++
 2 files changed, 7 insertions(+)

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 3419d7e..e427a89 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
@@ -69,6 +69,11 @@ public class HyperlinkProviderImpl implements 
HyperlinkProviderExt {
 
     @Override
     public int[] getHyperlinkSpan(Document doc, int offset, HyperlinkType 
type) {
+        if (doc.getProperty(HyperlinkProviderImpl.class) != Boolean.TRUE) {
+            //not handled by a LSP handler
+            return null;
+        }
+
         try {
             //XXX: not really using the server, are we?
             return Utilities.getIdentifierBlock((BaseDocument) doc, offset);
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 79c88af..3c59ffa 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
@@ -86,6 +86,8 @@ public class TextDocumentSyncServerCapabilityHandler {
                 if (server == null)
                     return ; //ignore
 
+                doc.putProperty(HyperlinkProviderImpl.class, Boolean.TRUE);
+
                 String uri = Utils.toURI(file);
                 String[] text = new String[1];
 


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

Reply via email to