Skip to content
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

Limit type proposals for Class<T> annotation elements to T or subtypes of T #419

Closed
eric-milles opened this issue Jan 9, 2018 · 2 comments · Fixed by #427
Closed

Limit type proposals for Class<T> annotation elements to T or subtypes of T #419

eric-milles opened this issue Jan 9, 2018 · 2 comments · Fixed by #427
Milestone

Comments

@eric-milles
Copy link
Member

When completing on annotation like JUnit's @RunWith, proposals should be filtered to Types and Static Members that are assignable to Runner.

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Inherited
public @interface RunWith {
    /**
     * @return a Runner class (must have a constructor that takes a single Class to run)
     */
    Class<? extends Runner> value();
}
import org.junit.runner.RunWith
import org.mockito.runners.MockitoJUnitRunner

@RunWith(MockitoJUnitRunner) // propose only classes and static final fields with matching type here
class SomeTests {
}
@eric-milles eric-milles added this to the v3.0.0 milestone Jan 9, 2018
@eric-milles
Copy link
Member Author

Classes and constants may just be a namespace that leads to a proper completion. This may need to be a relevance boost instead of a filter.

@eric-milles
Copy link
Member Author

Probably bump the relevance in GroovyProposalTypeSearchRequestor.processAcceptedTypes(JDTResolver) using the resolver for type lookups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant