Skip to content

Commit

Permalink
Limited doc update for info op
Browse files Browse the repository at this point in the history
(arglists-str, file, line, column, name, ns)

Sample CIDER response

(-->
  id         "18"
  op         "info"
  session    "cdbe8f64-e972-482c-9677-9ae456aaae96"
  time-stamp "2024-09-17 18:59:41.733894000"
  ns         "b"
  sym        "a/abc"
)
(<--
  id           "18"
  session      "cdbe8f64-e972-482c-9677-9ae456aaae96"
  time-stamp   "2024-09-17 18:59:41.736375000"
  arglists-str "[]"
  column       1
  file         "file:/D:/dev/clj/issue-cider-info/src/a.clj"
  line         3
  name         "abc"
  ns           "a"
  resource     "a.clj"
  status       ("done")
)
  • Loading branch information
ikappaki committed Sep 18, 2024
1 parent f7a2026 commit 3a2a24a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## master (unreleased)

[#885 (partial)](https://github.com/clojure-emacs/cider-nrepl/issues/885): Limited update to `info` op doc (`arglists-str`, `file`, `line`, `column`, `name` and `ns` return keys).

## 0.50.2 (2024-09-03)

* [#900](https://github.com/clojure-emacs/cider-nrepl/pull/900): Fix print middleware interfering with macroexpansion.
Expand Down
10 changes: 9 additions & 1 deletion doc/modules/ROOT/pages/nrepl-api/ops.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,8 @@ Returns::

Return a map of information about the specified symbol.

Note: Documentation may be incomplete; not all return keys are described.

Required parameters::
{blank}

Expand All @@ -460,9 +462,15 @@ If specified, the value will be concatenated to that of ``orchard.meta/var-meta-


Returns::
* `:arglists-str` The arguments list(s) accepted by the symbol, as a string, if applicable.
* `:column` The column number where the symbol is defined.
* `:doc-block-tags-fragments` May be absent. Represent the 'param', 'returns' and 'throws' sections a Java doc comment. It's a vector of fragments, where fragment is a map with ``:type`` ('text' or 'html') and ``:content`` plain text or html markup, respectively
* `:doc-first-sentence-fragments` May be absent. Represents the first sentence of a Java doc comment. It's a vector of fragments, where fragment is a map with ``:type`` ('text' or 'html') and ``:content`` plain text or html markup, respectively
* `:doc-fragments` May be absent. Represents the body of a Java doc comment, including the first sentence and excluding any block tags. It's a vector of fragments, where fragment is a map with ``:type`` ('text' or 'html') and ``:content`` plain text or html markup, respectively
* `:file` Either a URI or a relative path where the symbol is defined.
* `:line` The line number the symbol is defined.
* `:name` The unqualitfied name of the symbol.
* `:ns` The namespace the symbol belongs to.
* `:status` done


Expand Down Expand Up @@ -879,7 +887,7 @@ Required parameters::

Optional parameters::
* `:display-namespaces` How to print namespace-qualified symbols in the result. Possible values are "qualified" to leave all namespaces qualified, "none" to elide all namespaces, or "tidy" to replace namespaces with their aliases in the given namespace. Defaults to "qualified".
* `:expander` The macroexpansion function to use. Possible values are "macroexpand-1", "macroexpand", or "macroexpand-all". Defaults to "macroexpand".
* `:expander` The macroexpansion function to use. Possible values are "macroexpand-1", "macroexpand", "macroexpand-step", or "macroexpand-all". Defaults to "macroexpand".
* `:ns` The namespace in which to perform the macroexpansion. Defaults to 'user for Clojure and 'cljs.user for ClojureScript.
* `:print-meta` If truthy, also print metadata of forms.

Expand Down
13 changes: 11 additions & 2 deletions src/cider/nrepl.clj
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,18 @@ If specified, the value will be concatenated to that of `orchard.meta/var-meta-a
(cljs/requires-piggieback
{:requires #{#'session}
:handles {"info"
{:doc "Return a map of information about the specified symbol."
{:doc "Return a map of information about the specified symbol.
Note: Documentation may be incomplete; not all return keys are described."
:optional info-params
:returns (merge {"status" "done"} fragments-doc)}
:returns (merge {"arglists-str" "The arguments list(s) accepted by the symbol, as a string, if applicable."
"column" "The column number where the symbol is defined."
"file" "Either a URI or a relative path where the symbol is defined."
"line" "The line number the symbol is defined."
"name" "The unqualitfied name of the symbol."
"ns" "The namespace the symbol belongs to."
"status" "done"}
fragments-doc)}
"eldoc"
{:doc "Return a map of information about the specified symbol."
:optional info-params
Expand Down

0 comments on commit 3a2a24a

Please sign in to comment.