redhat-developer / vscode-java

Java Language Support for Visual Studio Code
Eclipse Public License 2.0
2.07k stars 429 forks source link

Android project doesn't include generated files from aidl #2855

Open yume-chan opened 1 year ago

yume-chan commented 1 year ago

When an Android project has aidl source files, the generated code is not included in source paths.

Environment
Steps To Reproduce
  1. Clone https://github.com/Genymobile/scrcpy
  2. Run ./gradlew assembleDebug, it builds successfully
  3. Open server/src/main/java/com/genymobile/scrcpy/wrappers/ClipboardManager.java
Current Result
The import android.content.IOnPrimaryClipChangedListener cannot be resolved Java(268435846)

log.txt client.log.txt

Expected Result

No error

Additional Informations

The interface android.content.IOnPrimaryClipChangedListener is generated from server/src/main/aidl/android/content/IOnPrimaryClipChangedListener.aidl to server/build/generated/aidl_source_output_dir/debug/out/android/content/IOnPrimaryClipChangedListener.java

CsCherrYY commented 1 year ago

Yeah, aidl is not supported now. @jdneo could you help mark this issue as a feature request?

yume-chan commented 1 year ago

Correct me if I'm wrong, the support should be added at https://github.com/eclipse/eclipse.jdt.ls/blob/master/org.eclipse.jdt.ls.core/gradle/android/init.gradle? If it's not too complex I want to give it a try.

CsCherrYY commented 1 year ago

@yume-chan you're right. That gradle file is an init script used when importing Android projects, which contains a Gradle plugin help buildship recognize Android project structure.

For aidl, a quick thought in my mind is that we should

AeolusLau commented 1 year ago

Any progress now?