52938
|
1 |
/*
|
|
2 |
* Copyright (c) 2002-2018, the original author or authors.
|
|
3 |
*
|
|
4 |
* This software is distributable under the BSD license. See the terms of the
|
|
5 |
* BSD license in the documentation provided with this software.
|
|
6 |
*
|
58903
|
7 |
* https://opensource.org/licenses/BSD-3-Clause
|
52938
|
8 |
*/
|
|
9 |
package jdk.internal.org.jline.reader;
|
|
10 |
|
|
11 |
import java.util.List;
|
|
12 |
|
|
13 |
/**
|
|
14 |
* A completer is the mechanism by which tab-completion candidates will be resolved.
|
|
15 |
*
|
|
16 |
* @author <a href="mailto:mwp1@cornell.edu">Marc Prud'hommeaux</a>
|
|
17 |
* @author <a href="mailto:jason@planet57.com">Jason Dillon</a>
|
|
18 |
* @author <a href="mailto:gnodet@gmail.com">Guillaume Nodet</a>
|
|
19 |
* @since 2.3
|
|
20 |
*/
|
|
21 |
public interface Completer
|
|
22 |
{
|
|
23 |
/**
|
|
24 |
* Populates <i>candidates</i> with a list of possible completions for the <i>command line</i>.
|
|
25 |
*
|
|
26 |
* The list of candidates will be sorted and filtered by the LineReader, so that
|
|
27 |
* the list of candidates displayed to the user will usually be smaller than
|
|
28 |
* the list given by the completer. Thus it is not necessary for the completer
|
|
29 |
* to do any matching based on the current buffer. On the contrary, in order
|
|
30 |
* for the typo matcher to work, all possible candidates for the word being
|
|
31 |
* completed should be returned.
|
|
32 |
*
|
|
33 |
* @param reader The line reader
|
|
34 |
* @param line The parsed command line
|
|
35 |
* @param candidates The {@link List} of candidates to populate
|
|
36 |
*/
|
|
37 |
void complete(LineReader reader, ParsedLine line, List<Candidate> candidates);
|
|
38 |
}
|