Vscode-java: Code-completion not working with Language Support for Java and Visual Studio IntelliCode - Preview

Created on 18 Mar 2019  路  19Comments  路  Source: redhat-developer/vscode-java

Issue Type: Bug

Not sure if this belongs to LSfJ or is an Visual Studio IntelliCode Issue.

VScode fails to show code-completion on fields.
This happens if Language Support for Java and Visual Studio IntelliCode - Preview are installed AND "java.implementationsCodeLens.enabled": true is NOT set in settings.json.

Instead of showing the suggestions only an exception is thrown.

Peek 2019-03-17 23-33

Extension version: 0.41.0
VS Code version: Code 1.32.3 (a3db5be9b5c6ba46bb7555ec5d60178ecc2eaae4, 2019-03-14T23:38:49.842Z)
OS version: Linux x64 4.20.15-1-MANJARO

settings.json

{
    "window.titleBarStyle": "custom",
    "files.exclude": {
        "**/.classpath": true,
        "**/.project": true,
        "**/.settings": true,
        "**/.factorypath": true
    },
    "editor.suggestSelection": "first",
    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
    "java.referencesCodeLens.enabled": true,
    // "java.implementationsCodeLens.enabled": true
}

pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>spcified</groupId>
  <artifactId>test-vs-code</artifactId>
  <version>1.0-SNAPSHOT</version>

  <name>test-vs-code</name>

  <properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>

Extensions Log

