redhat-developer / vscode-java

Java Language Support for Visual Studio Code
Eclipse Public License 2.0
2.08k stars 440 forks source link

Updating <project name> configuration loop; caused by Minecraft Forge gradle files #231

Open ChiriVulpes opened 7 years ago

ChiriVulpes commented 7 years ago

Minecraft Forge gradle files work in IntelliJ IDEA but not VSCode.

Environment
Steps To Reproduce
  1. Clone my minecraft mod Souls
  2. Open folder with VSCode

The log is this, and then a loop of the last six lines:

!SESSION 2017-06-03 16:45:35.469 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_131-1-redhat
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_GB
Command-line arguments:  -data C:\Users\Mackenzie\AppData\Roaming\Code\User\workspaceStorage\eec2e905684d7da75bbb15d11fbd8a81\redhat.java\jdt_ws

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:45:39.050
!MESSAGE class org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin is started

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:45:39.182
!MESSAGE >> initialize

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:45:39.187
!MESSAGE Initializing Java Language Server 0.1.0.201705312123

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:45:39.204
!MESSAGE Creating the default Java project

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:45:39.232
!MESSAGE >> workspace/didChangeConfiguration

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:45:40.169
!MESSAGE Finished creating the default Java project

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:45:42.649
!MESSAGE >>New configuration: {java={configuration={maven={userSettings=null}, updateBuildConfiguration=interactive}, errors={incompleteClasspath={severity=warning}}, home=null, jdt={ls={vmargs=-noverify -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication}}, referencesCodeLens={enabled=true}, trace={server=off}}}

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:45:42.653
!MESSAGE Importing Gradle project(s)

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:45:42.657
!MESSAGE >> document/didOpen
!SESSION 2017-06-03 16:45:59.705 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_131-1-redhat
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_GB
Command-line arguments:  -data C:\Users\Mackenzie\AppData\Roaming\Code\User\workspaceStorage\eec2e905684d7da75bbb15d11fbd8a81\redhat.java\jdt_ws

!ENTRY org.eclipse.core.resources 2 10035 2017-06-03 16:46:00.644
!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:00.796
!MESSAGE class org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin is started

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:00.888
!MESSAGE >> initialize

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:00.893
!MESSAGE Initializing Java Language Server 0.1.0.201705312123

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:00.922
!MESSAGE >> workspace/didChangeConfiguration

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:01.650
!MESSAGE >>New configuration: {java={configuration={maven={userSettings=null}, updateBuildConfiguration=interactive}, errors={incompleteClasspath={severity=warning}}, home=null, jdt={ls={vmargs=-noverify -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication}}, referencesCodeLens={enabled=true}, trace={server=off}}}

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:01.655
!MESSAGE Importing Gradle project(s)

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:01.663
!MESSAGE >> document/didOpen
!SESSION 2017-06-03 16:46:10.907 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_131-1-redhat
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_GB
Command-line arguments:  -data C:\Users\Mackenzie\AppData\Roaming\Code\User\workspaceStorage\eec2e905684d7da75bbb15d11fbd8a81\redhat.java\jdt_ws

