Commit 0ec9e247 authored by Romain Bioteau's avatar Romain Bioteau
Browse files

Fix groovy completion

parent 65d67aea
...@@ -69,6 +69,7 @@ public class VariablesTypeCompletionProposal implements IJavaCompletionProposalC ...@@ -69,6 +69,7 @@ public class VariablesTypeCompletionProposal implements IJavaCompletionProposalC
@Override @Override
public List<ICompletionProposal> computeCompletionProposals(final ContentAssistInvocationContext context, final IProgressMonitor monitor) { public List<ICompletionProposal> computeCompletionProposals(final ContentAssistInvocationContext context, final IProgressMonitor monitor) {
final List<ICompletionProposal> list = new ArrayList<ICompletionProposal>(); final List<ICompletionProposal> list = new ArrayList<ICompletionProposal>();
boolean extendContext = false;
try { try {
if (context instanceof JavaContentAssistInvocationContext) { if (context instanceof JavaContentAssistInvocationContext) {
final ITextViewer viewer = context.getViewer(); final ITextViewer viewer = context.getViewer();
...@@ -80,8 +81,7 @@ public class VariablesTypeCompletionProposal implements IJavaCompletionProposalC ...@@ -80,8 +81,7 @@ public class VariablesTypeCompletionProposal implements IJavaCompletionProposalC
if (coreContext != null && !coreContext.isExtended()) { if (coreContext != null && !coreContext.isExtended()) {
// must use reflection to set the fields // must use reflection to set the fields
ReflectionUtils.setPrivateField(InternalCompletionContext.class, "isExtended", coreContext, true); ReflectionUtils.setPrivateField(InternalCompletionContext.class, "isExtended", coreContext, true);
// ReflectionUtils.setPrivateField(InternalCompletionContext.class, "extendedContext", coreContext, extendContext = true;
// new GroovyExtendedCompletionContext(getContext(), requestor.currentScope));
} }
final ICompilationUnit unit = ((JavaContentAssistInvocationContext) context).getCompilationUnit(); final ICompilationUnit unit = ((JavaContentAssistInvocationContext) context).getCompilationUnit();
if (unit instanceof GroovyCompilationUnit) { if (unit instanceof GroovyCompilationUnit) {
...@@ -167,7 +167,7 @@ public class VariablesTypeCompletionProposal implements IJavaCompletionProposalC ...@@ -167,7 +167,7 @@ public class VariablesTypeCompletionProposal implements IJavaCompletionProposalC
} }
} finally { } finally {
final CompletionContext coreContext = ((JavaContentAssistInvocationContext) context).getCoreContext(); final CompletionContext coreContext = ((JavaContentAssistInvocationContext) context).getCoreContext();
if (coreContext != null && coreContext.isExtended()) { if (extendContext && coreContext != null && coreContext.isExtended()) {
// must use reflection to set the fields // must use reflection to set the fields
ReflectionUtils.setPrivateField(InternalCompletionContext.class, "isExtended", coreContext, false); ReflectionUtils.setPrivateField(InternalCompletionContext.class, "isExtended", coreContext, false);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment