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