use of javax.annotation.processing.Completion in project ceylon-compiler by ceylon.
the class TestCompletions method main.
public static void main(String... argv) {
String value = "value";
String message = "message";
Completion c = of(value, message);
if (!value.equals(c.getValue()) || !message.equals(c.getMessage()))
throw new RuntimeException("Bad full completion" + c);
c = of(value);
if (!value.equals(c.getValue()) || !"".equals(c.getMessage()))
throw new RuntimeException("Bad value completion" + c);
}
use of javax.annotation.processing.Completion in project java-common-lib by sosy-lab.
the class OptionAnnotationProcessor method returnPackagePrefixCompletions.
private Iterable<? extends Completion> returnPackagePrefixCompletions(Element element, String userText) {
List<Completion> packages = new ArrayList<>();
PackageElement pkg = elementUtils().getPackageOf(element);
if (!pkg.isUnnamed()) {
@Var String name = pkg.getQualifiedName().toString();
do {
if (!name.startsWith(userText)) {
break;
}
packages.add(Completions.of(name));
int pos = name.lastIndexOf('.');
name = name.substring(0, Math.max(pos, 0));
} while (!name.isEmpty());
}
return packages;
}
use of javax.annotation.processing.Completion in project ceylon by eclipse.
the class TestCompletions method main.
public static void main(String... argv) {
String value = "value";
String message = "message";
Completion c = of(value, message);
if (!value.equals(c.getValue()) || !message.equals(c.getMessage()))
throw new RuntimeException("Bad full completion" + c);
c = of(value);
if (!value.equals(c.getValue()) || !"".equals(c.getMessage()))
throw new RuntimeException("Bad value completion" + c);
}
Aggregations