Search in sources :

Example 1 with Scope

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

the class PatchExtensionMethodCompletionProposal method getClassScope.

private static ClassScope getClassScope(CompletionProposalCollector completionProposalCollector) {
    ClassScope scope = null;
    try {
        InternalCompletionContext context = (InternalCompletionContext) Reflection.contextField.get(completionProposalCollector);
        InternalExtendedCompletionContext extendedContext = (InternalExtendedCompletionContext) Reflection.extendedContextField.get(context);
        if (extendedContext != null) {
            Scope assistScope = ((Scope) Reflection.assistScopeField.get(extendedContext));
            if (assistScope != null) {
                scope = assistScope.classScope();
            }
        }
    } catch (IllegalAccessException ignore) {
    // ignore
    }
    return scope;
}
Also used : InternalCompletionContext(org.eclipse.jdt.internal.codeassist.InternalCompletionContext) ClassScope(org.eclipse.jdt.internal.compiler.lookup.ClassScope) Scope(org.eclipse.jdt.internal.compiler.lookup.Scope) InternalExtendedCompletionContext(org.eclipse.jdt.internal.codeassist.InternalExtendedCompletionContext) ClassScope(org.eclipse.jdt.internal.compiler.lookup.ClassScope)

Aggregations

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