Liking cljdoc? Tell your friends :D

nrepl.util.completion

Code completion functionality.

This namespace is based on compliment-lite. (https://github.com/alexander-yakushev/compliment/tree/master/lite)

The functionality here is experimental and the API is subject to changes.

Code completion functionality.

This namespace is based on compliment-lite.
(https://github.com/alexander-yakushev/compliment/tree/master/lite)

The functionality here is experimental and the API is subject to changes.
raw docstring

*extra-metadata*clj

Signals to downstream sources which additional information about completion candidates they should attach . Should be a set of keywords.

Signals to downstream sources which additional information about completion
candidates they should attach . Should be a set of keywords.
sourceraw docstring

aliased-candidatesclj

(aliased-candidates prefix ns)

Returns a list of alias-qualified double-colon keywords (like ::str/foo), where alias has to be registered in the given namespace.

Returns a list of alias-qualified double-colon keywords (like ::str/foo),
where alias has to be registered in the given namespace.
sourceraw docstring

all-sourcesclj

(all-sources)
(all-sources source-kws)

Returns the list of all completion sources, or the selected once specified by source-kws.

Returns the list of all completion sources, or the selected once specified by
`source-kws`.
sourceraw docstring

cache-last-resultcljmacro

(cache-last-result name key value)

If cache for name is absent, or key doesn't match the key in the cache, calculate v and return it. Else return value from cache.

If cache for `name` is absent, or `key` doesn't match the key in the cache,
calculate `v` and return it. Else return value from cache.
sourceraw docstring

cache-last-result*clj

(cache-last-result* name key value-fn)
source

camel-case-matches?clj

(camel-case-matches? prefix member-name)

Tests if prefix matches the member name following camel case rules. Thus, prefix getDeF matches member getDeclaredFields.

Tests if prefix matches the member name following camel case rules.
Thus, prefix `getDeF` matches member `getDeclaredFields`.
sourceraw docstring

class-member-symbol?clj

(class-member-symbol? x)

Tests if a symbol name looks like a non-static class member.

Tests if a symbol name looks like a non-static class member.
sourceraw docstring

classes-candidatesclj

(classes-candidates prefix ns _)

Returns a list of classname completions.

Returns a list of classname completions.
sourceraw docstring

classes-on-classpathclj

(classes-on-classpath)

Returns a map of all classes that can be located on the classpath. Key represent the root package of the class, and value is a list of all classes for that package.

Returns a map of all classes that can be located on the classpath. Key
represent the root package of the class, and value is a list of all classes
for that package.
sourceraw docstring

completionsclj

(completions prefix)
(completions prefix ns)
(completions prefix
             ns
             {:keys [sort-order sources extra-metadata plain-candidates]
              :or {sort-order :by-name}})

Returns a list of completions for the given prefix.

Options map can contain the following options:

  • :ns - namespace where completion is initiated;
  • :sort-order (either :by-length or :by-name);
  • :plain-candidates - if true, returns plain strings instead of maps;
  • :extra-metadata - set of extra fields to add to the maps;
  • :sources - list of source keywords to use.
Returns a list of completions for the given prefix.

Options map can contain the following options:
- :ns - namespace where completion is initiated;
- :sort-order (either :by-length or :by-name);
- :plain-candidates - if true, returns plain strings instead of maps;
- :extra-metadata - set of extra fields to add to the maps;
- :sources - list of source keywords to use.
sourceraw docstring

dash-matches?clj

(dash-matches? prefix var)

Tests if prefix partially matches a var name with dashes as separators.

Tests if prefix partially matches a var name with dashes as
separators.
sourceraw docstring

defsourceclj

(defsource name & {:as kw-args})

Defines a source with the given name and argument map. Map must contain two keys - :candidates and :doc.

Value of :candidatesshould be a function of prefix, namespace and context.

Value of :doc latter should be a function of symbol name and namespace.

Defines a source with the given name and argument map. Map must
contain two keys - `:candidates` and `:doc`.

Value of `:candidates`should be a function of prefix, namespace and
context.

Value of `:doc` latter should be a function of symbol name and
namespace.
sourceraw docstring

ensure-nsclj

(ensure-ns nspc)

Takes either a namespace object or a symbol and returns the corresponding namespace if it exists, otherwise returns user namespace.

Takes either a namespace object or a symbol and returns the corresponding
namespace if it exists, otherwise returns `user` namespace.
sourceraw docstring

fuzzy-matches-no-skip?clj

(fuzzy-matches-no-skip? prefix symbol separator?)

Tests if symbol matches the prefix where separator? checks whether character is a separator. Unlike fuzzy-matches? requires separator characters to be present in prefix.

Tests if symbol matches the prefix where separator? checks whether character
is a separator. Unlike `fuzzy-matches?` requires separator characters to be
present in prefix.
sourceraw docstring

fuzzy-matches?clj

(fuzzy-matches? prefix symbol separator)

Tests if symbol matches the prefix when symbol is split into parts on separator.

Tests if symbol matches the prefix when symbol is split into parts on
separator.
sourceraw docstring

get-all-membersclj

(get-all-members ns context-class)

Returns all non-static members for a given namespace.

Returns all non-static members for a given namespace.
sourceraw docstring

keyword-candidatesclj

(keyword-candidates prefix ns _)
source

list-jdk9-base-classfilescljmacro

(list-jdk9-base-classfiles)

Because on JDK9+ the classfiles are stored not in rt.jar on classpath, but in modules, we have to do extra work to extract them.

Because on JDK9+ the classfiles are stored not in rt.jar on classpath, but in
modules, we have to do extra work to extract them.
sourceraw docstring

literal-candidatesclj

(literal-candidates prefix _ __)

We define true, false, and nil in a separate source because they are not context-dependent (don't have to be first items in the list).

We define `true`, `false`, and `nil` in a separate source because they are
not context-dependent (don't have to be first items in the list).
sourceraw docstring

members-cacheclj

Stores cache of all non-static members for every namespace.

Stores cache of all non-static members for every namespace.
sourceraw docstring

members-candidatesclj

(members-candidates prefix ns _)

Returns a list of Java non-static fields and methods candidates.

Returns a list of Java non-static fields and methods candidates.
sourceraw docstring

namespace-alias-candidatesclj

(namespace-alias-candidates prefix ns)

Returns a list of namespace aliases prefixed by double colon required in the given namespace.

Returns a list of namespace aliases prefixed by double colon required in the
given namespace.
sourceraw docstring

namespaces&files-on-classpathclj

(namespaces&files-on-classpath)

Returns a collection of maps (e.g. {:ns-str "some.ns", :file "some/ns.cljs"}) of all clj/cljc/cljs namespaces obtained by classpath scanning.

Returns a collection of maps (e.g. `{:ns-str "some.ns", :file
"some/ns.cljs"}`) of all clj/cljc/cljs namespaces obtained by classpath
scanning.
sourceraw docstring

namespaces-candidatesclj

(namespaces-candidates prefix ns _)

Returns a list of namespace and classname completions.

Returns a list of namespace and classname completions.
sourceraw docstring

nscl-matches?clj

(nscl-matches? prefix namespace)

Tests if prefix partially matches a namespace or classname with periods as separators.

Tests if prefix partially matches a namespace or classname with periods as
separators.
sourceraw docstring

nscl-symbol?clj

(nscl-symbol? x)

Tests if prefix looks like a namespace or classname.

Tests if prefix looks like a namespace or classname.
sourceraw docstring

populate-members-cacheclj

(populate-members-cache ns classes imported-classes-cnt)

Populate members cache of class members for ns from the given list of classes. imported-classes-cnt is a number that indicates the current number of imported classes in this namespace.

Populate members cache of class members for `ns` from the given list of
classes. `imported-classes-cnt` is a number that indicates the current number
of imported classes in this namespace.
sourceraw docstring

populate-static-members-cacheclj

(populate-static-members-cache class)

Populates static members cache for a given class.

Populates static members cache for a given class.
sourceraw docstring

primitive-cacheclj

source

qualified-candidatesclj

(qualified-candidates prefix ns)

Returns a list of namespace-qualified double-colon keywords (like ::foo) resolved for the given namespace.

Returns a list of namespace-qualified double-colon keywords (like ::foo)
resolved for the given namespace.
sourceraw docstring

resolve-classclj

(resolve-class ns sym)

Tries to resolve a classname from the given symbol, or returns nil if classname can't be resolved.

Tries to resolve a classname from the given symbol, or returns nil
if classname can't be resolved.
sourceraw docstring

resolve-namespaceclj

(resolve-namespace sym ns)

Tries to resolve a namespace from the given symbol, either from a fully qualified name or an alias in the given namespace.

Tries to resolve a namespace from the given symbol, either from a
fully qualified name or an alias in the given namespace.
sourceraw docstring

root-packages-on-classpathclj

(root-packages-on-classpath)

Return a set of all classname "TLDs" on the classpath.

Return a set of all classname "TLDs" on the classpath.
sourceraw docstring

special-candidatesclj

(special-candidates prefix _ _)

Returns list of completions for special forms.

Returns list of completions for special forms.
sourceraw docstring

split-by-leading-literalsclj

(split-by-leading-literals symbol-str)

Separate quote/var/deref qualifiers from a var name.

Separate quote/var/deref qualifiers from a var name.
sourceraw docstring

static-member-symbol?clj

(static-member-symbol? x)

Tests if prefix looks like a static member symbol, returns parsed parts.

Tests if prefix looks like a static member symbol, returns parsed parts.
sourceraw docstring

static-membersclj

(static-members class)

Returns all static members for a given class.

Returns all static members for a given class.
sourceraw docstring

static-members-cacheclj

Stores cache of all static members for every class.

Stores cache of all static members for every class.
sourceraw docstring

static-members-candidatesclj

(static-members-candidates prefix ns _)

Returns a list of static member candidates.

Returns a list of static member candidates.
sourceraw docstring

static?clj

(static? member)

Tests if class member is static.

Tests if class member is static.
sourceraw docstring

update-cacheclj

(update-cache ns)
(update-cache ns context-class)

Updates members cache for a given namespace if necessary.

Updates members cache for a given namespace if necessary.
sourceraw docstring

var-symbol?clj

(var-symbol? x)

Test if prefix resembles a var name.

Test if prefix resembles a var name.
sourceraw docstring

vars-candidatesclj

(vars-candidates prefix ns _)

Returns a list of namespace-bound candidates, with namespace being either the scope (if prefix is scoped), ns arg or the namespace extracted from context if inside ns declaration.

Returns a list of namespace-bound candidates, with namespace being
either the scope (if prefix is scoped), `ns` arg or the namespace
extracted from context if inside `ns` declaration.
sourceraw docstring

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

× close