Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build on save skips when java.format.settings.url is invalid #916

Closed
riccardobl opened this issue May 7, 2019 · 12 comments · Fixed by eclipse-jdtls/eclipse.jdt.ls#1029
Closed
Assignees
Labels
Milestone

Comments

@riccardobl
Copy link

It appears that version 0.43.0 introduced a bug that causes the autobuild (build on save) to randomly skip.

I'm not sure if this is related to the size or layout (main gradle project with 3 subprojects) of my project, but this is what is happening:

  • A program that is started after the code has been changed will run with the old code (the changes are not reflected).
  • If the program is already running in debug mode, hot reload doesn't work.

If vscode is restarted after the save, the program will always start with the updated code as expected, if the same file is saved multiple times (literally spamsaved), one of the saves will trigger the build, also sometimes but very rarely it seems to just work on the first save ¯\(ツ)/¯.

I've tried to downgrade to 0.42.1 keeping the same project and same configuration and this version worked as expected, then i tried again 0.43 and 0.44 and both presented the issue.

  • Operating System: Ubuntu 18.04 - 5.0.7-050007-generic
  • JDK version: Zulu 8.38.0.13-CA-linux64 (openjdk8)
  • Visual Studio Code version: 1.33.1
  • Java extension version: 0.44.0
@snjeza
Copy link
Contributor

snjeza commented May 8, 2019

@riccardobl Could you provide a project example?

@riccardobl
Copy link
Author

riccardobl commented May 8, 2019

Sure: Test.zip

So... my first guess of it being somehow related to the project layout was wrong, since it presents itself even on this simple single file project.

This is a short video that shows the issue on version 0.44.0 : https://www.youtube.com/watch?v=FMX0qtNA-YA

@fbricon
Copy link
Collaborator

fbricon commented May 8, 2019

Works for me on macOS, using the debug codelens of the vscode-java-debug extension. You seem to use a custom launcher, can you please share your .vscode/launch.json?

@riccardobl
Copy link
Author

riccardobl commented May 8, 2019

It's included in the archive attached to my previous reply. > https://github.com/redhat-developer/vscode-java/files/3156518/Test.zip

@fbricon
Copy link
Collaborator

fbricon commented May 8, 2019

I see. Still works for me though. Do you have Java autobuild enabled in your preferences?
You can also try to make sure the "Java Debug: Force Build before launch" preference is enabled (it shouldn't be necessary though)

@riccardobl
Copy link
Author

Java Debug: Force Build before launch seems to be on by default.

My user settings are

{
    "telemetry.enableCrashReporter": false,
    "telemetry.enableTelemetry": false,
    "editor.suggestSelection": "first",
    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
    "files.exclude": {
        "**/.classpath": true,
        "**/.project": true,
        "**/.settings": true,
        "**/.factorypath": true
    },
    "java.home":"/DEV/VMS/zulu8.38.0.13-ca-fx-jdk8.0.212-linux_x64",
    "window.menuBarVisibility": "toggle",
    "debug.toolBarLocation": "docked",
    "window.zoomLevel": 0,
    "java.autobuild.enabled": true,
    "extensions.autoUpdate": false
}

And extensions:
Screenshot from 2019-05-08 16-10-44

@fbricon
Copy link
Collaborator

fbricon commented May 8, 2019

Tested with Zulu JDK 1.8.212, on Ubuntu 19.04, still works perfectly.

@snjeza
Copy link
Contributor

snjeza commented May 8, 2019

My user settings are

Do you have the <your_project>/ .vscode/settings.json file?

@riccardobl
Copy link
Author

Do you have the <your_project>/ .vscode/settings.json file?

No, everything i have is included in the zip file.

@snjeza
Copy link
Contributor

snjeza commented May 8, 2019

@riccardobl I can't reproduce the issue too.
Could you try add the following properties:

"java.debug.settings.forceBuildBeforeLaunch": true,
"java.debug.settings.enableHotCodeReplace": true,

@riccardobl
Copy link
Author

riccardobl commented May 8, 2019

So.. i started with a clean install and i tried to enable settings and extensions one by one until it broke, it turned out being caused by a typo in the java.format.settings.url path.

Sorry if i made you waste time, I didn't even think about this since the older version worked.

@snjeza
Copy link
Contributor

snjeza commented May 8, 2019

So i started with a clean install and i tried to enable settings and extensions one by one until it broke, it turned out being caused by a typo in the java.format.settings.url path.

That is a bug.

@snjeza snjeza self-assigned this May 8, 2019
@fbricon fbricon changed the title Build on save skips on 0.43.0 and 0.44.0 Build on save skips when java.format.settings.url is invalid May 9, 2019
@fbricon fbricon added the bug label May 9, 2019
@fbricon fbricon added this to the Mid May 2019 milestone May 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants