Skip to content

Releases: tonsky/Clojure-Sublimed

3.8.0

08 Aug 16:51
Compare
Choose a tag to compare
  • clojure_sublimed_reindent command that reindents entire buffer if selection is empty and only selected lines if not

3.7.3

16 Jun 19:41
Compare
Choose a tag to compare
  • Fixed Socket REPL not working on Windows
  • Fixed Exception in settings on first install

3.7.2

05 May 13:51
Compare
Choose a tag to compare
  • Some defensive coding around default settings fallback #109

3.7.1

15 Mar 14:39
Compare
Choose a tag to compare
  • Added expand argument to clojure_sublimed_eval command

3.7.0

14 Mar 16:06
Compare
Choose a tag to compare
  • Added output.repl panel for raw nREPL output #104
  • Added Toggle Output Panel command for raw nREPL connections #104
  • Fixed Reconnect command
  • Added optional on_finish argument to cs_conn.eval
  • Added print_quota as a setting and as an argument to cs_conn.eval
  • New feature: Watches!

Watches

Watches are great alternative to debug prints: they allow you to monitor intermediate values during function execution right in the editor.

This is how they work:

  • Select a right-hand expression
  • Run Clojure Sublimed: Add Watch command
  • Now every time function is executed, for any reason, watched expressions will display values they evaluate to, in real time.

watch

Watches are only supported in Socket REPL.

3.6.0

05 Mar 19:25
Compare
Choose a tag to compare

Socket REPL: fixed escaping in clojure_sublimed_eval_code

See #103 via @KGOH

Display failed tests report as red

It was a bit confusing before when evaluation succeeded (normal value is reported, no exception has been thrown) so result was displayed as green, but in fact some tests still might have failed.

Clojure Sublimed now recognizes :fail and :error keys in result and if they are positive, displays results as red:

photo_2024-03-05 20 37 49

Add transform argument to clojure_sublimed_eval

See #101 #102

Clojure Sublimed now allows you to create custom commands that transform code before sending it to eval.

For example, this will pretty-print result of your evaluation to stdout:

{"keys":    ["ctrl+p"],
 "command": "clojure_sublimed_eval",
 "args":    {"transform": "(doto %code clojure.pprint/pprint)"}}

transform is a format string that takes selected form, formats it according to described rules and then sends resulting code to evaluation.

If you now press ctrl+p on a form like (+ 1 2), the actual eval sent to REPL will be:

(doto (+ 1 2) clojure.pprint/pprint)

Which will pretty-print evaluation result to stdout. This pattern might be useful for large results that don’t fit inline.

Another use-case might be “eval to buffer”:

{"keys":    ["ctrl+b"],
 "command": "chain",
 "args":    {
    "commands": [
      ["clojure_sublimed_eval", {"transform": "(with-open [w (clojure.java.io/writer \"/tmp/sublimed_output.edn\")] (doto %code (clojure.pprint/pprint w)))"}],
      ["open_file", {"file": "/tmp/sublimed_output.edn"}]
    ]
 }
}

Eval to buffer at work:

Inside transform you can also use %ns (current ns) and %symbol (if selected form is def-something, it will be replaced with defined name, otherwise nil).

This allows us to implement “run test under cursor”:

{"keys":    ["super+shift+t"],
 "command": "clojure_sublimed_eval",
 "args":    {"transform": "(clojure.test/run-test-var #'%symbol)"}}

Run test under cursor at work:

Enjoy!

3.5.0

05 Mar 19:22
Compare
Choose a tag to compare
  • Detect namespace from in-ns forms

3.4.1

07 Dec 15:39
Compare
Choose a tag to compare
  • Fixed status eval not clearing on disconnect

3.4.0

30 Nov 19:52
Compare
Choose a tag to compare
  • Support multiple windows, one connection per widnow
  • Support .repl-port files for Socket REPL

3.3.0

26 Oct 17:43
Compare
Choose a tag to compare
  • Eval inside already evaled region re-evals same region instead of going to top form
  • Printer can display newlines