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

Push lookupAnalyzedClass into Lookup #785

Merged
merged 1 commit into from
May 19, 2020

Conversation

dwijnand
Copy link
Member

... allowing users to optimize it - in both directions: in finding the
class or in not finding the class (i.e. without having to
lookupAnalysis).

... allowing users to optimize it - in both directions: in finding the
class or in not finding the class (i.e. without having to
lookupAnalysis).
@dwijnand dwijnand added this to the 1.4.0 milestone May 18, 2020
@retronym retronym merged commit 7935018 into sbt:develop May 19, 2020
@dwijnand dwijnand mentioned this pull request May 19, 2020
16 tasks
@dwijnand dwijnand deleted the Lookup.lookupAnalyzedClass branch May 19, 2020 06:56
@@ -55,6 +56,13 @@ class LookupImpl(compileConfiguration: CompileConfiguration, previousSetup: Opti
.flatMap(ext => ext.getExternalLookup().toOption)
.collect { case externalLookup: ExternalLookup => externalLookup }

override def lookupAnalyzedClass(binaryClassName: String): Option[AnalyzedClass] = {
externalLookup match { // not flatMap so that external lookup can fast-track returning None
Copy link
Member

@eed3si9n eed3si9n Jun 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to integrate this change into sbt, and I'm a bit confused. What does it mean for externalLookup.lookupAnalyzedClass(binaryClassName) to return None here?
sbt already implements externalLookup, so I would like a way to say I don't want to participate in AnalyzedClass lookup, but if I return None it would be interpreted as "I couldn't find the AnalyzedClass"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the current setup has no way for externalLookup.lookupAnalyzedClass to say "I don't know, you try". You'd have to modify this if you need that.

I'm not sure why Some(APIs.emptyAnalyzedClass) wasn't used for fast-track's "I got you, here's the API for that class name".

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

Successfully merging this pull request may close these issues.

3 participants