!ENTRY org.eclipse.core.resources 2 10035 2017-06-03 16:46:11.659
!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:11.797
!MESSAGE class org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin is started

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:11.871
!MESSAGE >> initialize

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:11.875
!MESSAGE Initializing Java Language Server 0.1.0.201705312123

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:11.907
!MESSAGE >> workspace/didChangeConfiguration

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:12.524
!MESSAGE >>New configuration: {java={configuration={maven={userSettings=null}, updateBuildConfiguration=interactive}, errors={incompleteClasspath={severity=warning}}, home=null, jdt={ls={vmargs=-noverify -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication}}, referencesCodeLens={enabled=true}, trace={server=off}}}

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:12.528
!MESSAGE Importing Gradle project(s)

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:12.532
!MESSAGE >> document/didOpen

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:22.151
!MESSAGE begin problem for ModInfo.java

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:22.155
!MESSAGE end reporting for ModInfo.java

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:22.162
!MESSAGE >> document/codeAction

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:22.169
!MESSAGE >> workspace/didChangeWatchedFiles

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:22.186
!MESSAGE >> workspace/didChangeWatchedFiles

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:22.194
!MESSAGE >> workspace/didChangeWatchedFiles

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:22.199
!MESSAGE >> workspace/didChangeWatchedFiles

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:34.849
!MESSAGE >> document/didClose

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:34.852
!MESSAGE DocumentLifeCycleHandler.handleClosed

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:45.585
!MESSAGE >> java/projectConfigurationUpdate

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:45.590
!MESSAGE Starting Gradle update for souls

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:45.595
!MESSAGE Updated souls in 5 ms

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:46.037
!MESSAGE >> workspace/didChangeConfiguration

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:46.040
!MESSAGE >>New configuration: {java={configuration={maven={userSettings=null}, updateBuildConfiguration=interactive}, errors={incompleteClasspath={severity=warning}}, home=null, jdt={ls={vmargs=-noverify -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication}}, referencesCodeLens={enabled=true}, trace={server=off}}}

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:46.122
!MESSAGE >> workspace/didChangeConfiguration

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:46.129
!MESSAGE >>New configuration: {java={configuration={maven={userSettings=null}, updateBuildConfiguration=automatic}, errors={incompleteClasspath={severity=warning}}, home=null, jdt={ls={vmargs=-noverify -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication}}, referencesCodeLens={enabled=true}, trace={server=off}}}

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:46.262
!MESSAGE >> workspace/didChangeConfiguration

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:46.265
!MESSAGE >>New configuration: {java={configuration={maven={userSettings=null}, updateBuildConfiguration=automatic}, errors={incompleteClasspath={severity=warning}}, home=null, jdt={ls={vmargs=-noverify -Xmx1G -XX:+UseG1GC -XX:+UseStringDeduplication}}, referencesCodeLens={enabled=true}, trace={server=off}}}

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:46.285
!MESSAGE >> workspace/didChangeWatchedFiles

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:46.295
!MESSAGE Starting Gradle update for souls

!ENTRY org.eclipse.jdt.ls.core 1 0 2017-06-03 16:46:46.300
!MESSAGE Updated souls in 6 ms

As a result of this, the dependencies don't seem to be downloaded because my java files contain lots of missing references.

fbricon commented 7 years ago

I don't see any configuration loop. The workspace/didChangeConfiguration event would be sent by vscode itself, not vscode-java, so it might be caused by a third-party plugin.

However, what I see is many compilation errors, that disappear eventually, when opening various files. Something's quite fishy there. But ultimately, everything look good

screen shot 2017-06-05 at 1 08 14 pm
fbricon commented 7 years ago

I can see compilation errors all over the place when reopening. That's really bad.

ChiriVulpes commented 7 years ago

I disabled all my extensions except for this one and it still seems to do it. When I first loaded the project, I clicked always on this prompt , which sets the .vscode/settings.json to:

{
    "java.configuration.updateBuildConfiguration": "automatic"
}

If I change this to interactive it stops looping, but every time I open the project it shows the same prompt again, and it doesn't download the dependencies either. Is there something I'm doing wrong? My only Java setting is java.trace.server: verbose

ChiriVulpes commented 7 years ago

I'm not sure why I had ignored it, but I had ignored the .classpath and .project files that were autogenerated by IDEA. Seems like that's what causes the loop. I don't really understand the files, maybe they're incorrect? I committed them, so it should be easier to figure out now anyway.

ChiriVulpes commented 7 years ago

I'm not sure if I wasn't patient enough back when I posted this issue, but I just tried working on this project in vscode again--after around 5-10 minutes of the project being open I don't get the loop anymore, and all the types load in.

Nightenom commented 6 years ago

Sorry for bumping this, I have the same issue, did you found out any at least "almost" working solution? Did deleting .classpath and .project worked?

ChiriVulpes commented 6 years ago

There are multiple ways I used to fix it, the primary way being to just start debugging it, and sometimes that will load everything in. Otherwise, you can try this batch script that I used to use:

rmdir .gradle /s /q
rmdir bin /s /q
rmdir build /s /q
del .project
del .classpath
gradlew setupDecompWorkspace

Run this with VSCode closed, then re-open when it's finished. It may work for you. Sorry I don't have more concrete advice.

fbricon commented 6 years ago

I think this was fixed by https://github.com/eclipse/eclipse.jdt.ls/issues/768. Guys, please try to install the latest CI build and let us know if you still experience this issue.

Nightenom commented 6 years ago

Meh I just read this is a bit different issue (dumb af) so disregard this comment Tried java-0.32.0-1213.vsix without any luck - nothing is link-clickable, the fresh setup doesn't seem to do anything since it takes a minute only