jlahoda commented on a change in pull request #1508: Improving code completion
appearance for both LSP client and Java LSP…
URL: https://github.com/apache/netbeans/pull/1508#discussion_r328924900
##########
File path:
ide/lsp.client/src/org/netbeans/modules/lsp/client/bindings/CompletionProviderImpl.java
##########
@@ -226,36 +223,66 @@ public void render(Graphics grphcs, Font font, Color
color, Color color1, int i,
@Override
public CompletionTask createDocumentationTask() {
- return new CompletionTask() {
+ return new AsyncCompletionTask(new
AsyncCompletionQuery() {
@Override
- public void query(CompletionResultSet
resultSet) {
- resultSet.setDocumentation(new
CompletionDocumentation() {
- @Override
- public String getText() {
- return documentation;
- }
- @Override
- public URL getURL() {
- return null;
- }
- @Override
- public CompletionDocumentation
resolveLink(String link) {
- return null;
+ protected void query(CompletionResultSet
resultSet, Document doc, int caretOffset) {
+ CompletionItem resolved;
+ if ((i.getDetail() == null ||
i.getDocumentation() == null) && hasCompletionResolve(server)) {
+ CompletionItem temp;
+ try {
+ temp =
server.getTextDocumentService().resolveCompletionItem(i).get();
+ } catch (InterruptedException |
ExecutionException ex) {
+ Exceptions.printStackTrace(ex);
+ temp = i;
}
- @Override
- public Action
getGotoSourceAction() {
- return null;
- }
- });
+ resolved = temp;
+ } else {
+ resolved = i;
+ }
+ if (resolved.getDocumentation() !=
null || resolved.getDetail() != null) {
+ resultSet.setDocumentation(new
CompletionDocumentation() {
+ @Override
+ public String getText() {
+ StringBuilder
documentation = new StringBuilder();
+
documentation.append("<html>\n");
Review comment:
Probably yes, I'll try to remember that and add that on next update.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
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