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 2021/03/12 14:30:32 UTC

[GitHub] [netbeans] sdedic opened a new pull request #2806: Auto-open project owner of the opened file.

sdedic opened a new pull request #2806:
URL: https://github.com/apache/netbeans/pull/2806


   Especially with gradle subproject, it happens that if the gradle project is not opened, diagnostics run on the project's sources report missing identifiers. The LSP server can internally automatically open project owner when the LSP client opens a file from that project.
   
   This PR performs `asyncOpenSelectedProjects` using the file being opened. If the project is *being opened* (including priming build), the actual `OpenedProjects.open` call will be postponed until after that process completes.
   For projects that whose open operation completed already, the Future in `beingOpened` is completed, so calling `asyncOpenSelectedProjects` on an opened project will also complete immediately.
   
   I've changed the semantic of `beingOpened` to keep the completed Futures as a sign that a priming build is not needed (again).


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

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


[GitHub] [netbeans] sdedic commented on pull request #2806: Auto-open project owner of the opened file.

Posted by GitBox <gi...@apache.org>.
sdedic commented on pull request #2806:
URL: https://github.com/apache/netbeans/pull/2806#issuecomment-799230535


   > Could this be done for NetBeans as well? It would be great to see a bubble in top right corner asking "File xyz belongs to project abc. Open it and analyze it?"
   
   Yes, this would be nice. In NetBeans we have `EditorRegistry`, so Projects UI could eventually track the opened files and ask as you suggested. 
   
   Sadly this must be duplicated (somehow) for LSP server, as we do not have some abstraction for an actively-worked-on file except the EditorRegistry that is tied to Swing.
   
   Tracked as  [NETBEANS-5454](https://issues.apache.org/jira/browse/NETBEANS-5454)


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

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


[GitHub] [netbeans] sdedic commented on a change in pull request #2806: Auto-open project owner of the opened file.

Posted by GitBox <gi...@apache.org>.
sdedic commented on a change in pull request #2806:
URL: https://github.com/apache/netbeans/pull/2806#discussion_r593322032



##########
File path: java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TextDocumentServiceImpl.java
##########
@@ -1784,7 +1784,11 @@ public void didOpen(DidOpenTextDocumentParams params) {
                 client.logMessage(new MessageParams(MessageType.Error, ex.getMessage()));
             }
             openedDocuments.put(params.getTextDocument().getUri(), doc);
-            runDiagnoticTasks(params.getTextDocument().getUri());
+            
+            // attempt to open the directly owning project, delay diagnostics after project open:

Review comment:
       Good point with the project relationships; will try to add checks.




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

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


[GitHub] [netbeans] sdedic merged pull request #2806: Auto-open project owner of the opened file.

Posted by GitBox <gi...@apache.org>.
sdedic merged pull request #2806:
URL: https://github.com/apache/netbeans/pull/2806


   


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

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


[GitHub] [netbeans] JaroslavTulach commented on a change in pull request #2806: Auto-open project owner of the opened file.

Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on a change in pull request #2806:
URL: https://github.com/apache/netbeans/pull/2806#discussion_r595896935



##########
File path: java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/LspServerState.java
##########
@@ -50,6 +51,23 @@
      */
     public CompletableFuture<Project[]>   asyncOpenSelectedProjects(List<FileObject> fileCandidates);
     
+    /**
+     * Opens project oo behalf of a file. This makes the project 'second-class citizen' in LSP: it will be

Review comment:
       Typo `oo`
   




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

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


[GitHub] [netbeans] sdedic commented on pull request #2806: Auto-open project owner of the opened file.

Posted by GitBox <gi...@apache.org>.
sdedic commented on pull request #2806:
URL: https://github.com/apache/netbeans/pull/2806#issuecomment-801715479


   Windows & Mac builds have connectitivy issues. Travis build  for Graalvm (latest) as well. The only 'normally' failing test is `Test java.hints batch1 without nb-javac on Java 14` - but not from this PR.


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

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


[GitHub] [netbeans] sdedic commented on pull request #2806: Auto-open project owner of the opened file.

Posted by GitBox <gi...@apache.org>.
sdedic commented on pull request #2806:
URL: https://github.com/apache/netbeans/pull/2806#issuecomment-800926766


   Rebased on master to get Maven project parent and root queries to the branch.
   
   I have added the user questions when a project is implicitly opened. The question is asked only once per LSP server instance, so if the user rejects, he won't be bothered again for the project, but the diagnostics etc won't be working much (but the user wanted so).
   The question is aked if **the project and no of its parent projects** are already opened **in the workspace**. So if the user e.g. opens a folder with some parent in VSCode, the subprojects (as they are contained in + built with the parent) are opened without questions.


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

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


[GitHub] [netbeans] JaroslavTulach commented on a change in pull request #2806: Auto-open project owner of the opened file.

Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on a change in pull request #2806:
URL: https://github.com/apache/netbeans/pull/2806#discussion_r593308820



##########
File path: java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TextDocumentServiceImpl.java
##########
@@ -1784,7 +1784,11 @@ public void didOpen(DidOpenTextDocumentParams params) {
                 client.logMessage(new MessageParams(MessageType.Error, ex.getMessage()));
             }
             openedDocuments.put(params.getTextDocument().getUri(), doc);
-            runDiagnoticTasks(params.getTextDocument().getUri());
+            
+            // attempt to open the directly owning project, delay diagnostics after project open:

Review comment:
       Possibly this could open a completely unrelated project - will the user be asked for a consent to trust the project in that case?
   
   Btw. there is [NETBEANS-5204](https://github.com/apache/netbeans/pull/2629/) to help you find whether a subproject is related to already opened project or not.




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

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


[GitHub] [netbeans] sdedic commented on pull request #2806: Auto-open project owner of the opened file.

Posted by GitBox <gi...@apache.org>.
sdedic commented on pull request #2806:
URL: https://github.com/apache/netbeans/pull/2806#issuecomment-801109223


   Squashed + typo fixed. Waiting for build to proceed before merge.


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

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


[GitHub] [netbeans] sdedic commented on pull request #2806: Auto-open project owner of the opened file.

Posted by GitBox <gi...@apache.org>.
sdedic commented on pull request #2806:
URL: https://github.com/apache/netbeans/pull/2806#issuecomment-799468378


   Suspending. To work with Gradle projects, I need to implement [NETBEANS-5430](https://issues.apache.org/jira/browse/NETBEANS-5430) first. Maven projects, which already support priming, lacks the support for project hirerarchy queries -- [NETBEANS-5455](https://issues.apache.org/jira/browse/NETBEANS-5455)


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

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