Skip to content

Java IntelliSense stops working randomly #1040

Closed

Description

@ccerghed

Issue Type: Bug

I have been using a very small project for a few months now, and have had the best experience with the Java Language support. Intellisense was working great until the last 2 patches of Visual Studio Code, which apparently broke the extension. It throws an exception, and then all IntelliSense stops working, including the JS/TS extension. If I restart Visual Studio Code, it will start working again, until it hits the exception again. Here are the details:

[Error - 2:12:06 PM] Aug 21, 2019 2:12:06 PM Problem with folding range for /dev-charlie-plugin/src/progressive/pims/AccessRequestResource.java
Invalid_Char_In_String
org.eclipse.jdt.core.compiler.InvalidInputException: Invalid_Char_In_String
at org.eclipse.jdt.internal.core.util.PublicScanner.getNextToken(PublicScanner.java:1470)
at org.eclipse.jdt.ls.core.internal.handlers.FoldingRangeHandler.computeFoldingRanges(FoldingRangeHandler.java:110)
at org.eclipse.jdt.ls.core.internal.handlers.FoldingRangeHandler.foldingRange(FoldingRangeHandler.java:61)
at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$25(JDTLanguageServer.java:781)
at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$42(JDTLanguageServer.java:915)
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)

Extension version: 0.47.0
VS Code version: Code 1.37.1 (f06011ac164ae4dc8e753a3fe7f9549844d15e35, 2019-08-15T16:17:55.855Z)
OS version: Windows_NT x64 10.0.17763

System Info
Item Value
CPUs Intel(R) Core(TM) i5-8350U CPU @ 1.70GHz (8 x 1896)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
oop_rasterization: disabled_off
protected_video_decode: enabled
rasterization: enabled
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.85GB (7.08GB free)
Process Argv
Screen Reader no
VM 0%