[2019-03-17 23:50:50.915] [exthost] [info] extension host started
[2019-03-17 23:50:50.957] [exthost] [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch {"startup":true,"activationEvent":"*"}
[2019-03-17 23:50:50.958] [exthost] [info] ExtensionService#loadCommonJSModule /opt/visual-studio-code/resources/app/extensions/debug-auto-launch/dist/extension
[2019-03-17 23:50:50.961] [exthost] [info] ExtensionService#_doActivateExtension vscode.emmet {"startup":true,"activationEvent":"*"}
[2019-03-17 23:50:50.961] [exthost] [info] ExtensionService#loadCommonJSModule /opt/visual-studio-code/resources/app/extensions/emmet/dist/extension
[2019-03-17 23:50:50.968] [exthost] [info] ExtensionService#_doActivateExtension vscode.git {"startup":true,"activationEvent":"*"}
[2019-03-17 23:50:50.968] [exthost] [info] ExtensionService#loadCommonJSModule /opt/visual-studio-code/resources/app/extensions/git/dist/main
[2019-03-17 23:50:51.004] [exthost] [info] ExtensionService#_doActivateExtension vscode.merge-conflict {"startup":true,"activationEvent":"*"}
[2019-03-17 23:50:51.004] [exthost] [info] ExtensionService#loadCommonJSModule /opt/visual-studio-code/resources/app/extensions/merge-conflict/dist/extension
[2019-03-17 23:50:51.008] [exthost] [info] ExtensionService#_doActivateExtension redhat.java {"startup":false,"activationEvent":"onLanguage:java"}
[2019-03-17 23:50:51.008] [exthost] [info] ExtensionService#loadCommonJSModule /home/wusluf/.vscode/extensions/redhat.java-0.41.0/dist/extension
[2019-03-17 23:50:51.022] [exthost] [info] ExtensionService#_doActivateExtension VisualStudioExptTeam.vscodeintellicode {"startup":false,"activationEvent":"onLanguage:java"}
[2019-03-17 23:50:51.022] [exthost] [info] ExtensionService#loadCommonJSModule /home/wusluf/.vscode/extensions/visualstudioexptteam.vscodeintellicode-1.1.4/dist/intellicode
[2019-03-17 23:50:58.544] [exthost] [info] eager extensions activated

Language Server Log

!SESSION 2019-03-17 23:50:51.525 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_202
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments:  -data /home/wusluf/.config/Code/User/workspaceStorage/cc225f46f4cba87c7cd345dbcfbf8b78/redhat.java/jdt_ws

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:50:54.652
!MESSAGE class org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin is started

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:50:54.828
!MESSAGE Main thread is waiting

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:50:54.868
!MESSAGE >> initialize

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:50:54.869
!MESSAGE Initializing Java Language Server 0.35.0.201903150009

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:50:54.925
!MESSAGE >> initialized

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:50:54.968
!MESSAGE Creating the Java project jdt.ls-java-project

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:50:56.018
!MESSAGE Finished creating the Java project jdt.ls-java-project

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:50:56.477
!MESSAGE Importing Maven project(s)

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:50:58.537
!MESSAGE Workspace initialized in 3647ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:50:58.934
!MESSAGE >> workspace/didChangeConfiguration

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:50:58.955
!MESSAGE >> registerFeature 'workspace/didChangeWatchedFiles'

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:50:58.970
!MESSAGE >> registerFeature 'workspace/didChangeWatchedFiles'

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:50:59.035
!MESSAGE >>New configuration: {java={home=null, jdt={ls={vmargs=-noverify -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication}}, errors={incompleteClasspath={severity=warning}}, configuration={checkProjectSettingsExclusions=true, updateBuildConfiguration=automatic, maven={userSettings=null}}, trace={server=off}, import={gradle={enabled=true}, maven={enabled=true}, exclusions=[**/node_modules/**, **/.metadata/**, **/archetype-resources/**, **/META-INF/maven/**]}, referencesCodeLens={enabled=true}, signatureHelp={enabled=false}, implementationsCodeLens={enabled=false}, format={enabled=true, settings={url=null, profile=null}, comments={enabled=true}, onType={enabled=true}}, saveActions={organizeImports=false}, contentProvider={preferred=null}, autobuild={enabled=true}, maxConcurrentBuilds=1.0, completion={enabled=true, overwrite=true, guessMethodArguments=false, favoriteStaticMembers=[org.junit.Assert.*, org.junit.Assume.*, org.junit.jupiter.api.Assertions.*, org.junit.jupiter.api.Assumptions.*, org.junit.jupiter.api.DynamicContainer.*, org.junit.jupiter.api.DynamicTest.*, org.mockito.Mockito.*, org.mockito.ArgumentMatchers.*, org.mockito.Answers.*], importOrder=[java, javax, com, org]}, progressReports={enabled=true}, codeGeneration={hashCodeEquals={useJava7Objects=false, useInstanceof=false, useBlocks=false, generateComments=false}}}}

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:50:59.047
!MESSAGE >> document/didOpen

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:50:59.321
!MESSAGE >> workspace/executeCommand java.intellicode.enable

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:50:59.343
!MESSAGE >> document/codeAction

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:50:59.365
!MESSAGE >> document/codeLens

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:00.715
!MESSAGE >> document/codeAction

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:01.630
!MESSAGE begin problem for /App.java

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:01.631
!MESSAGE 1 problems reported for /App.java

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:01.633
!MESSAGE Reconciled 0, validated: 1. Took 1181 ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:02.074
!MESSAGE >> document/codeAction

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:02.213
!MESSAGE >> codeLens/resolve

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:02.215
!MESSAGE >> codeLens/resolve

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:02.216
!MESSAGE >> codeLens/resolve

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:03.317
!MESSAGE >> document/didChange

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:03.515
!MESSAGE >> document/codeLens

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:03.766
!MESSAGE >> codeLens/resolve

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:03.766
!MESSAGE >> codeLens/resolve

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:03.767
!MESSAGE >> codeLens/resolve

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:03.880
!MESSAGE begin problem for /App.java

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:03.881
!MESSAGE 2 problems reported for /App.java

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:03.883
!MESSAGE Reconciled 0, validated: 1. Took 112 ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:04.461
!MESSAGE >> codeLens/resolve

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:04.462
!MESSAGE >> codeLens/resolve

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:04.463
!MESSAGE >> codeLens/resolve

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:06.198
!MESSAGE >> document/didChange

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:06.403
!MESSAGE >> document/codeLens

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:06.407
!MESSAGE >> document/codeAction

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:06.657
!MESSAGE >> codeLens/resolve

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:06.658
!MESSAGE >> codeLens/resolve

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:06.658
!MESSAGE >> codeLens/resolve

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:06.718
!MESSAGE begin problem for /App.java

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:06.732
!MESSAGE 1 problems reported for /App.java

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:06.736
!MESSAGE Reconciled 0, validated: 1. Took 79 ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:06.992
!MESSAGE >> document/codeAction

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:07.372
!MESSAGE >> document/codeAction

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:08.327
!MESSAGE >> document/didChange

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:08.561
!MESSAGE >> document/codeLens

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:08.563
!MESSAGE >> document/codeAction

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:08.792
!MESSAGE begin problem for /App.java

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:08.792
!MESSAGE 2 problems reported for /App.java

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:08.795
!MESSAGE Reconciled 0, validated: 1. Took 63 ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:09.068
!MESSAGE >> document/codeAction

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:09.214
!MESSAGE >> document/didChange

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:09.282
!MESSAGE >> workspace/executeCommand java.intellicode.completion

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:09.417
!MESSAGE >> document/codeLens

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:09.421
!MESSAGE >> document/codeAction

!ENTRY com.microsoft.jdtls.intellicode.core 4 0 2019-03-17 23:51:09.431
!MESSAGE Problem with codeComplete for file:///home/wusluf/projects/learning/JMH%20-%20clean%20project/test-vs-code/src/main/java/spcified/App.java
!STACK 0
java.lang.ClassCastException: org.eclipse.jdt.internal.codeassist.impl.AssistSourceField cannot be cast to org.eclipse.jdt.core.IMethod
    at com.microsoft.jdtls.intellicode.core.pythia.PythiaCompletionContext.getMethodDeclaration(PythiaCompletionContext.java:185)
    at com.microsoft.jdtls.intellicode.core.pythia.PythiaCompletionContext.getCalls(PythiaCompletionContext.java:176)
    at com.microsoft.jdtls.intellicode.core.pythia.PythiaCompletionProvider.provideCompletionItems(PythiaCompletionProvider.java:59)
    at com.microsoft.jdtls.intellicode.core.CompletionProvider.computeContentAssist(CompletionProvider.java:117)
    at com.microsoft.jdtls.intellicode.core.CompletionProvider.provideCompletionItems(CompletionProvider.java:60)
    at com.microsoft.jdtls.intellicode.core.CommandHandler.executeCommand(CommandHandler.java:57)
    at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler$1.run(WorkspaceExecuteCommandHandler.java:151)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
    at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler.executeCommand(WorkspaceExecuteCommandHandler.java:141)
    at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$4(JDTLanguageServer.java:455)
    at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$30(JDTLanguageServer.java:821)
    at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
    at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
    at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:443)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

!ENTRY com.microsoft.jdtls.intellicode.core 1 0 2019-03-17 23:51:09.434
!MESSAGE Completion request cancelled

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:09.651
!MESSAGE begin problem for /App.java

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:09.652
!MESSAGE 1 problems reported for /App.java

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:09.654
!MESSAGE Reconciled 0, validated: 1. Took 37 ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:09.671
!MESSAGE >> codeLens/resolve

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:09.672
!MESSAGE >> codeLens/resolve

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:09.674
!MESSAGE >> codeLens/resolve

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:09.923
!MESSAGE >> document/codeAction

!ENTRY org.eclipse.jdt.ls.core 1 0 2019-03-17 23:51:10.240
!MESSAGE >> codeLens/resolve

Language Supprt for Java Output

[Error - 11:51:09 PM] Mar 17, 2019 11:51:09 PM Problem with codeComplete for file:///home/wusluf/projects/learning/JMH%20-%20clean%20project/test-vs-code/src/main/java/spcified/App.java
org.eclipse.jdt.internal.codeassist.impl.AssistSourceField cannot be cast to org.eclipse.jdt.core.IMethod
java.lang.ClassCastException: org.eclipse.jdt.internal.codeassist.impl.AssistSourceField cannot be cast to org.eclipse.jdt.core.IMethod
    at com.microsoft.jdtls.intellicode.core.pythia.PythiaCompletionContext.getMethodDeclaration(PythiaCompletionContext.java:185)
    at com.microsoft.jdtls.intellicode.core.pythia.PythiaCompletionContext.getCalls(PythiaCompletionContext.java:176)
    at com.microsoft.jdtls.intellicode.core.pythia.PythiaCompletionProvider.provideCompletionItems(PythiaCompletionProvider.java:59)
    at com.microsoft.jdtls.intellicode.core.CompletionProvider.computeContentAssist(CompletionProvider.java:117)
    at com.microsoft.jdtls.intellicode.core.CompletionProvider.provideCompletionItems(CompletionProvider.java:60)
    at com.microsoft.jdtls.intellicode.core.CommandHandler.executeCommand(CommandHandler.java:57)
    at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler$1.run(WorkspaceExecuteCommandHandler.java:151)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
    at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler.executeCommand(WorkspaceExecuteCommandHandler.java:141)
    at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$4(JDTLanguageServer.java:455)
    at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$30(JDTLanguageServer.java:821)
    at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
    at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
    at java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:443)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
    at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

System Info

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i3-3110M CPU @ 2.40GHz (4 x 1955)|
|GPU Status|2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: disabled_software
surface_synchronization: enabled_on
video_decode: unavailable_off
webgl: enabled
webgl2: enabled|
|Load (avg)|1, 1, 1|
|Memory (System)|7.49GB (0.57GB free)|
|Process Argv||
|Screen Reader|no|
|VM|0%|


bug caused-by-extension content-assist

All 19 comments

@Eskibear please help take a look at this issue.

IntelliCode Java plugin bug confirmed. As it's in the field, exception occurs when searching for previous calls in the context.

@yaohaizh I just created a PR in intellicode-java repo to fix it.
image

So I'm experiencing the same thing. While I still get the suggestions, I can't get the "Read more.." information. It just loads the top spar showing the "Math" and nothing below it. It's driving me nuts. I really enjoy VSCode on my Windows Desktop, but I can't seem to get it working on my Linux laptop.
So would you mind sharing your solution? Perhaps that might help me out.

Edit: I do on the other hand get suggestions and further information when I use VSCode for .js files.

Just had a try myself as @muggell mentioned.

I cannot stably reproduce it but I DO see the same issue for one time. It might be easier to reproduce it by typing Math. after reloading the window. Once you try inputting something else, and back to type Math. again, the issue is gone.

JDK is OpenJDK 8u212-b03, VSCode is 1.33.1

image

image

So I've tried a lot of things, and I can't seem to get anything to show in "Read more.." by pressing Ctrl + Space (Not even with the instructions you mentioned above @Eskibear ) - The only language I've succesfully have had it working with is JavaScript.
I feel like I'm missing a dependency or even somewhere for IntelliSense to lookup for information. I'm not sure if I make any sense, but it really is driving me crazy. Mostly because I'm rather new to using Linux, so messing with config files isn't second nature to me yet. So I feel pretty lost. But thanks for your fast reply.

Edit:
image

2nd Edit:
Image of the right side bar not showing the "Read More.." information

image

image

@muggell You can change value of java.trace to "verbose" in Settings. Then you can see details in output channel.

image

Following are my logs when everything work well, you can see the language server returns correct documentation, and it's been well-rendered. Let's see if we can find anything wrong in yours.

With IntelliCode enabled

Completion items are resolved by command java.intellicode.completion.resolve

[Trace - 11:52:23 PM] Sending request 'workspace/executeCommand - (57)'.
Params: {
    "command": "java.intellicode.completion.resolve",
    "arguments": [
        {
            "label": "E : double",
            "kind": 4,
            "detail": "Math",
            "sortText": "999999178",
            "insertText": "E",
            "data": {
                "decl_signature": "Ljava.lang.Math;",
                "name": "E",
                "pid": "2",
                "rid": "5",
                "uri": "file:///c:/Users/zy199/Desktop/aaa/H.java"
            }
        }
    ]
}


[Trace - 11:52:23 PM] Received response 'workspace/executeCommand - (57)' in 8ms.
Result: {
    "label": "E : double",
    "kind": 4,
    "detail": "Math",
    "documentation": {
        "kind": "markdown",
        "value": "The `double` value that is closer than any other to *e*, the base of the natural logarithms."
    },
    "sortText": "999999178",
    "insertText": "E",
    "insertTextFormat": 2,
    "textEdit": {
        "range": {
            "start": {
                "line": 2,
                "character": 13
            },
            "end": {
                "line": 2,
                "character": 13
            }
        },
        "newText": "E"
    }
}

Without IntelliCode enabled

Completion items are resolved by request completionItem/resolve

[Trace - 11:57:06 PM] Sending request 'completionItem/resolve - (9)'.
Params: {
    "label": "E : double",
    "detail": "Math",
    "insertTextFormat": 1,
    "insertText": "E",
    "kind": 21,
    "sortText": "999999178",
    "data": {
        "decl_signature": "Ljava.lang.Math;",
        "name": "E",
        "pid": "2",
        "rid": "0",
        "uri": "file:///C:/Users/zy199/Desktop/aaa/H.java"
    }
}

[Trace - 11:57:06 PM] Received response 'completionItem/resolve - (9)' in 92ms.
Result: {
    "label": "E : double",
    "kind": 21,
    "detail": "Math",
    "documentation": {
        "kind": "markdown",
        "value": "The `double` value that is closer than any other to *e*, the base of the natural logarithms."
    },
    "sortText": "999999178",
    "insertText": "E",
    "insertTextFormat": 2,
    "textEdit": {
        "range": {
            "start": {
                "line": 2,
                "character": 13
            },
            "end": {
                "line": 2,
                "character": 13
            }
        },
        "newText": "E"
    }
}

@Eskibear this is some of the output. I'm not sure if anything else is needed to determine the problem.

[Trace - 7:34:01 PM] Sending request 'workspace/executeCommand - (66)'.
Params: {
    "command": "java.intellicode.completion.resolve",
    "arguments": [
        {
            "label": "random() : double",
            "kind": 1,
            "detail": "Math",
            "sortText": "999999179",
            "insertText": "random",
            "command": {
                "title": "Telemetry",
                "command": "vsintellicode.completionItemSelected",
                "arguments": [
                    {
                        "InIf": "False",
                        "PrevInvoc": "N",
                        "Index": "64",
                        "Count": "5",
                        "Method": "random()",
                        "IsIntelliCodeCommit": "False",
                        "Language": "java",
                        "FailureReason": "None",
                        "ModelType": "Frequency",
                        "Class": "java.lang.Math",
                        "ModelVersion": "java_1.0.3.1",
                        "Id": "a4628f91-6bdc-4afa-903b-46a8ee5dd6dc",
                        "Methods": "min(int, int)|max(int, int)|abs(double)|sqrt(double)|pow(double, double)"
                    }
                ]
            },
            "data": {
                "decl_signature": "Ljava.lang.Math;",
                "signature": "()D",
                "name": "random",
                "pid": "24",
                "rid": "3",
                "uri": "file:///home/muggel/exercism/java/pangram/src/main/java/PangramChecker.java",
                "pythia_signature": "random()"
            }
        }
    ]
}


[Trace - 7:34:01 PM] Received response 'workspace/executeCommand - (66)' in 11ms.
Result: {
    "label": "random() : double",
    "kind": 1,
    "detail": "Math",
    "documentation": {
        "kind": "markdown"
    },
    "sortText": "999999179",
    "insertText": "random",
    "insertTextFormat": 2,
    "textEdit": {
        "range": {
            "start": {
                "line": 9,
                "character": 25
            },
            "end": {
                "line": 9,
                "character": 25
            }
        },
        "newText": "random()"
    },
    "command": {
        "title": "Telemetry",
        "command": "vsintellicode.completionItemSelected",
        "arguments": [
            {
                "InIf": "False",
                "PrevInvoc": "N",
                "Index": "64",
                "Count": "5",
                "Method": "random()",
                "IsIntelliCodeCommit": "False",
                "Language": "java",
                "FailureReason": "None",
                "ModelType": "Frequency",
                "Class": "java.lang.Math",
                "ModelVersion": "java_1.0.3.1",
                "Id": "a4628f91-6bdc-4afa-903b-46a8ee5dd6dc",
                "Methods": "min(int, int)|max(int, int)|abs(double)|sqrt(double)|pow(double, double)"
            }
        ]
    }
}


[Trace - 7:34:01 PM] Received notification 'language/progressReport'.
Params: {
    "id": "e80a6e34-5309-42ab-b7fa-516919f33310",
    "task": "Building workspace",
    "status": "Building workspace - 0%",
    "totalWork": 1000,
    "workDone": 0,
    "complete": false
}


[Trace - 7:34:01 PM] Received notification 'language/progressReport'.
Params: {
    "id": "e80a6e34-5309-42ab-b7fa-516919f33310",
    "task": "Building workspace",
    "status": "Building workspace - 0%",
    "totalWork": 1000,
    "workDone": 0,
    "complete": true
}


[Trace - 7:34:01 PM] Sending request 'textDocument/foldingRange - (67)'.
Params: {
    "textDocument": {
        "uri": "file:///home/muggel/exercism/java/pangram/src/main/java/PangramChecker.java"
    }
}


[Trace - 7:34:01 PM] Sending request 'workspace/executeCommand - (68)'.
Params: {
    "command": "vscode.java.test.search.codelens",
    "arguments": [
        "file:///home/muggel/exercism/java/pangram/src/main/java/PangramChecker.java"
    ]
}


[Trace - 7:34:01 PM] Sending request 'workspace/executeCommand - (69)'.
Params: {
    "command": "vscode.java.resolveMainMethod",
    "arguments": [
        "file:///home/muggel/exercism/java/pangram/src/main/java/PangramChecker.java"
    ]
}


[Trace - 7:34:01 PM] Sending request 'textDocument/codeAction - (70)'.
Params: {
    "textDocument": {
        "uri": "file:///home/muggel/exercism/java/pangram/src/main/java/PangramChecker.java"
    },
    "range": {
        "start": {
            "line": 9,
            "character": 26
        },
        "end": {
            "line": 9,
            "character": 26
        }
    },
    "context": {
        "diagnostics": []
    }
}

This is from the top when I first turned on verbose:

[Trace - 7:31:25 PM] Sending notification '$/setTraceNotification'.
Params: {
    "value": "verbose"
}


[Trace - 7:31:25 PM] Sending notification 'workspace/didChangeConfiguration'.
Params: {
    "settings": {
        "java": {
            "home": null,
            "jdt": {
                "ls": {
                    "vmargs": "-noverify -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication"
                }
            },
            "errors": {
                "incompleteClasspath": {
                    "severity": "warning"
                }
            },
            "configuration": {
                "checkProjectSettingsExclusions": true,
                "updateBuildConfiguration": "interactive",
                "maven": {
                    "userSettings": null
                }
            },
            "trace": {
                "server": "verbose"
            },
            "import": {
                "gradle": {
                    "enabled": true
                },
                "maven": {
                    "enabled": true
                },
                "exclusions": [
                    "**/node_modules/**",
                    "**/.metadata/**",
                    "**/archetype-resources/**",
                    "**/META-INF/maven/**"
                ]
            },
            "maven": {
                "downloadSources": false
            },
            "referencesCodeLens": {
                "enabled": false
            },
            "signatureHelp": {
                "enabled": false
            },
            "implementationsCodeLens": {
                "enabled": false
            },
            "format": {
                "enabled": true,
                "settings": {
                    "url": null,
                    "profile": null
                },
                "comments": {
                    "enabled": true
                },
                "onType": {
                    "enabled": true
                }
            },
            "saveActions": {
                "organizeImports": false
            },
            "contentProvider": {
                "preferred": null
            },
            "autobuild": {
                "enabled": true
            },
            "maxConcurrentBuilds": 1,
            "completion": {
                "enabled": true,
                "overwrite": true,
                "guessMethodArguments": false,
                "favoriteStaticMembers": [
                    "org.junit.Assert.*",
                    "org.junit.Assume.*",
                    "org.junit.jupiter.api.Assertions.*",
                    "org.junit.jupiter.api.Assumptions.*",
                    "org.junit.jupiter.api.DynamicContainer.*",
                    "org.junit.jupiter.api.DynamicTest.*",
                    "org.mockito.Mockito.*",
                    "org.mockito.ArgumentMatchers.*",
                    "org.mockito.Answers.*"
                ],
                "importOrder": [
                    "java",
                    "javax",
                    "com",
                    "org"
                ]
            },
            "foldingRange": {
                "enabled": true
            },
            "progressReports": {
                "enabled": true
            },
            "codeGeneration": {
                "hashCodeEquals": {
                    "useJava7Objects": false,
                    "useInstanceof": false
                },
                "useBlocks": false,
                "generateComments": false,
                "toString": {
                    "template": "${object.className} [${member.name()}=${member.value}, ${otherMembers}]",
                    "codeStyle": "STRING_CONCATENATION",
                    "skipNullValues": false,
                    "listArrayContents": true,
                    "limitElements": 0
                }
            },
            "debug": {
                "logLevel": "warn",
                "settings": {
                    "showHex": false,
                    "showStaticVariables": false,
                    "showQualifiedNames": false,
                    "showLogicalStructure": true,
                    "maxStringLength": 0,
                    "enableHotCodeReplace": true,
                    "enableRunDebugCodeLens": true,
                    "forceBuildBeforeLaunch": true
                }
            },
            "dependency": {
                "showOutline": true,
                "syncWithFolderExplorer": true,
                "packagePresentation": "flat"
            },
            "test": {
                "report": {
                    "position": "sideView"
                },
                "log": {
                    "level": "info"
                },
                "message": {
                    "hintForDeprecatedConfig": true,
                    "hintForSetingDefaultConfig": true
                },
                "defaultConfig": "",
                "config": {}
            }
        }
    }
}


[Trace - 7:31:32 PM] Sending request 'workspace/executeCommand - (37)'.
Params: {
    "command": "java.resolvePath",
    "arguments": [
        "output:extension-output-%235"
    ]
}


[Trace - 7:31:32 PM] Received response 'workspace/executeCommand - (37)' in 2ms.
Result: []


[Trace - 7:32:11 PM] Sending request 'textDocument/codeAction - (38)'.
Params: {
    "textDocument": {
        "uri": "file:///home/muggel/exercism/java/pangram/src/main/java/PangramChecker.java"
    },
    "range": {
        "start": {
            "line": 0,
            "character": 0
        },
        "end": {
            "line": 0,
            "character": 0
        }
    },
    "context": {
        "diagnostics": []
    }
}

In you log, the response of the resolving command looks not completed, so it has nothing to show.

...
[Trace - 7:34:01 PM] Received response 'workspace/executeCommand - (66)' in 11ms.
Result: {
    "label": "random() : double",
    "kind": 1,
    "detail": "Math",
    "documentation": {
        "kind": "markdown"
// ----> HERE THE "value" FIELD IS MISSING
    },
    "sortText": "999999179",
    "insertText": "random",
...

You may do the following experiments on your machine, to see if the missing is caused by language server or IntelliCode extension.

  • Disable extension "Visual Studio IntelliCode", reload the window, check the output to see if value of documentation is still missing or not. You can search the log by the keyword "completionItem/resolve".
  • Together with the response, also share the JDK version, VSCode version, version of this extension and IntelliCode extension.

@Eskibear So this is without the extension enabled:

[Trace - 12:15:40 PM] Received response 'completionItem/resolve - (40)' in 573ms.
Result: {
    "label": "E : double",
    "kind": 21,
    "detail": "Math",
    "documentation": {
        "kind": "markdown"
    },
    "sortText": "999999178",
    "insertText": "E",
    "insertTextFormat": 2,
    "textEdit": {
        "range": {
            "start": {
                "line": 9,
                "character": 25
            },
            "end": {
                "line": 9,
                "character": 25
            }
        },
        "newText": "E"
    }
}

VSCode version: 1.33.1
IntelliCode extension version: 1.1.6
JDK: openjdk-11 or java-1.11.0-openjdk-amd64

@Eskibear I know that you might be busy. I'm just making sure you didn't forget me, cause I can't seem to figure out whats wrong.

@muggell according to https://github.com/redhat-developer/vscode-java/issues/842#issuecomment-492179360 , response from the language server still misses documentation.value, indicating that vscode-java or language server don't work well in your machine. I'm not a pro on these parts, but I can help to create a new issue for you. The contributors might be able to help you out.

@Eskibear That's my conclusion too. But I'd love for you to help me creating a new issue so that I might be able to get it working properly, and hopefully get a stabile solution. It's really driving me crazy, so I'd appreciate all the help I can get.

Did you find any solution for this bug? I am facing the same problem on mac; Javadoc isn't appearing on code completion.

@ahmedhamdy90 See if #923 (comment) helps.

@Eskibear I did ask him about how to fix that (update the lookup path). However, I don't think it will help because hovering over a function shows the documentation correctly, but it is not showing any on code completion.

I confirm the same issue here.. Ubuntu 20.04 + openJdk-11 as @ahmedhamdy90 describes it, javadoc shows on hover, but not on code completion ..

@Ortega-Dan Yes, it should be fixed in the next release of the IntelliCode. MicrosoftDocs/intellicode#263

Was this page helpful?
0 / 5 - 0 ratings