Obsolete
Status Update
Comments
uc...@google.com <uc...@google.com>
rp...@google.com <rp...@google.com> #2
I think it makes a perfect sense as a feature request and is indeed distinct from other issues you referenced. Thanks for filing!
mm...@commonsware.com <mm...@commonsware.com> #3
I have CCed stakeholders and leaving the feature request assigned to myself for now.
al...@google.com <al...@google.com>
cm...@google.com <cm...@google.com>
so...@google.com <so...@google.com> #4
Thanks for accepting this request, having this would be fantastic in my opinion (and my team's)!
Description
Build #AI-171.4443003, built on November 9, 2017
JRE: 1.8.0_152-release-915-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.13.0-21-generic
Steps to Reproduce:
1. Create a new Android Studio 3.0.1 project, with whatever settings you want
2. Add a Java library module
3. Add Google's AutoValue to the Java library module
4. Use the AutoValue builder pattern for some class
Expected Results: Nothing out of the ordinary
Actual Results: The editor claims that the generated AutoValue_ builder class is not recognized, even though it is code-generated
The attached project demonstrates the problem. In the lib/ module, I have:
package com.commonsware.lib;
import com.google.auto.value.AutoValue;
@AutoValue
public abstract class AnotherModel {
public abstract String foo();
public static Builder builder() {
return new AutoValue_AnotherModel.Builder();
}
@AutoValue.Builder
public abstract static class Builder {
public abstract Builder foo(String foo);
public abstract AnotherModel build();
}
}
The reference to the AutoValue_AnotherModel.Builder class is highlighted in red. However:
- The class gets generated and shows up in the generated/ tree
- The class works (see the instrumentation tests in the app/ module)
- An equivalent class in app/ (SomeModel) does not have the highlight problem
So, for a plain Java library module, the editor does not appear to be taking generated classes into account with the source code highlighting.