use of org.eclipse.jdt.internal.codeassist.InternalCompletionContext 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;
}
use of org.eclipse.jdt.internal.codeassist.InternalCompletionContext 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
}
}
use of org.eclipse.jdt.internal.codeassist.InternalCompletionContext in project lombok by rzwitserloot.
the class PatchExtensionMethodCompletionProposal method getAssistNode.
private static ASTNode getAssistNode(CompletionProposalCollector completionProposalCollector) {
try {
InternalCompletionContext context = (InternalCompletionContext) Reflection.contextField.get(completionProposalCollector);
InternalExtendedCompletionContext extendedContext = (InternalExtendedCompletionContext) Reflection.extendedContextField.get(context);
if (extendedContext == null)
return null;
return (ASTNode) Reflection.assistNodeField.get(extendedContext);
} catch (Exception ignore) {
return null;
}
}
Aggregations