-
Notifications
You must be signed in to change notification settings - Fork 408
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
External tool file modifications not registered #1650
Comments
I'm able to reproduce the behaviour as well but even going back as far as 0.50.0, I wasn't able to get the classfile to update based on a change from outside the workspace (on Linux). What's the last version of the java extension for which this was working for you ? I basically had an invisible project for which I'd add/remove a method to a source file using I think it's worth fixing, but would be nice to know if we regressed and whether it's platform specific. |
@rgrunber check the java.autobuild.enabled property. It should be true. |
I'm not overriding the default property value (true) and ProjectManager seems to set it correctly. |
@rgrunber I can't reproduce the issue. |
Yes, it was placed in the src/ folder at the top level of the invisible project folder. Here's the behaviour I'm seeing. Note that I think the server does receive a didChange(..) from the client in the case of "external" modifications, but it just doesn't seem to result in an update to the .class file. |
Are the extension updates logged? If not, I can't possibly recall what version I had when it was working... All I can tell is that it was working fine around last September (2020), and I'm pretty sure I had somewhat recently updated. |
Nope, still doesn't update :/ |
@fredg1 could you, please, reinstall https://github.com/snjeza/vscode-test/raw/master/java-0.76.2.vsix ? |
@snjeza It...worked, but it also added a new issue... It did register the new changes, but I also noted that it forcefully saves every open editor related to your project, even with unsaved changes... This is not to say that what you did was worthless, though, some of it did fix the problem! 1- I have unsaved edits on one of the files from my project. |
The patch resolves the issue for me. Any change I make gets reflected in the classfile even before I click run, through the debug extension. I'm not able to reproduce the issue of the save happening even when there's a prompt, but if this is behaviour introduced by the patch, then it should be fixed. I tried with setting |
I did also have an untitled file open, so maybe that's it |
@fredg1 could you reproduce the issue in VS Code 0.75.0? |
I'm able to reproduce this, but not the behaviour where the untitled file gets saved regardless. The behaviour (of prompting to save the untitled file) is also the same on 0.75.0 for me, so maybe this is an issue in the debug extension. It definitely would be nice to not prompt to save unrelated files. I have a simple project with a source file, Test.java that has a main method. It can even be unsaved. I also have a
I create a new file, Untitled-1 (File -> New File) and add some text to it. I keep Untitiled-1 as being the selected file, switch to the run tab, and launch "Launch Test". The dialog comes up to save the file even though it would be unrelated. I'm not sure if this is caused by our plugin though. As @snjeza mentions, it would be good to know your configuration to confirm this is the case. |
When triggering "Start Debugging" feature, VS Code will auto save the opened files. This is the default behavior of VS Code, not from debugger extension. The problem is it will show an extra save confirmation dialog if the current file is Untitled-1 file. This appears since VS Code 1.53. In VS Code 1.52, it won't pop up the dialog. Looks like VS Code did some change with the behavior in latest release. That's because you configured a preLaunchTask in launch.json. This save behavior is controlled by user setting "task.saveBeforeRun" (Save all dirty editors before running a task). If you don't want to see the prompt dialog, you can set it to "always" or "never". |
You don't get what happened; the prompt wasn't the issue. It was welcome, even. |
When you start debugging, VS Code will auto save launch.json. It requires to read the latest configuration from the launch.json, this is the expected behavior. I don't see there is problem with this. |
Whoops. Sorry, I didn't know. Here's an example using a .txt file instead. You know the worst part? You pointing that out was actually a good thing, since doing the test again highlight that the issue is still not solved for when using a PreLaunchTask (as you can see in the terminal, the text printed was the non-modified text) |
Modifications made to files by something other than through the Editor seem to no longer be picked up, and don't trigger a recompiling of the file(s).
Looks like the Java builder didn't detect the file change from external tool, and didn't recompile the class. This needs to be fixed at https://github.com/eclipse/eclipse.jdt.ls
Originally posted by @testforstephen in microsoft/vscode-java-debug#934 (comment)
The text was updated successfully, but these errors were encountered: