Skip to content

Commit

Permalink
Name it get-state instead
Browse files Browse the repository at this point in the history
  • Loading branch information
vemv committed Aug 9, 2023
1 parent cf0455c commit 5721ea2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

### New features

* Make the `track-state` middleware invokeable directly, by requesting the new `"cider/state"` op.
* Make the `track-state` middleware invokeable directly, by requesting the new `"cider/get-state"` op.
* This makes it possible to access `:changed-namespaces` info on demand, which can be necessary for:
* non-Piggieback based clojurescript repls
* re-computing the ns info responding to external (non-nREPL triggered) events.
Expand Down
28 changes: 14 additions & 14 deletions doc/modules/ROOT/pages/nrepl-api/ops.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1288,6 +1288,20 @@ Returns::



=== `cider/get-state`



Required parameters::
{blank}

Optional parameters::
{blank}

Returns::
{blank}


=== `cider/log-add-appender`

Add an appender to a log framework.
Expand Down Expand Up @@ -1593,17 +1607,3 @@ Returns::
* `:status` done
* `:cider/log-update-consumer` The consumer that was updated.



=== `cider/state`



Required parameters::
{blank}

Optional parameters::
{blank}

Returns::
{blank}
4 changes: 2 additions & 2 deletions src/cider/nrepl.clj
Original file line number Diff line number Diff line change
Expand Up @@ -661,10 +661,10 @@ stack frame of the most recent exception. This op is deprecated, please use the
ops-that-can-eval
(cljs/expects-piggieback
{:doc "Under its normal operation mode, enhances the `eval` op by notifying the client of the current REPL state.
You can also request to compute the info directly by requesting the \"cider/state\" op."
You can also request to compute the info directly by requesting the \"cider/get-state\" op."
:requires #{#'session}
:expects ops-that-can-eval
:handles {"cider/state" {}}
:handles {"cider/get-state" {}}
:returns {"repl-type" "`:clj` or `:cljs`."
"changed-namespaces" "A map of namespaces to `{:aliases ,,, :interns ,,,}`"}}))

Expand Down
2 changes: 1 addition & 1 deletion src/cider/nrepl/middleware/track_state.clj
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@

(defn handle-tracker [handler {:keys [op session] :as msg}]
(cond
(= "cider/state" op)
(= "cider/get-state" op)
(send ns-cache update-in [session] update-and-send-cache msg)

(ops-that-can-eval op)
Expand Down

0 comments on commit 5721ea2

Please sign in to comment.