Takes a string that is represents the current contents of a readline buffer and an integer position into that readline that represents the current position of the cursor.
Returns a boolean indicating wether the line is complete and should be accepted as input.
A service is not required to implement this fn, they would do this to override the default accept line behavior
Takes a string that is represents the current contents of a readline buffer and an integer position into that readline that represents the current position of the cursor. Returns a boolean indicating wether the line is complete and should be accepted as input. A service is not required to implement this fn, they would do this to override the default accept line behavior
Given a string returns a list of string repesentions of vars that match that string. This fn is already implemented on all the Clojure plaforms.
Given a string returns a list of string repesentions of vars that match that string. This fn is already implemented on all the Clojure plaforms.
Takes a word prefix and an options map}
The options map can contain
:ns
- the current namespace the completion is occuring in
:context
- a sexp form that contains a marker 'prefix
replacing the given prefix in teh expression where it is being
completed. i.e. '(list prefix 1 2)
Returns a list of candidates of the form
{:candidate "alength" :ns "clojure.core" :type :function}
Takes a word prefix and an options map} The options map can contain `:ns` - the current namespace the completion is occuring in `:context` - a sexp form that contains a marker '__prefix__ replacing the given prefix in teh expression where it is being completed. i.e. '(list __prefix__ 1 2) Returns a list of candidates of the form {:candidate "alength" :ns "clojure.core" :type :function}
Returns a string representation of the current ns in the current execution environment.
Returns nil if it hasn't been implemented for the current service
Returns a string representation of the current ns in the current execution environment. Returns nil if it hasn't been implemented for the current service
Given a string that represents a var, returns a map with documentation information for the named var or nil if no documentation is found.
A required :doc key which will hold a string of the documentation for the given var.
An optional :url key which will hold a url to the online documentation for the given var.
Given a string that represents a var, returns a map with documentation information for the named var or nil if no documentation is found. A required :doc key which will hold a string of the documentation for the given var. An optional :url key which will hold a url to the online documentation for the given var.
Given a clojure form this will evaluate that form and return a map of the outcome.
The returned map will contain a :result
key with a clj form that
represents the result of it will contain a :printed-result
key
if the form can only be returned as a printed value.
The returned map will also contain :out
and :err
keys
containing any captured output that occured during the evaluation
of the form.
Example: (-eval @api/line-reader 1) => {:result 1 :out "" :err ""}
If an exception is thrown this will return a throwable map under
the key :exception
Example: (-eval @api/line-reader '(defn)) => {:exception {:cause ...}}
An important thing to remember abou this eval is that it is used internally by the line-reader to implement various capabilities (line inline eval)
Given a clojure form this will evaluate that form and return a map of the outcome. The returned map will contain a `:result` key with a clj form that represents the result of it will contain a `:printed-result` key if the form can only be returned as a printed value. The returned map will also contain `:out` and `:err` keys containing any captured output that occured during the evaluation of the form. Example: (-eval @api/*line-reader* 1) => {:result 1 :out "" :err ""} If an exception is thrown this will return a throwable map under the key `:exception` Example: (-eval @api/*line-reader* '(defn)) => {:exception {:cause ...}} An important thing to remember abou this eval is that it is used internally by the line-reader to implement various capabilities (line inline eval)
Just like -eval
but takes and string and reads it before
sending it on to -eval
Just like `-eval` but takes and string and reads it before sending it on to `-eval`
Given a string with that contains clojure forms this will read
and return a map containing the first form in the string under the
key :form
Example: (-read-string @api/line-reader "1") => {:form 1}
If an exception is thrown this will return a throwable map under
the key :exception
Example: (-read-string @api/line-reader "#asdfasdfas") => {:exception {:cause ...}}
Given a string with that contains clojure forms this will read and return a map containing the first form in the string under the key `:form` Example: (-read-string @api/*line-reader* "1") => {:form 1} If an exception is thrown this will return a throwable map under the key `:exception` Example: (-read-string @api/*line-reader* "#asdfasdfas") => {:exception {:cause ...}}
Currently this finds and returns the meta data for the given string currently we are using the :ns, :name, :doc and :arglist meta data that is found on both vars, namespaces
This function should return the standard or enhanced meta information that is afor a given "word" that and editor can focus on.
(resolve (symbol var-str))
This function shouldn't throw errors but catch them and return nil if the var doesn't exist.
Currently this finds and returns the meta data for the given string currently we are using the :ns, :name, :doc and :arglist meta data that is found on both vars, namespaces This function should return the standard or enhanced meta information that is afor a given "word" that and editor can focus on. `(resolve (symbol var-str))` This function shouldn't throw errors but catch them and return nil if the var doesn't exist.
Given a string that represents a var Returns a map with source information for the var or nil if no source is found.
A required :source key which will hold a string of the source code for the given var.
An optional :url key which will hold a url to the source code in the context of the original file or potentially some other helpful url.
DESIGN NOTE the :url isn't currently used
Example result for (-source service "some?")
:
{:source "(defn ^boolean some? [x] \n(not (nil? x)))" :url "https://github.com[...]main/cljs/cljs/core.cljs#L243-L245" }
Given a string that represents a var Returns a map with source information for the var or nil if no source is found. A required :source key which will hold a string of the source code for the given var. An optional :url key which will hold a url to the source code in the context of the original file or potentially some other helpful url. DESIGN NOTE the :url isn't currently used Example result for `(-source service "some?")`: {:source "(defn ^boolean some? [x] \n(not (nil? x)))" :url "https://github.com[...]main/cljs/cljs/core.cljs#L243-L245" }
(accept-line line-str cursor)
(add-all-widgets line-reader)
(add-widgets-and-bindings line-reader)
(apropos wrd)
(bind-clojure-widgets km-name)
(bind-clojure-widgets-vi-cmd km-name)
(bind-indents km-name)
(candidate {:keys [candidate type ns]})
(cljs-quit-complete {:keys [word] :as parsed-line})
(clojure-completer)
(clojure-emacs-mode km-name)
(clojure-highlighter)
(clojure-vi-cmd-mode km-name)
(clojure-vi-insert-mode km-name)
(command-token? {:keys [line tokens word]} starts-with)
(complete-context parsed-line)
(completions word)
(completions word options)
(create service & [options])
Creates a line reader takes a service as an argument.
A service implements the multimethods found in rebel-readline.service
Example: (create (rebel-readline.clojure.service.local/create)) Or: (create (rebel-readline.clojure.service.simple/create))
This function also takes an optional options map.
The available options are:
:completer - to override the clojure based completer :highlighter - to override the clojure based systax highlighter :parser - to override the clojure base word parser
Creates a line reader takes a service as an argument. A service implements the multimethods found in `rebel-readline.service` Example: (create (rebel-readline.clojure.service.local/create)) Or: (create (rebel-readline.clojure.service.simple/create)) This function also takes an optional options map. The available options are: :completer - to override the clojure based completer :highlighter - to override the clojure based systax highlighter :parser - to override the clojure base word parser
(create* terminal service & [{:keys [completer highlighter parser]}])
(default-accept-line line-str cursor)
(default-prompt-fn)
(display-argument-help-message)
(display-less at-str)
(display-less at-str options)
(divide-into-displayable-columns coll total-width)
(doc wrd)
(eldoc-self-insert-hook)
This hooks SELF_INSERT to capture most keypresses that get echoed out to the terminal. We are using it here to display interactive behavior based on the state of the buffer at the time of a keypress.
This hooks SELF_INSERT to capture most keypresses that get echoed out to the terminal. We are using it here to display interactive behavior based on the state of the buffer at the time of a keypress.
(eliminate-long-outliers coll)
(ensure-newline s)
(evaluate form)
(evaluate-str form-str)
(find-completions candidates prefix)
(find-number-of-columns coll total-width)
(format-column wrd column)
(format-data-eval-result {:keys [out err result printed-result exception]
:as eval-result})
(format-pair-to-width wrd width [ns' name'])
(formatted-apropos wrd)
(in-place-eval)
(indent line-reader line cursor)
(indent-amount s cursor)
(indent-proxy-str s cursor)
(inline-result-marker at-str)
(limit-character-size s)
(make-parser)
(mean coll)
(name-arglist-display meta-data)
(no-greater-than limit val)
(one-space-after-funcall-word?)
(osc-hyper-link url show)
(parse-line line cursor)
(parsed-line {:keys [word-index word word-cursor words tokens line cursor]
:as parse-data})
(parsed-line-word-coords parsed-line)
(read-form form-str)
(repl-command-complete {:keys [word] :as parsed-line})
(replace-word-with-prefix parsed-line)
(resolve-meta wrd)
(row-width columns)
(source wrd)
(source-at-point)
(split-into-wrapped-lines at-str columns)
(standard-deviation coll)
(two-standards-plus-mean coll)
(window-lines at-str-lines pos rows)
(word-at-cursor)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close