Search in sources :

Example 1 with LookupEnvironment

use of org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment in project lombok by rzwitserloot.

the class PatchExtensionMethodCompletionProposal method copyNameLookupAndCompletionEngine.

private static void copyNameLookupAndCompletionEngine(CompletionProposalCollector completionProposalCollector, IJavaCompletionProposal proposal, InternalCompletionProposal newProposal) {
    try {
        InternalCompletionContext context = (InternalCompletionContext) Reflection.contextField.get(completionProposalCollector);
        InternalExtendedCompletionContext extendedContext = (InternalExtendedCompletionContext) Reflection.extendedContextField.get(context);
        LookupEnvironment lookupEnvironment = (LookupEnvironment) Reflection.lookupEnvironmentField.get(extendedContext);
        Reflection.nameLookupField.set(newProposal, ((SearchableEnvironment) lookupEnvironment.nameEnvironment).nameLookup);
        Reflection.completionEngineField.set(newProposal, lookupEnvironment.typeRequestor);
    } catch (IllegalAccessException ignore) {
    // ignore
    }
}
Also used : LookupEnvironment(org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment) InternalCompletionContext(org.eclipse.jdt.internal.codeassist.InternalCompletionContext) InternalExtendedCompletionContext(org.eclipse.jdt.internal.codeassist.InternalExtendedCompletionContext)

Aggregations

InternalCompletionContext (org.eclipse.jdt.internal.codeassist.InternalCompletionContext)1 InternalExtendedCompletionContext (org.eclipse.jdt.internal.codeassist.InternalExtendedCompletionContext)1 LookupEnvironment (org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment)1