to reproduce the problem, run (on mac m1):
./mvnw -Dos.detected.classifier=osx-x86_64 compile
tree target/generated-sources/protobuf/
should see generated source- comment out
"java.autobuild.enabled": false
(default to true) - open
./src/main/java/io/grpc/examples/helloworld/service/GreeterImpl.java
and project should build automatcially and this file will show error tree target/generated-sources/protobuf/
should see generated source gone- repeate 1-6 but skip 3, you shouldn't see any errors
Observations:
It seems building manaually doesn't trigger this problem(full or incremental). The LSP issued was
[Trace - 16:56:34] Sending request 'java/buildWorkspace - (6)'.
Params: [
true
]
Init workspace will clean out the source code by default.
The java.autobuild.enabled
will set the initializationOptions.settings.java.autobuild.enabled
to
false
, which disables initial workspace build, and in turn won't clean our generated sources
You can check by inspecting java.output