Activity

  1. max-cool commented on Aug 22, 2019

    @max-cool

    I stopped by to say that I'm having a similar issue. Intellisense will randomly stop after using VS Code for some time; it seems to break when loading certain method suggestions after typing a dot. After that, Intellisense stops completely.

    I get the following javascript errors in the console when this happens (not sure how to see the java exceptions @ccerghed reports however).

    ERR Unexpected token C in JSON at position 8666: SyntaxError: Unexpected token C in JSON at position 8666
    	at JSON.parse (<anonymous>)
    	at d.onData (<userhome>\.vscode\extensions\redhat.java-0.47.0\dist\extension.js:1:95843)
    	at Socket.module.exports.listen.readable.on.e (<userhome>\.vscode\extensions\redhat.java-0.47.0\dist\extension.js:1:95207)
    	at Socket.emit (events.js:182:13)
    	at addChunk (_stream_readable.js:283:12)
    	at readableAddChunk (_stream_readable.js:264:11)
    	at Socket.Readable.push (_stream_readable.js:219:10)
    	at Pipe.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
    
    16log.ts:173   ERR Header must provide a Content-Length property.: Error: Header must provide a Content-Length property.
    	at d.onData (<userhome>\.vscode\extensions\redhat.java-0.47.0\dist\extension.js:1:95470)
    	at Socket.module.exports.listen.readable.on.e (<userhome>\.vscode\extensions\redhat.java-0.47.0\dist\extension.js:1:95207)
    	at Socket.emit (events.js:182:13)
    	at addChunk (_stream_readable.js:283:12)
    	at readableAddChunk (_stream_readable.js:264:11)
    	at Socket.Readable.push (_stream_readable.js:219:10)
    	at Pipe.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
    

    I am running Windows 10 and VS Code 1.37.1 as well.

  2. max-cool commented on Aug 22, 2019

    @max-cool

    As an update, I can consistently trigger the Javascript errors when typing "System."

  3. max-cool commented on Aug 28, 2019

    @max-cool

    Is anyone looking at this? I may have to use a different tool as intellisense breaking frequently is disruptive

  4. fbricon commented on Aug 28, 2019

    @fbricon
    Collaborator

    @maxi-billion can you provide the message output after turning on verbose tracing?

  5. max-cool commented on Aug 28, 2019

    @max-cool

    The javascript errors don't appear to be any different after enabling verbose tracing. The server log file also doesn't appear to report anything scary, but here it is anyways. This is in the timeframe of typing "System." to trigger the issue

    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:29.902
    !MESSAGE Workspace initialized in 1453ms
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:30.003
    !MESSAGE >> initialization job finished
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:30.028
    !MESSAGE >> workspace/didChangeConfiguration
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:30.090
    !MESSAGE >>New configuration: {java={home=null, jdt={ls={vmargs=-noverify -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication}}, errors={incompleteClasspath={severity=warning}}, configuration={checkProjectSettingsExclusions=false, updateBuildConfiguration=automatic, maven={userSettings=null}}, trace={server=verbose}, import={maven={enabled=true}, gradle={enabled=true, wrapper={enabled=true}, version=null, arguments=null, jvmArguments=null, home=null}, 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.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]}, 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.0}}, selectionRange={enabled=true}, debug={logLevel=warn, settings={showHex=false, showStaticVariables=false, showQualifiedNames=false, showLogicalStructure=true, showToString=true, maxStringLength=0.0, hotCodeReplace=manual, enableRunDebugCodeLens=true, forceBuildBeforeLaunch=true, console=integratedTerminal}}}}
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:33.880
    !MESSAGE >> document/didOpen
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:36.270
    !MESSAGE >> document/documentSymbol
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:36.286
    !MESSAGE >> document/foldingRange
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:36.326
    !MESSAGE >> workspace/executeCommand java.intellicode.enable
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:36.330
    !MESSAGE >> workspace/executeCommand vscode.java.resolveMainMethod
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:36.341
    !MESSAGE >> workspace/executeCommand vscode.java.resolveMainMethod
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:36.351
    !MESSAGE >> document/didChange
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:36.387
    !MESSAGE >> document/completion
    
    !ENTRY java-debug 1 0 2019-08-28 14:54:36.389
    !MESSAGE Starting com.microsoft.java.debug.plugin
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:37.038
    !MESSAGE Reconciled 0. Took 211 ms
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:38.240
    !MESSAGE begin problem for /LoginController.java
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:38.242
    !MESSAGE 2 problems reported for /LoginController.java
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:38.399
    !MESSAGE Validated 1. Took 892 ms
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:41.557
    !MESSAGE Completion request completed
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:41.799
    !MESSAGE >> document/foldingRange
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:41.802
    !MESSAGE >> document/didChange
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:41.949
    !MESSAGE >> document/didChange
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:42.134
    !MESSAGE >> document/foldingRange
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:42.137
    !MESSAGE >> workspace/executeCommand vscode.java.resolveMainMethod
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:42.140
    !MESSAGE >> document/codeAction
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:42.145
    !MESSAGE >> workspace/executeCommand java.intellicode.completion
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:42.147
    !MESSAGE >> document/didChange
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:42.260
    !MESSAGE >> document/didChange
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:42.266
    !MESSAGE >> document/didChange
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:42.271
    !MESSAGE >> document/foldingRange
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:42.281
    !MESSAGE >> workspace/executeCommand vscode.java.resolveMainMethod
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:42.283
    !MESSAGE >> document/codeAction
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:42.285
    !MESSAGE >> document/documentSymbol
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:42.286
    !MESSAGE >> document/codeAction
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:42.290
    !MESSAGE >> document/didChange
    
    !ENTRY com.microsoft.jdtls.intellicode.core 1 0 2019-08-28 14:54:42.424
    !MESSAGE Completion request completed
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:42.704
    !MESSAGE >> workspace/executeCommand java.intellicode.completion
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:42.705
    !MESSAGE >> document/foldingRange
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:42.707
    !MESSAGE >> workspace/executeCommand vscode.java.resolveMainMethod
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:42.708
    !MESSAGE >> document/codeAction
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:42.709
    !MESSAGE >> document/documentSymbol
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:42.712
    !MESSAGE >> document/documentSymbol
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:42.714
    !MESSAGE >> document/codeAction
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:42.716
    !MESSAGE >> workspace/executeCommand java.intellicode.completion
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:42.717
    !MESSAGE >> workspace/executeCommand sts.java.addClasspathListener
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:42.718
    !MESSAGE >> workspace/executeCommand vscode.java.resolveMainMethod
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:43.117
    !MESSAGE Reconciled 0. Took 9 ms
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:43.131
    !MESSAGE User abort while collecting the document symbols.
    
    !ENTRY com.microsoft.jdtls.intellicode.core 1 0 2019-08-28 14:54:43.316
    !MESSAGE Completion request completed
    
    !ENTRY com.microsoft.jdtls.intellicode.core 1 0 2019-08-28 14:54:43.334
    !MESSAGE Completion request completed
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:43.666
    !MESSAGE begin problem for /LoginController.java
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:43.678
    !MESSAGE 2 problems reported for /LoginController.java
    
    !ENTRY org.eclipse.jdt.ls.core 1 0 2019-08-28 14:54:43.777
    !MESSAGE Validated 1. Took 236 ms
    
  6. snjeza commented on Aug 28, 2019

    @snjeza
    Collaborator

    @maxi-billion Could you disable the Spring Tools and Visual Studio IntelliCode extension and try to reproduce the issue?

  7. max-cool commented on Aug 28, 2019

    @max-cool

    @snjeza You nailed it! With Visual Studio IntelliCode disabled, the plugin does not fail anymore.

    From searching IntelliCode in the issues here, it would seem this is a known issue, so I apologize.

  8. ccerghed commented on Aug 31, 2019

    @ccerghed
    Author

    Thank you, I disabled IntelliCode and it fixed the issue for me as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions