Liking cljdoc? Tell your friends :D

polylith.clj.core.shell.candidate.creators


candidateclj

(candidate value display parsed-value type args)

Creates a candidate which is later used by the jline library.

value: The value that will be inserted at the cursor in the shell, e.g. when a value is selected from the list of candidates below the cursor (the value may be displayed as e.g. 'projects' whereas the value is stored as 'projects:'.

display: The value that is displayed at the row below the cursor.

parsed-value: The value returned by the parse. Endings like : and / are removed by the parser, e.g. name: becomes name. Used when comparing values against the parsed values.

type: :candidates = Used if the value is stored directly in this candidate (:value, :display, and :parsed-value). :fn = Used in combination with :select to calculate the candidates by calling the given :function with the current candidate, workspace and groups as parameters. :remaining = Used when we want to pick the next remaining value from the group. The values for a group are stored in the 'groups' atom, and stored in the key 'group key' > 'param name' > :args, as a vector. group: Contains a map with the keys :id and :param. The :id key says which group this candidate belongs to and is used to switch to the next remaining group when we encounter a :next word, but also to set the :args value in the @groups atom for the group :id and :param if :param is given, which is later used to calculate the remaining candidates in the case :type is set to :remaining.

order: If set, then the candidate with the lowest number will be picked. Used in combination with the :group attribute. E.g. if two candidates has order set to 1 and 2 respectively, then the candidate with order 1 will be suggested first and the other value as second.

stay? Set to true if the cursor should stay with the current word. Used with e.g. values like name: so that a name can be given. If set to false, then the cursor will move to the next word by adding a space. A modified version of jline, com.github.polyfy/jline, is used to support this behaviour.

candidates If type is :candidates then this attribute may be set. Lists all the next possible candidates.

Creates a candidate which is later used by the jline library.

value:         The value that will be inserted at the cursor in the shell,
               e.g. when a value is selected from the list of candidates
               below the cursor (the value may be displayed as e.g.
               'projects' whereas the value is stored as 'projects:'.

display:       The value that is displayed at the row below the cursor.

parsed-value:  The value returned by the parse. Endings like : and / are
               removed by the parser, e.g. name: becomes name. Used when
               comparing values against the parsed values.

type:          :candidates = Used if the value is stored directly in this candidate
                             (:value, :display, and :parsed-value).
               :fn = Used in combination with :select to calculate the candidates by
                     calling the given :function with the current candidate,
                     workspace and groups as parameters.
               :remaining = Used when we want to pick the next remaining value from
                            the group. The values for a group are stored in the
                            'groups' atom, and stored in the key
                            'group key' > 'param name' > :args, as a vector.
group:         Contains a map with the keys :id and :param. The :id key says which
               group this candidate belongs to and is used to switch to the next
               remaining group when we encounter a :next word, but also to set the
               :args value in the @groups atom for the group :id and :param if :param
               is given, which is later used to calculate the remaining candidates
               in the case :type is set to :remaining.

order:         If set, then the candidate with the lowest number will be picked.
               Used in combination with the :group attribute. E.g. if two
               candidates has order set to 1 and 2 respectively, then the candidate
               with order 1 will be suggested first and the other value as second.

stay?          Set to true if the cursor should stay with the current word. Used
               with e.g. values like name: so that a name can be given. If set to
               false, then the cursor will move to the next word by adding a space.
               A modified version of jline, com.github.polyfy/jline, is used to
               support this behaviour.

candidates     If type is :candidates then this attribute may be set. Lists all the
               next possible candidates.
sourceraw docstring

flagclj

(flag value group-id & values)
source

flag-explicitclj

(flag-explicit value group-id & values)
source

fn-comma-argclj

(fn-comma-arg value group-id param function & values)
source

fn-explorerclj

(fn-explorer value group-id select-fn)
source

fn-explorer-childclj

(fn-explorer-child value entity color-mode group select-fn)
source

functionclj

(function f)
source

groupclj

(group id)
source

group-argclj

(group-arg value group-id param & values)
source

in-groupclj

(in-group group-id candidate)
source

multi-argclj

(multi-arg group-id param & values)
source

multi-fnclj

(multi-fn value & args)
source

multi-paramclj

(multi-param value & args)
source

optionalclj

(optional)
source

single-txtclj

(single-txt value & args)
source

with-valclj

(with-val candidate value)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close