Lines 18-23
Link Here
|
18 |
import org.eclipse.jdt.core.*; |
18 |
import org.eclipse.jdt.core.*; |
19 |
import org.eclipse.jdt.internal.codeassist.CompletionEngine; |
19 |
import org.eclipse.jdt.internal.codeassist.CompletionEngine; |
20 |
import org.eclipse.jdt.core.ICompilationUnit; |
20 |
import org.eclipse.jdt.core.ICompilationUnit; |
|
|
21 |
import org.eclipse.jdt.core.compiler.IProblem; |
22 |
import org.eclipse.jdt.core.eval.IEvaluationContext; |
21 |
import org.eclipse.jdt.internal.codeassist.RelevanceConstants; |
23 |
import org.eclipse.jdt.internal.codeassist.RelevanceConstants; |
22 |
|
24 |
|
23 |
import junit.framework.*; |
25 |
import junit.framework.*; |
Lines 12369-12372
Link Here
|
12369 |
COMPLETION_PROJECT.setOptions(options); |
12371 |
COMPLETION_PROJECT.setOptions(options); |
12370 |
} |
12372 |
} |
12371 |
} |
12373 |
} |
|
|
12374 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=139937 |
12375 |
public void testEvaluationContextCompletion() throws JavaModelException { |
12376 |
class EvaluationContextCompletionRequestor extends CompletionRequestor { |
12377 |
public boolean acceptContext; |
12378 |
public void acceptContext(CompletionContext context) { |
12379 |
this.acceptContext = context != null; |
12380 |
} |
12381 |
public void accept(CompletionProposal proposal) { |
12382 |
// Do nothing |
12383 |
} |
12384 |
} |
12385 |
String start = ""; |
12386 |
IJavaProject javaProject = getJavaProject("Completion"); |
12387 |
IEvaluationContext context = javaProject.newEvaluationContext(); |
12388 |
EvaluationContextCompletionRequestor rc = new EvaluationContextCompletionRequestor(); |
12389 |
context.codeComplete(start, start.length(), rc); |
12390 |
|
12391 |
assertTrue("acceptContext() method isn't call", rc.acceptContext); |
12392 |
} |
12372 |
} |
12393 |
} |