All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.pkl.thirdparty.jline.reader.CompletionMatcher Maven / Gradle / Ivy

Go to download

Fat Jar containing pkl-cli, pkl-codegen-java, pkl-codegen-kotlin, pkl-config-java, pkl-core, pkl-doc, and their shaded third-party dependencies.

There is a newer version: 0.27.1
Show newest version
/*
 * Copyright (c) 2002-2020, the original author(s).
 *
 * This software is distributable under the BSD license. See the terms of the
 * BSD license in the documentation provided with this software.
 *
 * https://opensource.org/licenses/BSD-3-Clause
 */
package org.pkl.thirdparty.jline.reader;

import java.util.List;
import java.util.Map;

public interface CompletionMatcher {

    /**
     * Compiles completion matcher functions
     *
     * @param options LineReader options
     * @param prefix invoked by complete-prefix or expand-or-complete-prefix widget
     * @param line The parsed line within which completion has been requested
     * @param caseInsensitive if completion is case insensitive or not
     * @param errors number of errors accepted in matching
     * @param originalGroupName value of JLineReader variable original-group-name
     */
    void compile(
            Map options,
            boolean prefix,
            CompletingParsedLine line,
            boolean caseInsensitive,
            int errors,
            String originalGroupName);

    /**
     *
     * @param candidates list of candidates
     * @return a list of candidates that completion matcher matches
     */
    List matches(List candidates);

    /**
     *
     * @return a candidate that have exact match, null if no exact match found
     */
    Candidate exactMatch();

    /**
     *
     * @return a common prefix of matched candidates
     */
    String getCommonPrefix();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy