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

VSCode Java isn't running the latest code #223

Closed
ZZYSonny opened this issue Jan 26, 2018 · 7 comments
Closed

VSCode Java isn't running the latest code #223

ZZYSonny opened this issue Jan 26, 2018 · 7 comments
Assignees
Labels
Milestone

Comments

@ZZYSonny
Copy link

ZZYSonny commented Jan 26, 2018

When I changed something in the code and run it, VSCode is running the old version and give me the old response. When I run the code for the second time without changing it, it runs the new one.

Environment
  • Operating System: Mac 10.13.3
  • JDK version:9.0.4
  • Visual Studio Code version:1.19.3
  • Java extension version:0.17.0
  • Java Debugger extension version:0.5.0
Steps To Reproduce
  1. Open any code, run once (First output in the photo)
  2. Quickly change part of code, run immediately, check the response (Second output in the photo)
  3. Run the code without changing any thing, check the response (Third output in the photo)
Current Result

2018-01-26 8 56 13
2018-01-26 8 55 45

Expected Result

Response at 2 should be same with 3

Additional Informations

If not running immediately, it will run the latest code. Probably need some delay before running?

@andxu
Copy link
Contributor

andxu commented Mar 2, 2018

Interesting finding, we will wait for the signal of build complete before launching, can you share your launch.json and tasks.json(if you have) in your .vscode folder?

@ZZYSonny
Copy link
Author

ZZYSonny commented Mar 5, 2018

Java Language Service plugin automatically do the compile so I think there is no need to have a task.json file to build. And I remember at early version of debug plugin, it waits for the compile.
2018-03-05 11 28 47
2018-03-05 11 29 03

@andxu
Copy link
Contributor

andxu commented Mar 6, 2018

I cannot reproduce it no matter how fast I change my code, would you please upgrade to the latest version and try to reproduce it:

Language support for Java:0.20.0
Java Debugger extension version:0.6.0

@ZZYSonny
Copy link
Author

ZZYSonny commented Mar 6, 2018

Still reproducible on latest version (Language support 0.20.0, Debugger 0.6.0, VSCode 1.20.1)

It is more likely to happen when you immediately press F5 to run the code after making one change. (Well probably that's what I usually do when I code) And it is also more likely to happen when the code is more complex.

I've made a gif to show. It happens both on Windows and Mac. And it is easier for me to record it on Windows.
2

@andxu andxu added bug and removed needs more info labels Mar 7, 2018
@andxu
Copy link
Contributor

andxu commented Mar 7, 2018

Based on your gif, it is because you don't save after edit, it should be a bug but is trivial and we will fix it later. I will create a new bug of this.

@bsaby
Copy link
Contributor

bsaby commented Mar 28, 2018

Test passed.

Vscode: 1.21.1
Java debug build: andy private build/39
Language support for java:0.21.0

@pedrobbarbosa
Copy link

Looks like a similar problem to the issue below:
#302 #302

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants