-
Notifications
You must be signed in to change notification settings - Fork 456
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
regression: autobuild doesn't watch resources #1834
Comments
Looks like I have same problem. Whenever I change a Java source file, looks like the file is compiled (at least syntax is checked and any error in the file is reported) but the rest of the classes are not validated (If, for example, I change a method name, errors from other classes referencing the old name are not shown in the PROBLEMS tab). I have to Java: Force Java Compilation (Full) to get the errors. Environment
|
I can't reproduce the issue. Could you try the following:
|
Looks like that fixed my problem. Thanks @snjeza |
@snjeza my issue is still reproducible after following your troubleshooting steps. I don't think I have the same problem as @rubensa; he's complaining about Java source files. My issue is about resources in After following your steps, I still see that updating a file in |
@rothfels Could you attach your .project, .classpath and settings.json files? |
Sorry for the delay @snjeza. I made a minimal example with our project configs. However I cannot reproduce this issue in that project. I dug a little deeper, I think there is something specific to our project causing this error: (from the language server log)
If this is not a general problem, feel free to close the issue. If you have recommendations to help me identify the file/resource(s) in our project causing this failure, please let me know. :) |
More debugging info: Our Java project root is actually in a subdirectory of our repo/workspace: If I open the Java project root in VS Code, the file watcher initializes properly. Is there a way to set the Java project root for the language server? Perhaps this isn't a bug, but I think it's a regression from previous behavior. We didn't have problems with the file watcher until somewhat recently, whereas our project structure has been static for quite some time. We've always had our VS Code workspace root one directory above our Java project directory. |
@rothfels could you attach your settings. json or the java.format.settings.url property? |
^ we modified it to work around #1827 Workspace structure:
(moving the formatter settings into the |
Removing |
@rothfels Could you try
|
@snjeza yes, that also fixes the problem. Thank you! 🎉 |
We have a
.classpath
like this:Until recently, the Java language server would automatically update
target/classes
whenever files insrc/main/resources
would change. This was useful; we run a watch process in development to compile TS -> JS and output the generated code insrc/main/resources
.Now, it seems only Java sources (in
src/main/java
) are being watched. The autobuild setting correctly generates new bytecode whenever .java files change. But it does not copy over resources that are updated.We can work around this by putting our compiled resources directly in
target/classes
, but it seems like the language server should follow the classpath directives and do this automatically for us (as it used to). Instead, we now have toJava: Force Java Compilation (Full)
to get the language server to copy over the resources whenever they change.Environment
MacOS 11.2.1
openjdk 15.0.1 2020-10-20
1.54.3
0.76.0
The text was updated successfully, but these errors were encountered: