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/05/13 18:56:45 UTC
[GitHub] [netbeans] sdedic commented on a change in pull request #2955: LSP: Provide hover information in Micronaut yaml files.
sdedic commented on a change in pull request #2955:
URL: https://github.com/apache/netbeans/pull/2955#discussion_r632024805
##########
File path: java/java.sourceui/src/org/netbeans/api/java/source/ui/ElementJavadoc.java
##########
@@ -371,26 +371,29 @@ private ElementJavadoc(CompilationInfo compilationInfo, Element element, final U
computeDocURL(Collections.emptyList(), true, cancel);
doc = header.append(noJavadocFound());
}
- this.content = new Now(doc.toString());
+ this.content = CompletableFuture.completedFuture(doc.toString());
} catch (JavadocHelper.RemoteJavadocException re) {
if (fileObject == null || JavaSource.forFileObject(fileObject) == null) {
header.append(noJavadocFound());
- this.content = new Now(header.toString());
+ this.content = CompletableFuture.completedFuture(header.toString());
return;
}
- this.content = new FutureTask<>(() -> {
- final JavaSourceUtil.Handle ch = JavaSourceUtil.createControllerHandle(fileObject, null);
- final CompilationController c = (CompilationController) ch.getCompilationController();
- c.toPhase(Phase.RESOLVED);
- final Element el = handle.resolve(c);
- CharSequence doc = getElementDoc(el, c, header, url, false);
- if (doc == null) {
- computeDocURL(Collections.emptyList(), false, cancel);
- doc = header.append(noJavadocFound());
+ this.content = CompletableFuture.supplyAsync(() -> {
+ try {
+ final JavaSourceUtil.Handle ch = JavaSourceUtil.createControllerHandle(fileObject, null);
+ final CompilationController c = (CompilationController) ch.getCompilationController();
+ c.toPhase(Phase.RESOLVED);
+ final Element el = handle.resolve(c);
+ CharSequence doc = getElementDoc(el, c, header, url, false);
+ if (doc == null) {
+ computeDocURL(Collections.emptyList(), false, cancel);
+ doc = header.append(noJavadocFound());
+ }
+ return doc.toString();
+ } catch (Exception ex) {
+ return null;
Review comment:
Maybe log the exception ?
--
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