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" }
(autopair-widget line-reader)
create AutopairWidgets on the currently bound line-reader
create AutopairWidgets on the currently bound *line-reader*
(create service & [options])
Creates a line reader takes a service as an argument.
A service implements the multimethods found in repl-balance.service
Example: (create (repl-balance.clojure.service.local/create)) Or: (create (repl-balance.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 `repl-balance.service` Example: (create (repl-balance.clojure.service.local/create)) Or: (create (repl-balance.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
(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.
(format-data-eval-result {:keys [out err result printed-result exception]
:as eval-result})
(parsed-line {:keys [word-index word word-cursor words tokens line cursor]
:as parse-data})
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close