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/10/12 10:38:30 UTC
[GitHub] [netbeans] dbalek opened a new pull request #3237: LSP: Code completion should auto import classes
dbalek opened a new pull request #3237:
URL: https://github.com/apache/netbeans/pull/3237
- `completionItem/resolve` request should wait for loading Javadoc for a limited amount of time because the code completion auto-import functionality depends on its response.
- Get project packages should wait for project indexing finished.
--
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
[GitHub] [netbeans] sdedic commented on a change in pull request #3237: LSP: Code completion should auto import classes
Posted by GitBox <gi...@apache.org>.
sdedic commented on a change in pull request #3237:
URL: https://github.com/apache/netbeans/pull/3237#discussion_r727053293
##########
File path: java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TextDocumentServiceImpl.java
##########
@@ -284,6 +290,14 @@ public void indexingComplete(Set<URL> indexedRoots) {
}
try {
String uri = params.getTextDocument().getUri();
+ ConfigurationItem conf = new ConfigurationItem();
+ conf.setScopeUri(uri);
+ conf.setSection(NETBEANS_JAVADOC_LOAD_TIMEOUT);
+ client.configuration(new ConfigurationParams(Collections.singletonList(conf))).thenAccept(c -> {
Review comment:
This could eventually compute 1st `completion` request with incorrect setting of `javadocTimeout` -- could be the returned CompletableFuture chained after this query returns from the server ? Or is it unnecessary ?
##########
File path: ide/api.lsp/src/org/netbeans/spi/lsp/CompletionCollector.java
##########
@@ -353,6 +355,17 @@ public T get() throws InterruptedException, ExecutionException {
}
return super.get();
}
+
+ @Override
+ public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
+ CompletableFuture.supplyAsync(supplier).thenAccept(t -> {
Review comment:
Would it be possible to use the RequestProcessor API ? That way the default Lookup (and connection to the appropriate LSP client) will be transferred to the `supplier` thread.
--
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
[GitHub] [netbeans] dbalek commented on a change in pull request #3237: LSP: Code completion should auto import classes
Posted by GitBox <gi...@apache.org>.
dbalek commented on a change in pull request #3237:
URL: https://github.com/apache/netbeans/pull/3237#discussion_r727090868
##########
File path: java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/TextDocumentServiceImpl.java
##########
@@ -284,6 +290,14 @@ public void indexingComplete(Set<URL> indexedRoots) {
}
try {
String uri = params.getTextDocument().getUri();
+ ConfigurationItem conf = new ConfigurationItem();
+ conf.setScopeUri(uri);
+ conf.setSection(NETBEANS_JAVADOC_LOAD_TIMEOUT);
+ client.configuration(new ConfigurationParams(Collections.singletonList(conf))).thenAccept(c -> {
Review comment:
Fixed.
--
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
[GitHub] [netbeans] JaroslavTulach commented on pull request #3237: LSP: Code completion should auto import classes
Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on pull request #3237:
URL: https://github.com/apache/netbeans/pull/3237#issuecomment-941075767
I am trying this change locally
```bash
vscode$ npm run test
```
and as far as I can see the problem with Java packages is gone. Great. On the other hand, I am constantly seeing:
```
1 failing
1) Extension Test Suite
Test Explorer tests:
AssertionError [ERR_ASSERTION]: No tests returned for workspace
at /home/devel/NetBeansProjects/netbeans3/java/java.lsp.server/vscode/out/test/suite/extension.test.js:222:24
at Generator.next (<anonymous>)
at fulfilled (out/test/suite/extension.test.js:5:58)
```
investigating further.
--
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
[GitHub] [netbeans] JaroslavTulach edited a comment on pull request #3237: LSP: Code completion should auto import classes
Posted by GitBox <gi...@apache.org>.
JaroslavTulach edited a comment on pull request #3237:
URL: https://github.com/apache/netbeans/pull/3237#issuecomment-941075767
I am trying this change locally
```bash
vscode$ npm run test
```
I also applied
```diff
$ git diff src/
diff --git a/java/java.lsp.server/vscode/src/test/suite/extension.test.ts b/java/java.lsp.server/vscode/src/test/suite/extension.test.ts
index 562dacca4ef9..d11b264fcd9c 100644
--- a/java/java.lsp.server/vscode/src/test/suite/extension.test.ts
+++ b/java/java.lsp.server/vscode/src/test/suite/extension.test.ts
@@ -209,13 +209,13 @@ suite('Extension Test Suite', () => {
res = await vscode.commands.executeCommand("java.get.project.packages", Uri.file(folder).toString());
console.log(`Test: get all project packages finished with ${res}`);
assert.ok(res, "No packages returned");
- assert.ok(res.length > 0, `Invalid number of packages returned`);
+ assert.strictEqual(res.length, 0, `Invalid number of packages returned for ${folder}`);
console.log("Test: get project source packages");
res = await vscode.commands.executeCommand("java.get.project.packages", Uri.file(folder).toString(), true);
console.log(`Test: get project source packages finished with ${res}`);
assert.ok(res, "No packages returned");
- assert.strictEqual(res.length, 1, `Invalid number of packages returned`);
+ assert.strictEqual(res.length, 1, `Invalid number of packages returned for ${folder}`);
assert.strictEqual(res[0], 'pkg', `Invalid package returned`);
} catch (error) {
dumpJava();
```
--
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
[GitHub] [netbeans] dbalek merged pull request #3237: LSP: Code completion should auto import classes
Posted by GitBox <gi...@apache.org>.
dbalek merged pull request #3237:
URL: https://github.com/apache/netbeans/pull/3237
--
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
[GitHub] [netbeans] dbalek merged pull request #3237: LSP: Code completion should auto import classes
Posted by GitBox <gi...@apache.org>.
dbalek merged pull request #3237:
URL: https://github.com/apache/netbeans/pull/3237
--
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
[GitHub] [netbeans] dbalek commented on a change in pull request #3237: LSP: Code completion should auto import classes
Posted by GitBox <gi...@apache.org>.
dbalek commented on a change in pull request #3237:
URL: https://github.com/apache/netbeans/pull/3237#discussion_r727090421
##########
File path: ide/api.lsp/src/org/netbeans/spi/lsp/CompletionCollector.java
##########
@@ -353,6 +355,17 @@ public T get() throws InterruptedException, ExecutionException {
}
return super.get();
}
+
+ @Override
+ public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
+ CompletableFuture.supplyAsync(supplier).thenAccept(t -> {
Review comment:
Fixed. RequestProcessor used as executor.
--
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