Package javarepl.completion

Examples of javarepl.completion.CompletionResult.position()


    public void returnsCompletions() throws Exception {
        client.execute("life = 42");
        CompletionResult result = client.completions("li");

        assertThat(result.expression(), is("li"));
        assertThat(result.position(), is(0));
        assertThat(result.candidates().map(candidateValue()), is(one("life")));
    }


    @Test
View Full Code Here


                return new jline.console.completer.Completer() {
                    public int complete(String expression, int cursor, List<CharSequence> candidates) {
                        try {
                            CompletionResult result = client.completions(expression);
                            candidates.addAll(asList(toJson(result)));
                            return result.candidates().isEmpty() ? -1 : result.position();
                        } catch (Exception e) {
                            return -1;
                        }
                    }
                };
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.