dotemacs

My Emacs configuration
git clone git://git.entf.net/dotemacs
Log | Files | Refs | LICENSE

commit f115e437f4b6aaf019a2232a0c59b21b9b2608b6
parent 5c1648bc8373d63d8a38323eef24c463c8152a48
Author: Lukas Henkel <lh@entf.net>
Date:   Tue, 26 Dec 2023 12:11:56 +0100

Delete some packages I never actually use

Diffstat:
M.gitignore | 3+--
Delpa/cider-1.12.0.signed | 3---
Delpa/cider-1.12.0/.circleci/config.yml | 160-------------------------------------------------------------------------------
Delpa/cider-1.12.0/.codespellrc | 2--
Delpa/cider-1.12.0/.dir-locals.el | 37-------------------------------------
Delpa/cider-1.12.0/.github/CONTRIBUTING.md | 56--------------------------------------------------------
Delpa/cider-1.12.0/.github/FUNDING.yml | 8--------
Delpa/cider-1.12.0/.github/ISSUE_TEMPLATE/bug_report.md | 53-----------------------------------------------------
Delpa/cider-1.12.0/.github/ISSUE_TEMPLATE/feature_request.md | 20--------------------
Delpa/cider-1.12.0/.github/PULL_REQUEST_TEMPLATE.md | 22----------------------
Delpa/cider-1.12.0/.github/stale.yml | 62--------------------------------------------------------------
Delpa/cider-1.12.0/.github/workflows/spell_checking.yml | 33---------------------------------
Delpa/cider-1.12.0/.github/workflows/test.yml | 102-------------------------------------------------------------------------------
Delpa/cider-1.12.0/.projectile | 3---
Delpa/cider-1.12.0/CHANGELOG.md | 1770-------------------------------------------------------------------------------
Delpa/cider-1.12.0/Eldev | 59-----------------------------------------------------------
Delpa/cider-1.12.0/Makefile | 37-------------------------------------
Delpa/cider-1.12.0/README.md | 273-------------------------------------------------------------------------------
Delpa/cider-1.12.0/ROADMAP.md | 112-------------------------------------------------------------------------------
Delpa/cider-1.12.0/Vagrantfile | 8--------
Delpa/cider-1.12.0/cider-apropos.el | 210-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-autoloads.el | 688-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-browse-ns.el | 550-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-browse-spec.el | 455-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-cheatsheet.el | 577-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-classpath.el | 109-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-client.el | 904-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-clojuredocs.el | 171-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-common.el | 467-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-completion-context.el | 122-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-completion.el | 293-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-connection.el | 1083-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-debug.el | 796-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-doc.el | 582------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-docstring.el | 165-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-eldoc.el | 523-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-eval.el | 1809-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-find.el | 285-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-format.el | 154-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-inspector.el | 794-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-jar.el | 141-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-log.el | 1429-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-macroexpansion.el | 204-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-mode.el | 1107-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-ns.el | 273-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-overlays.el | 362-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-pkg.el | 2--
Delpa/cider-1.12.0/cider-popup.el | 157-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-profile.el | 216-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-repl-history.el | 721-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-repl.el | 2069-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-resolve.el | 130-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-scratch.el | 100-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-selector.el | 174-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-stacktrace.el | 980-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-test.el | 942-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-tracing.el | 90-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-util.el | 817-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-xref-backend.el | 166-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider-xref.el | 185-------------------------------------------------------------------------------
Delpa/cider-1.12.0/cider.el | 2165-------------------------------------------------------------------------------
Delpa/cider-1.12.0/clojure.sh | 54------------------------------------------------------
Delpa/cider-1.12.0/codespell.txt | 5-----
Delpa/cider-1.12.0/dev/deps.edn | 5-----
Delpa/cider-1.12.0/dev/docker-sample-project/.dir-locals.el | 4----
Delpa/cider-1.12.0/dev/docker-sample-project/Dockerfile | 9---------
Delpa/cider-1.12.0/dev/docker-sample-project/Makefile | 5-----
Delpa/cider-1.12.0/dev/docker-sample-project/README.md | 14--------------
Delpa/cider-1.12.0/dev/docker-sample-project/project.clj | 5-----
Delpa/cider-1.12.0/dev/docker-sample-project/src/bar.clj | 2--
Delpa/cider-1.12.0/dev/docker-sample-project/src/foo.clj | 3---
Delpa/cider-1.12.0/dev/generate_html_fragments.clj | 33---------------------------------
Delpa/cider-1.12.0/dev/tramp-sample-project/Dockerfile | 45---------------------------------------------
Delpa/cider-1.12.0/dev/tramp-sample-project/Makefile | 10----------
Delpa/cider-1.12.0/dev/tramp-sample-project/README.md | 26--------------------------
Delpa/cider-1.12.0/dev/tramp-sample-project/project.clj | 6------
Delpa/cider-1.12.0/dev/tramp-sample-project/src/foo.clj | 3---
Delpa/cider-1.12.0/lein.sh | 45---------------------------------------------
Delpa/cider-1.12.0/nrepl-client.el | 1508-------------------------------------------------------------------------------
Delpa/cider-1.12.0/nrepl-dict.el | 205-------------------------------------------------------------------------------
Delpa/geiser-0.30.signed | 3---
Delpa/geiser-0.30/.dir-locals.el | 4----
Delpa/geiser-0.30/README-elpa | 299-------------------------------------------------------------------------------
Delpa/geiser-0.30/dir | 18------------------
Delpa/geiser-0.30/doc/cheat.texi | 251-------------------------------------------------------------------------------
Delpa/geiser-0.30/doc/dir | 18------------------
Delpa/geiser-0.30/doc/geiser.css | 116-------------------------------------------------------------------------------
Delpa/geiser-0.30/doc/geiser.texi | 124-------------------------------------------------------------------------------
Delpa/geiser-0.30/doc/img/autodoc-multi.png | 0
Delpa/geiser-0.30/doc/img/autodoc-req.png | 0
Delpa/geiser-0.30/doc/img/autodoc-scm.png | 0
Delpa/geiser-0.30/doc/img/autodoc-var.png | 0
Delpa/geiser-0.30/doc/img/docstring-racket.png | 0
Delpa/geiser-0.30/doc/img/docstring.png | 0
Delpa/geiser-0.30/doc/img/eval-error.png | 0
Delpa/geiser-0.30/doc/img/geiser-mode.png | 0
Delpa/geiser-0.30/doc/img/guile-eval-error.png | 0
Delpa/geiser-0.30/doc/img/mod-completion.png | 0
Delpa/geiser-0.30/doc/img/repl-autodoc.png | 0
Delpa/geiser-0.30/doc/img/repl-images.png | 0
Delpa/geiser-0.30/doc/img/repl-menu.png | 0
Delpa/geiser-0.30/doc/img/repl-mod.png | 0
Delpa/geiser-0.30/doc/img/repls.png | 0
Delpa/geiser-0.30/doc/index.texi | 14--------------
Delpa/geiser-0.30/doc/install.texi | 157-------------------------------------------------------------------------------
Delpa/geiser-0.30/doc/intro.texi | 97-------------------------------------------------------------------------------
Delpa/geiser-0.30/doc/macros.texi | 47-----------------------------------------------
Delpa/geiser-0.30/doc/makefile | 37-------------------------------------
Delpa/geiser-0.30/doc/parens.texi | 664-------------------------------------------------------------------------------
Delpa/geiser-0.30/doc/repl.texi | 534-------------------------------------------------------------------------------
Delpa/geiser-0.30/doc/thanks.texi | 92-------------------------------------------------------------------------------
Delpa/geiser-0.30/doc/top.texi | 23-----------------------
Delpa/geiser-0.30/geiser-autodoc.el | 256-------------------------------------------------------------------------------
Delpa/geiser-0.30/geiser-autoloads.el | 170-------------------------------------------------------------------------------
Delpa/geiser-0.30/geiser-base.el | 96-------------------------------------------------------------------------------
Delpa/geiser-0.30/geiser-capf.el | 95-------------------------------------------------------------------------------
Delpa/geiser-0.30/geiser-compile.el | 84-------------------------------------------------------------------------------
Delpa/geiser-0.30/geiser-completion.el | 159-------------------------------------------------------------------------------
Delpa/geiser-0.30/geiser-connection.el | 286-------------------------------------------------------------------------------
Delpa/geiser-0.30/geiser-custom.el | 80-------------------------------------------------------------------------------
Delpa/geiser-0.30/geiser-debug.el | 313-------------------------------------------------------------------------------
Delpa/geiser-0.30/geiser-doc.el | 510-------------------------------------------------------------------------------
Delpa/geiser-0.30/geiser-edit.el | 341-------------------------------------------------------------------------------
Delpa/geiser-0.30/geiser-eval.el | 225-------------------------------------------------------------------------------
Delpa/geiser-0.30/geiser-image.el | 122-------------------------------------------------------------------------------
Delpa/geiser-0.30/geiser-impl.el | 354-------------------------------------------------------------------------------
Delpa/geiser-0.30/geiser-log.el | 145-------------------------------------------------------------------------------
Delpa/geiser-0.30/geiser-menu.el | 145-------------------------------------------------------------------------------
Delpa/geiser-0.30/geiser-mode.el | 444-------------------------------------------------------------------------------
Delpa/geiser-0.30/geiser-pkg.el | 2--
Delpa/geiser-0.30/geiser-popup.el | 74--------------------------------------------------------------------------
Delpa/geiser-0.30/geiser-reload.el | 85-------------------------------------------------------------------------------
Delpa/geiser-0.30/geiser-repl.el | 1295-------------------------------------------------------------------------------
Delpa/geiser-0.30/geiser-syntax.el | 568-------------------------------------------------------------------------------
Delpa/geiser-0.30/geiser-table.el | 137-------------------------------------------------------------------------------
Delpa/geiser-0.30/geiser-xref.el | 165-------------------------------------------------------------------------------
Delpa/geiser-0.30/geiser.el | 134-------------------------------------------------------------------------------
Delpa/geiser-0.30/geiser.info | 1849-------------------------------------------------------------------------------
Delpa/geiser-0.30/license | 29-----------------------------
Delpa/geiser-0.30/news.org | 415-------------------------------------------------------------------------------
Delpa/geiser-0.30/readme.org | 224-------------------------------------------------------------------------------
Delpa/geiser-guile-0.28.1.signed | 2--
Delpa/geiser-guile-0.28.1/geiser-guile-autoloads.el | 38--------------------------------------
Delpa/geiser-guile-0.28.1/geiser-guile-pkg.el | 2--
Delpa/geiser-guile-0.28.1/geiser-guile.el | 697-------------------------------------------------------------------------------
Delpa/geiser-guile-0.28.1/geiser-guile.texi | 103-------------------------------------------------------------------------------
Delpa/geiser-guile-0.28.1/license | 29-----------------------------
Delpa/geiser-guile-0.28.1/readme.org | 71-----------------------------------------------------------------------
Delpa/geiser-guile-0.28.1/src/geiser/completion.scm | 27---------------------------
Delpa/geiser-guile-0.28.1/src/geiser/doc.scm | 258-------------------------------------------------------------------------------
Delpa/geiser-guile-0.28.1/src/geiser/emacs.scm | 60------------------------------------------------------------
Delpa/geiser-guile-0.28.1/src/geiser/evaluation.scm | 163-------------------------------------------------------------------------------
Delpa/geiser-guile-0.28.1/src/geiser/modules.scm | 104-------------------------------------------------------------------------------
Delpa/geiser-guile-0.28.1/src/geiser/utils.scm | 52----------------------------------------------------
Delpa/geiser-guile-0.28.1/src/geiser/xref.scm | 84-------------------------------------------------------------------------------
Delpa/request-0.3.3.signed | 2--
Delpa/request-0.3.3/.elpaignore | 3---
Delpa/request-0.3.3/.github/workflows/test.yml | 102-------------------------------------------------------------------------------
Delpa/request-0.3.3/Cask | 8--------
Delpa/request-0.3.3/Makefile | 121-------------------------------------------------------------------------------
Delpa/request-0.3.3/README.rst | 225-------------------------------------------------------------------------------
Delpa/request-0.3.3/request-autoloads.el | 33---------------------------------
Delpa/request-0.3.3/request-deferred.el | 71-----------------------------------------------------------------------
Delpa/request-0.3.3/request-pkg.el | 2--
Delpa/request-0.3.3/request.el | 1260-------------------------------------------------------------------------------
Delpa/request-0.3.3/tools/install-cask.sh | 64----------------------------------------------------------------
Delpa/request-0.3.3/tools/install-evm.sh | 19-------------------
Delpa/request-0.3.3/tools/recipe | 1-
Delpa/request-0.3.3/tools/retry.sh | 28----------------------------
Delpa/vterm-20230417.424/CMakeLists.txt | 104-------------------------------------------------------------------------------
Delpa/vterm-20230417.424/elisp.c | 209-------------------------------------------------------------------------------
Delpa/vterm-20230417.424/elisp.h | 99-------------------------------------------------------------------------------
Delpa/vterm-20230417.424/emacs-module.h | 334-------------------------------------------------------------------------------
Delpa/vterm-20230417.424/etc/emacs-vterm-bash.sh | 55-------------------------------------------------------
Delpa/vterm-20230417.424/etc/emacs-vterm-zsh.sh | 54------------------------------------------------------
Delpa/vterm-20230417.424/etc/emacs-vterm.fish | 67-------------------------------------------------------------------
Delpa/vterm-20230417.424/utf8.c | 69---------------------------------------------------------------------
Delpa/vterm-20230417.424/utf8.h | 12------------
Delpa/vterm-20230417.424/vterm-autoloads.el | 81-------------------------------------------------------------------------------
Delpa/vterm-20230417.424/vterm-module.c | 1539-------------------------------------------------------------------------------
Delpa/vterm-20230417.424/vterm-module.h | 169-------------------------------------------------------------------------------
Delpa/vterm-20230417.424/vterm-pkg.el | 14--------------
Delpa/vterm-20230417.424/vterm.el | 1841-------------------------------------------------------------------------------
Minit.el | 2+-
184 files changed, 2 insertions(+), 47553 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -33,6 +33,5 @@ var /places /.mc-lists.el elpa/pdf-tools-*/epdfinfo -elpa/vterm-*/build +elpa/pdf-tools-*/server/ /.emacs.desktop* -/elpa/pdf-tools-1.1.0/server/ diff --git a/elpa/cider-1.12.0.signed b/elpa/cider-1.12.0.signed @@ -1,2 +0,0 @@ -Good signature from 066DAFCB81E42C40 GNU ELPA Signing Agent (2019) <elpasign@elpa.gnu.org> (trust undefined) created at 2023-11-24T23:05:06+0100 using RSA -Good signature from 645357D2883A0966 GNU ELPA Signing Agent (2023) <elpasign@elpa.gnu.org> (trust undefined) created at 2023-11-24T23:05:06+0100 using EDDSA -\ No newline at end of file diff --git a/elpa/cider-1.12.0/.circleci/config.yml b/elpa/cider-1.12.0/.circleci/config.yml @@ -1,160 +0,0 @@ -version: 2.1 - -orbs: - win: circleci/windows@2.2.0 - shellcheck: circleci/shellcheck@3.2.0 - -# Default actions to perform on each Emacs version -commands: - setup: - steps: - - checkout - - run: - name: Install Eldev - command: curl -fsSL https://raw.github.com/doublep/eldev/master/webinstall/circle-eldev > x.sh && source ./x.sh - - run: - name: Install unzip - command: apt-get update && apt-get install unzip - - macos-setup: - steps: - - checkout - - run: - name: Install Emacs latest - command: | - brew install homebrew/cask/emacs - - run: - name: Install Eldev - command: curl -fsSL https://raw.github.com/doublep/eldev/master/webinstall/circle-eldev > x.sh && source ./x.sh - - setup-windows: - steps: - - checkout - - run: - name: Install Eldev - command: | - # Remove expired DST Root CA X3 certificate. Workaround - # for https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51038 - # bug on Emacs 27.2. - gci cert:\LocalMachine\Root\DAC9024F54D8F6DF94935FB1732638CA6AD77C13 - gci cert:\LocalMachine\Root\DAC9024F54D8F6DF94935FB1732638CA6AD77C13 | Remove-Item - (iwr https://raw.github.com/doublep/eldev/master/webinstall/circle-eldev.ps1).Content | powershell -command - - test: - steps: - - run: - name: Run regression tests - command: eldev -dtT -p test - lint: - steps: - - run: - name: Run Elisp-lint - command: eldev lint - - run: - name: Byte-compile .el files - command: eldev -dtT compile --warnings-as-errors - -jobs: - test-ubuntu-emacs-26: - docker: - - image: silex/emacs:26-ci - entrypoint: bash - steps: - - setup - - test - - test-ubuntu-emacs-27: - docker: - - image: silex/emacs:27-ci - entrypoint: bash - steps: - - setup - - test - - test-ubuntu-emacs-28: - docker: - - image: silex/emacs:28-ci - entrypoint: bash - steps: - - setup - - test - test-ubuntu-emacs-29: - docker: - - image: silex/emacs:29-ci - entrypoint: bash - steps: - - setup - - test - - test-ubuntu-emacs-master: - docker: - - image: silex/emacs:master-ci - entrypoint: bash - steps: - - setup - - test - - test-macos-emacs-latest: - macos: - xcode: "14.0.0" - steps: - - macos-setup - - test - - test-windows-emacs-latest: - executor: win/default - steps: - - run: - name: Install Emacs latest - command: | - choco install emacs - - setup-windows - - test - - test-shellcheck: - docker: - - image: circleci/clojure:openjdk-17-lein-2.9.5-buster - steps: - - checkout - - shellcheck/install - - shellcheck/check - - test-lint: - docker: - - image: silex/emacs:28-ci - steps: - - setup - - lint - -workflows: - version: 2.1 - ci-test-matrix: - jobs: - - test-shellcheck - - test-lint - - test-ubuntu-emacs-26: - requires: - - test-lint - - test-shellcheck - - test-ubuntu-emacs-27: - requires: - - test-lint - - test-shellcheck - - test-ubuntu-emacs-28: - requires: - - test-lint - - test-shellcheck - - test-ubuntu-emacs-29: - requires: - - test-lint - - test-shellcheck - - test-ubuntu-emacs-master: - requires: - - test-lint - - test-shellcheck - - test-windows-emacs-latest: - requires: - - test-lint - - test-shellcheck - - test-macos-emacs-latest: - requires: - - test-ubuntu-emacs-28 diff --git a/elpa/cider-1.12.0/.codespellrc b/elpa/cider-1.12.0/.codespellrc @@ -1,2 +0,0 @@ -[codespell] -skip = .git,.eldev,logo diff --git a/elpa/cider-1.12.0/.dir-locals.el b/elpa/cider-1.12.0/.dir-locals.el @@ -1,37 +0,0 @@ -;;; Directory Local Variables -;;; For more information see (info "(emacs) Directory Variables") - -((emacs-lisp-mode - (bug-reference-url-format . "https://github.com/clojure-emacs/cider/issues/%s") - (bug-reference-bug-regexp . "#\\(?2:[[:digit:]]+\\)") - (indent-tabs-mode . nil) - (fill-column . 80) - (sentence-end-double-space . t) - (emacs-lisp-docstring-fill-column . 75) - (checkdoc-symbol-words . ("top-level" "major-mode" "macroexpand-all" "print-level" "print-length")) - (checkdoc-package-keywords-flag) - (checkdoc-arguments-in-order-flag) - (checkdoc-verb-check-experimental-flag) - (elisp-lint-indent-specs . ((if-let* . 2) - (when-let* . 1) - (let* . defun) - (nrepl-dbind-response . 2) - (cider-save-marker . 1) - (cider-propertize-region . 1) - (cider-map-repls . 1) - (cider--jack-in . 1) - (cider--make-result-overlay . 1) - ;; need better solution for indenting cl-flet bindings - (insert-label . defun) ;; cl-flet - (insert-align-label . defun) ;; cl-flet - (insert-rect . defun) ;; cl-flet - (cl-defun . 2) - (with-parsed-tramp-file-name . 2) - (thread-first . 0) - (thread-last . 0) - (transient-define-prefix . defmacro) - (transient-define-suffix . defmacro))))) - -;; To use the bug-reference stuff, do: -;; (add-hook 'text-mode-hook #'bug-reference-mode) -;; (add-hook 'prog-mode-hook #'bug-reference-prog-mode) diff --git a/elpa/cider-1.12.0/.github/CONTRIBUTING.md b/elpa/cider-1.12.0/.github/CONTRIBUTING.md @@ -1,56 +0,0 @@ -# Contributing - -If you discover issues, have ideas for improvements or new features, -please report them to the [issue tracker][1] of the repository or -submit a pull request. Please, try to follow these guidelines when you -do so. - -## Issue reporting - -* Check that the issue has not already been reported. -* Check that the issue has not already been fixed in the latest code - (a.k.a. `master`). -* Be clear, concise and precise in your description of the problem. -* Open an issue with a descriptive title and a summary in grammatically correct, - complete sentences. -* Mention your Emacs version and operating system. -* Mention the CIDER version info. You can use the REPL version info, which looks like that: - -```el -;; CIDER 0.12.0snapshot (package: 20160331.421), nREPL 0.2.12 -;; Clojure 1.8.0, Java 1.8.0_31 -``` - -* Include any relevant code to the issue summary. - -### Reporting bugs - -When reporting bugs it's a good idea to go through the [Troubleshooting section -of the manual][7]. Adding information like the backtrace and the nREPL messages to -the bug report makes it easier to track down bugs. Some steps to reproduce a bug -reliably would also make a huge difference. - -## Pull requests - -* Read the [Hacking on CIDER][8] manual section. -* Read [how to properly contribute to open source projects on Github][2]. -* Use a topic branch to easily amend a pull request later, if necessary. -* Use the same coding conventions as the rest of the project. -* Verify your Emacs Lisp code with `checkdoc` (<kbd>C-c ? d</kbd>). -* Make sure that the unit tests are passing (`eldev test`). -* Make sure that there are no lint warnings (`eldev lint`). -* Write [good commit messages][3]. -* Mention related tickets in the commit messages (e.g. `[Fix #N] Add command ...`). -* Update the [changelog][6]. -* [Squash related commits together][5]. -* Open a [pull request][4] that relates to *only* one subject with a clear title - and description in grammatically correct, complete sentences. - -[1]: https://github.com/clojure-emacs/cider/issues -[2]: http://gun.io/blog/how-to-github-fork-branch-and-pull-request -[3]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html -[4]: https://help.github.com/articles/using-pull-requests -[5]: http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html -[6]: https://github.com/clojure-emacs/cider/blob/master/CHANGELOG.md -[7]: http://cider.readthedocs.org/en/latest/troubleshooting/ -[8]: https://cider.readthedocs.io/en/latest/hacking_on_cider/ diff --git a/elpa/cider-1.12.0/.github/FUNDING.yml b/elpa/cider-1.12.0/.github/FUNDING.yml @@ -1,8 +0,0 @@ -# These are supported funding model platforms - -github: bbatsov -ko_fi: bbatsov -patreon: bbatsov -open_collective: cider -liberapay: bbatsov -custom: https://www.paypal.me/bbatsov diff --git a/elpa/cider-1.12.0/.github/ISSUE_TEMPLATE/bug_report.md b/elpa/cider-1.12.0/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,53 +0,0 @@ ---- -name: Bug Report -about: Report an issue with CIDER you've discovered. ---- - -*Use the template below when reporting bugs. Please, make sure that -you're running the latest stable CIDER and that the problem you're reporting -hasn't been reported (and potentially fixed) already.* - -**Remove all of the placeholder text in your final report!** - -## Expected behavior - -## Actual behavior - -## Steps to reproduce the problem - -*This is extremely important! Providing us with a reliable way to reproduce -a problem will expedite its solution.* - -## Environment & Version information - -### CIDER version information - -*Include here the version string displayed when -CIDER's REPL is launched. Here's an example:* - -``` -;; CIDER 0.12.0snapshot (package: 20160331.421), nREPL 0.2.12 -;; Clojure 1.8.0, Java 1.8.0_31 -``` - -### Lein / Clojure CLI version - -*E.g. Lein 2.6.1* - -### Emacs version - -*E.g. 24.5* (use <kbd>M-x emacs-version</kbd> to check it if unsure) - -### Operating system - -*E.g. Fedora 23, OS X 10.11 "El Capitan", Windows 10, etc* - -### JDK distribution - -*The JDK distribution are you using (e.g. Oracle, Temurin, Corretto), and its version. (run `java -version` for obtaining this)* - -*Please note that you should be running a JDK, not a JRE.* - -*If you are using a JDK through Docker, please indicate the Docker image being used.* - -*Please note that especially on Linux, JDK sources may be absent by default and require a separate installation step.* diff --git a/elpa/cider-1.12.0/.github/ISSUE_TEMPLATE/feature_request.md b/elpa/cider-1.12.0/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,20 +0,0 @@ ---- -name: Feature Request -about: Suggest new CIDER features or improvements to existing features. ---- - -**Is your feature request related to a problem? Please describe.** - -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** - -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** - -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** - -Add any other context or screenshots about the feature request here. diff --git a/elpa/cider-1.12.0/.github/PULL_REQUEST_TEMPLATE.md b/elpa/cider-1.12.0/.github/PULL_REQUEST_TEMPLATE.md @@ -1,22 +0,0 @@ -**Replace this placeholder text with a summary of the changes in your PR. -The more detailed you are, the better.** - ------------------ - -Before submitting the PR make sure the following things have been done (and denote this -by checking the relevant checkboxes): - -- [ ] The commits are consistent with our [contribution guidelines](../blob/master/.github/CONTRIBUTING.md) -- [ ] You've added tests (if possible) to cover your change(s) -- [ ] All tests are passing (`eldev test`) -- [ ] All code passes the linter (`eldev lint`) which is based on [`elisp-lint`](https://github.com/gonewest818/elisp-lint) and includes - - [byte-compilation](https://www.gnu.org/software/emacs/manual/html_node/elisp/Byte-Compilation.html), [`checkdoc`](https://www.gnu.org/software/emacs/manual/html_node/elisp/Tips.html), [check-declare](https://www.gnu.org/software/emacs/manual/html_node/elisp/Declaring-Functions.html), packaging metadata, indentation, and trailing whitespace checks. -- [ ] You've updated the [changelog](../blob/master/CHANGELOG.md) (if adding/changing user-visible functionality) -- [ ] You've updated the [user manual](../blob/master/doc) (if adding/changing user-visible functionality) - -Thanks! - -*If you're just starting out to hack on CIDER you might find this [section of its -manual][1] extremely useful.* - -[1]: https://docs.cider.mx/cider/contributing/hacking.html diff --git a/elpa/cider-1.12.0/.github/stale.yml b/elpa/cider-1.12.0/.github/stale.yml @@ -1,62 +0,0 @@ -# Configuration for probot-stale - https://github.com/probot/stale - -# Number of days of inactivity before an Issue or Pull Request becomes stale -daysUntilStale: 90 - -# Number of days of inactivity before an Issue or Pull Request with the stale label is closed. -# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. -daysUntilClose: 30 - -# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled) -onlyLabels: [] - -# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable -exemptLabels: - - "high priority" - - "good first issue" - - "pinned" - -# Set to true to ignore issues in a project (defaults to false) -exemptProjects: false - -# Set to true to ignore issues in a milestone (defaults to false) -exemptMilestones: true - -# Set to true to ignore issues with an assignee (defaults to false) -exemptAssignees: true - -# Label to use when marking as stale -staleLabel: stale - -# Comment to post when marking as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you - for your contribution and understanding! - -# Comment to post when removing the stale label. -# unmarkComment: > -# Your comment here. - -# Comment to post when closing a stale Issue or Pull Request. -closeComment: > - This issues been automatically closed due to lack of activity. Feel free to re-open it - if you ever come back to it. - -# Limit the number of actions per hour, from 1-30. Default is 30 -limitPerRun: 30 - -# Limit to only `issues` or `pulls` -# only: issues - -# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls': -# pulls: -# daysUntilStale: 30 -# markComment: > -# This pull request has been automatically marked as stale because it has not had -# recent activity. It will be closed if no further activity occurs. Thank you -# for your contributions. - -# issues: -# exemptLabels: -# - confirmed diff --git a/elpa/cider-1.12.0/.github/workflows/spell_checking.yml b/elpa/cider-1.12.0/.github/workflows/spell_checking.yml @@ -1,33 +0,0 @@ -name: Spell Checking - -on: [pull_request] - -jobs: - codespell: - name: Check spelling with codespell - runs-on: ubuntu-latest - strategy: - matrix: - python-version: [3.8] - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install codespell - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Check spelling with codespell - run: codespell --ignore-words=codespell.txt || exit 1 - misspell: - name: Check spelling with misspell - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Install - run: wget -O - -q https://git.io/misspell | sh -s -- -b . - - name: Misspell - run: ./misspell -error diff --git a/elpa/cider-1.12.0/.github/workflows/test.yml b/elpa/cider-1.12.0/.github/workflows/test.yml @@ -1,102 +0,0 @@ -name: CI - -# This `on:` configuration avoids double-triggered jobs (one for `push`, one for `pull_request`). -# Pull requests will still get jobs on every commit. -# However you won't get jobs on branch pushes that lack an associated pull requests. -# On the other hand, CircleCI jobs will still be triggered, which give a useful form of feedback. -# Lastly, remember that we have a Makefile for local development - you are encouraged to use it before pushing commits. -on: - push: - branches: - - master - pull_request: - -permissions: - contents: read # to fetch code (actions/checkout) - -jobs: - integration: - # Run integration tests for all OSs and EMACS_VERSIONs. - runs-on: ${{matrix.os}} - - strategy: - matrix: - os: [macos-latest, ubuntu-latest, windows-latest] - emacs_version: ['26.3', '27.2', '28.2', '29.1'] - java_version: ['11', '17'] - - steps: - - name: Set up Emacs - if: "!startsWith (matrix.os, 'windows')" - uses: purcell/setup-emacs@master - with: - version: ${{matrix.emacs_version}} - - - name: Set up Emacs on Windows - if: startsWith (matrix.os, 'windows') - uses: jcs090218/setup-emacs-windows@master - with: - version: ${{matrix.emacs_version}} - - - name: Install Eldev - if: "!startsWith (matrix.os, 'windows')" - run: curl -fsSL https://raw.github.com/doublep/eldev/master/webinstall/github-eldev | sh - - - name: Install Eldev on MS-Windows - if: startsWith (matrix.os, 'windows') - run: | - # Remove expired DST Root CA X3 certificate. Workaround - # for https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51038 - # bug on Emacs 27.2. - gci cert:\LocalMachine\Root\DAC9024F54D8F6DF94935FB1732638CA6AD77C13 - gci cert:\LocalMachine\Root\DAC9024F54D8F6DF94935FB1732638CA6AD77C13 | Remove-Item - - curl.exe -fsSL https://raw.github.com/doublep/eldev/master/webinstall/github-eldev.bat | cmd /Q - - - name: Install deps.clj on MS-Windows - if: startsWith (matrix.os, 'windows') - run: | - iwr -Uri https://raw.githubusercontent.com/borkdude/deps.clj/master/install.ps1 -outfile install_clojure.ps1 - .\install_clojure.ps1 - get-command deps.exe | split-path -parent | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - - name: Check out the source code - uses: actions/checkout@v2 - - - name: Prepare java - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - # shadow requires java 11 - java-version: ${{matrix.java_version}} - - - name: Install Clojure Tools - # Use SHA until - # https://github.com/DeLaGuardo/setup-clojure/issues/78 is - # released - uses: DeLaGuardo/setup-clojure@1376ded6747c79645e82c856f16375af5f5de307 - with: - bb: '1.0.165' - cli: '1.10.3.1013' - lein: '2.9.10' - - - uses: actions/setup-node@v3 - with: - node-version: 16 - - run: npm install shadow-cljs@2.20.13 -g - - run: npm install nbb@1.1.152 -g - - - name: Test integration - run: | - # The tests occasionally fail on macos&win in what is seems to - # be GH connectivity runner issues. We attempt to address this - # problem by rerunning the tests more than once. - eldev -p -dtTC test --test-type integration || eldev -p -dtTC test --test-type integration - - - name: Run tests that need enrich-classpath - if: "!startsWith(matrix.os, 'windows')" - run: | - cd dev; ../clojure.sh clojure -M:gen; cd - - wc -l test/File.edn - eldev -p -dtTC test --test-type enrich || eldev -p -dtTC test --test-type enrich - diff --git a/elpa/cider-1.12.0/.projectile b/elpa/cider-1.12.0/.projectile @@ -1,2 +0,0 @@ -/.cask -/packages -\ No newline at end of file diff --git a/elpa/cider-1.12.0/CHANGELOG.md b/elpa/cider-1.12.0/CHANGELOG.md @@ -1,1770 +0,0 @@ -# Changelog - -## master (unreleased) - -## 1.12.0 (2023-11-24) - -### Changes - -- [#3576](https://github.com/clojure-emacs/cider/issues/3576): CIDER [Inspector](https://docs.cider.mx/cider/debugging/inspector.html): display Java class/method/field block tags (Returns/Throws/Params info) when available. -- CIDER [Inspector](https://docs.cider.mx/cider/debugging/inspector.html#usage): introduce `1` keybinding which performs `cider-inspector-tap-at-point`. -- CIDER [Inspector](https://docs.cider.mx/cider/debugging/inspector.html#usage): introduce `o` keybinding which performs `cider-inspector-open-thing-at-point`. -- CIDER [Inspector](https://docs.cider.mx/cider/debugging/inspector.html#usage): introduce `:` keybinding which performs `cider-inspect-expr-from-inspector`. -- CIDER [Inspector](https://docs.cider.mx/cider/debugging/inspector.html): retain [`truncate-lines`](https://www.gnu.org/software/emacs/manual/html_node/emacs/Line-Truncation.html) values across screens. -- [#3580](https://github.com/clojure-emacs/cider/issues/3580): `cider-test`: make test vars in [test results reports](https://docs.cider.mx/cider/testing/test_reports.html) clickable. - - As defined in the newly introduced `cider-test-var-keymap` var. -- [#3582](https://github.com/clojure-emacs/cider/issues/3582): Handle `cider-clojure-compilation-error-phases` values that have been customized to `t`. -- [#3581](https://github.com/clojure-emacs/cider/issues/3581): Bump the injected `enrich-classpath` to [1.18.6](https://github.com/clojure-emacs/enrich-classpath/compare/v1.18.4...v1.18.6). - - Handles Clojure CLI `:paths` directly defined as `:aliases`. -- Bump the `clojure-mode` required version to [5.18.1](https://github.com/clojure-emacs/clojure-mode/blob/v5.18.1/CHANGELOG.md#5181-2023-11-24). -- Bump the injected `cider-nrepl` to [0.44.0](https://github.com/clojure-emacs/cider-nrepl/blob/44da162f51765464192ba04102398c5982f01638/CHANGELOG.md#0440-2023-11-24). - -## 1.11.1 (2023-11-11) - -### Changes - -- Bump the injected `cider-nrepl` to [0.43.3](https://github.com/clojure-emacs/cider-nrepl/blob/v0.43.3/CHANGELOG.md#0433-2023-11-11). - - Improves performance for error-handling functionality. -- Bump the injected `enrich-classpath` to [1.18.4](https://github.com/clojure-emacs/enrich-classpath/compare/v1.18.2...v1.18.4). - - Handles a Clojure CLI edge case. - -## 1.11.0 (2023-11-07) - -### New features - -- [#3565](https://github.com/clojure-emacs/cider/issues/3565): [`*cider-error*`](https://docs.cider.mx/cider/usage/dealing_with_errors.html#inspector-integration): open a given Exception in the [Inspector](https://docs.cider.mx/cider/debugging/inspector.html) by clicking it, or hitting <kbd>p</kbd>. - -### Changes - -- CIDER [Inspector](https://docs.cider.mx/cider/debugging/inspector.html): display Java class/method/field info when available. - - This info is available when [enrich-classpath](https://docs.cider.mx/cider/config/basic_config.html#use-enrich-classpath) is active. -- [#3495](https://github.com/clojure-emacs/cider/issues/3495): possibly display error overlays on [`cider-load-buffer`](https://docs.cider.mx/cider/usage/code_evaluation.html#basic-evaluation). -- `cider-popup-buffer-display`: honor `special-display-buffer-names` if customized for a given CIDER buffer name (e.g. `*cider-inspect*`), avoiding the double-rendering of the given buffer. -- [#3572](https://github.com/clojure-emacs/cider/issues/3572): `lein.sh`: honor `XDG_CACHE_HOME`. -- Bump the injected `cider-nrepl` to [0.43.1](https://github.com/clojure-emacs/cider-nrepl/blob/v0.43.1/CHANGELOG.md#0431-2023-11-07). - - Improves performance for exception handling and other use cases. - - Fixes [`cider-inspector-refresh`](https://docs.cider.mx/cider/debugging/inspector.html#usage) - - Offers better completions related to `:as-alias` under ClojureScript. - -## 1.10.0 (2023-10-31) - -### New features - -- [#3555](https://github.com/clojure-emacs/cider/pull/3555): Introduce [`cider-start-nrepl-server`](https://docs.cider.mx/cider/basics/up_and_running.html#starting-nrepl-server-without-trying-to-connect-to-it) function which does the same as `cider-jack-in` -but without connecting to the started nREPL server. - - This can help setting up more complex workflows. - -### Changes - -- Bump the injected `cider-nrepl` to [0.42.1](https://github.com/clojure-emacs/cider-nrepl/blob/v0.42.1/CHANGELOG.md#0421-2023-10-31). - - Improves performance for completions- and info-related functionality. - - Updates [Orchard](https://github.com/clojure-emacs/orchard/blob/v0.18.0/CHANGELOG.md#0180-2023-10-30) - - Improves various Inspector presentational aspects. - - Updates [Suitable](https://github.com/clojure-emacs/clj-suitable/blob/v0.5.1/CHANGELOG.md#051-2023-10-31) - - Improves keyword completion for ClojureScript. -- [#3553](https://github.com/clojure-emacs/cider/issues/3553): `cider-pprint-eval-last-sexp`, `cider-eval-last-sexp-to-repl`, `cider-pprint-eval-last-sexp-to-repl`: use error overlays to indicate failure. - - this also avoids showing an empty `*cider-result*` buffer. -- [#3554](https://github.com/clojure-emacs/cider/issues/3554): CIDER macroexpand: handle errors more gracefully. - -### Bugs fixed - -- [#3541](https://github.com/clojure-emacs/cider/issues/3541): Fix `cider-jack-in` failing with SSH remotes. -- [#3559](https://github.com/clojure-emacs/cider/issues/3559): Don't apply [dynamic syntax highlighting](https://docs.cider.mx/cider/config/syntax_highlighting.html) over buffers belonging to unrelated Sesman sessions. - -## 1.9.0 (2023-10-24) - -### New features - -- [#3529](https://github.com/clojure-emacs/cider/issues/3529): CIDER inspector: introduce `cider-inspector-previous-sibling`, `cider-inspector-next-sibling` commands ([doc](https://docs.cider.mx/cider/debugging/inspector.html#usage)). -- [#3548](https://github.com/clojure-emacs/cider/issues/3548): CIDER inspector: introduce `cider-inspector-tap-current-val` command ([doc](https://docs.cider.mx/cider/debugging/inspector.html#usage)). - -### Changes - -- [#3546](https://github.com/clojure-emacs/cider/issues/3546): Inspector: render Java items using `java-mode` syntax coloring. -- [#3521](https://github.com/clojure-emacs/cider/issues/3521): Expand `cider-clojure-compilation-regexp` to also match e.g. `Unexpected error (ExceptionInfo) macroexpanding defmulti at (src/ns.clj:1:1).`. -- Remove module info from the [CIDER error overlay](https://docs.cider.mx/cider/usage/dealing_with_errors.html#configuration). - - Example string that is now trimmed away: `(java.lang.Long is in module java.base of loader 'bootstrap'; clojure.lang.IObj is in unnamed module of loader 'app')` -- [#3522](https://github.com/clojure-emacs/cider/issues/3522): Introduce a new possible value for [`cider-use-overlays`](https://docs.cider.mx/cider/usage/code_evaluation.html#overlays): `errors-only`. - - If specified, only errors will result in an overlay being shown. -- [#3527](https://github.com/clojure-emacs/cider/issues/3527): Preserve the font size as one navigates through the CIDER inspector. -- [#3525](https://github.com/clojure-emacs/cider/issues/3525): Introduce [`cider-inline-error-message-function`](https://docs.cider.mx/cider/usage/code_evaluation.html#overlays) customization option. -- [#3528](https://github.com/clojure-emacs/cider/issues/3528): Bump the injected `cider-nrepl` to [0.41.0](https://github.com/clojure-emacs/cider-nrepl/blob/v0.41.0/CHANGELOG.md#0410-2023-10-24). - - Updates [Orchard](https://github.com/clojure-emacs/orchard/blob/v0.17.0/CHANGELOG.md#0170-2023-10-24), providing misc presentational improvements for the CIDER Inspector. - -### Bugs fixed - -- Inspector: avoid `Symbol's value as variable is void: text-scale-mode-amount` under certain Emacs clients. - -## 1.8.3 (2023-10-18) - -### Changes - -- [#2903](https://github.com/clojure-emacs/cider/issues/2903): Avoid `No comment syntax is defined` prompts. -- Bump the `clojure-mode` required version to [5.18.0](https://github.com/clojure-emacs/clojure-mode/blob/v5.18.0/CHANGELOG.md#5180-2023-10-18). - -### Bugs fixed - -- [#3533](https://github.com/clojure-emacs/cider/issues/3533): Refine Sesman session linking to accurately work on `*cider-test-report*` buffers. -- [#3539](https://github.com/clojure-emacs/cider/issues/3539): `cider-jump-to-locref-at-point`: don't jump to non-existing files. - -## 1.8.2 (2023-10-15) - -### Changes - -- Bump the injected `cider-nrepl` to [0.40.0](https://github.com/clojure-emacs/cider-nrepl/blob/v0.40.0/CHANGELOG.md#0400-2023-10-15). - - Improves the `:style/indent` `:arglist` and other key metadata propagation for ClojureScript macros. - -## 1.8.0 (2023-10-13) - -### New features - -- [#3364](https://github.com/clojure-emacs/cider/pull/3364): Update [enrich-classpath](https://docs.cider.mx/cider/config/basic_config.html#use-enrich-classpath), adding Clojure CLI compatibility, and reworking its integration into CIDER. -- [#3472](https://github.com/clojure-emacs/cider/pull/3472): render Java doc comments and arglists with an improved format, and improve Java interop type inference. - * Requires enrich-classpath to be enabled (see previous bullet point). - * A related option has been introduced: [`cider-docstring-max-lines`](https://docs.cider.mx/cider/usage/code_completion.html#configuration). -- [#3352](https://github.com/clojure-emacs/cider/pull/3352): Add [CIDER Log Mode](https://docs.cider.mx/cider/debugging/logging.html), a major mode that allows you to capture, debug, inspect and view log events emitted by Java logging frameworks. -- [#3418](https://github.com/clojure-emacs/cider/issues/3418): Introduce `cider-clojure-compilation-error-phases` ([doc](https://docs.cider.mx/cider/usage/dealing_with_errors.html#configuration)). - - This prevents stacktraces from showing up whenever the [:clojure.error/phase](https://clojure.org/reference/repl_and_main#_at_repl) indicates that it's a compilation error. -- Infer indentation specs when possible ([doc](https://docs.cider.mx/cider/indent_spec.html#indentation-inference)). -- [#2958](https://github.com/clojure-emacs/cider/issues/2958), [#3279](https://github.com/clojure-emacs/cider/issues/3279): `cider-test-run-test`: support arbitrary deftest-like forms, defns with :test metadata, and search for a `-test` counterpart for a given defn (following `cider-test-infer-test-ns` logic). - - This also makes obsolete the `cider-test-defining-forms` customization variable. -- `cider-test`: add timing information. -- `cider-test`: fail-fast by default, as controlled by the new [`cider-test-fail-fast`](https://docs.cider.mx/cider/testing/running_tests.html#fail-fast) defcustom and `cider-test-toggle-fail-fast` keybinding. -- [#3352](https://github.com/clojure-emacs/cider/pull/3496): Introduce [`cider-eval-dwim`](https://docs.cider.mx/cider/usage/cider_mode.html#key-reference). -- Add new customization variable [`cider-clojurec-eval-destination`](https://docs.cider.mx/cider/cljs/up_and_running.html#working-with-cljc-files) to allow specifying which REPL .cljc evals are sent to. -- [#3354](https://github.com/clojure-emacs/cider/issues/3354): Add new customization variable [`cider-reuse-dead-repls`](https://docs.cider.mx/cider/usage/managing_connections.html#reusing-dead-repls) to control how dead REPL buffers are reused on new connections. - -### Bugs fixed - -- [#3341](https://github.com/clojure-emacs/cider/issues/3341): Escape clojure-cli args on MS-Windows on non powershell invocations. -- [#3353](https://github.com/clojure-emacs/cider/issues/3353): Fix regression which caused new connections to prompt for reusing dead REPLs. -- [#3355](https://github.com/clojure-emacs/cider/pull/3355): Fix `cider-mode` disabling itself after a disconnect when `cider-auto-mode` is set to nil. -- [#3362](https://github.com/clojure-emacs/cider/issues/3362): Fix `sesman-restart` regression issue. -- [#3236](https://github.com/clojure-emacs/cider/issues/3236): `cider-repl-set-ns` no longer changes the repl session type from `cljs:shadow` to `clj`. -- [#3383](https://github.com/clojure-emacs/cider/issues/3383): `cider-connect-clj&cljs`: don't render `"ClojureScript REPL type:"` for JVM repls. -- [#3331](https://github.com/clojure-emacs/cider/issues/3331): `cider-eval`: never jump to spurious locations, as sometimes conveyed by nREPL. -- [#3112](https://github.com/clojure-emacs/cider/issues/3112): Fix the CIDER `xref-find-references` backend to return correct filenames. -- [#3402](https://github.com/clojure-emacs/cider/issues/3402): Fix `cider-format-connection-params` edge case for Emacs 29. -- [#3393](https://github.com/clojure-emacs/cider/issues/3393): Recompute namespace info on each shadow-cljs recompilation or evaluation. -- Recompute namespace info on each fighweel-main recompilation. -- [#3250](https://github.com/clojure-emacs/cider/issues/3250): Don't lose the CIDER session over TRAMP files. -- [#3413](https://github.com/clojure-emacs/cider/issues/3413): Make jump-to-definition work in projects needing `cider-path-translations` (i.e. Dockerized projects). -- [#2436](https://github.com/clojure-emacs/cider/issues/2436): Prevent malformed `cider-repl-history-file`s from failing `cider-jack-in`. -- [#3456](https://github.com/clojure-emacs/cider/issues/3456): Restore xref-based jump-to-definition in Babashka (and any nREPL clients not having cider-nrepl). -- [#3466](https://github.com/clojure-emacs/cider/issues/3466): Restore the usual `cider--connected-handler` performance for JVM Clojure repls. -- [#3503](https://github.com/clojure-emacs/cider/issues/3503): Make `cider-repl-set-ns` more reliable on Piggieback connections. -- Fix the `xref-find-definitions` CIDER backend to return correct filenames. -- Fix the `cider-xref-fn-deps` buttons to direct to the right file. -- Fix the `cider-find-keyword` overall reliability and correctness, particularly for ClojureScript. -- Make TRAMP functionality work when using non-standard ports. -- Fix the `cider-insert-commands-map` variable initialization. - -### Changes - -- Ensure that `cider` completion isn't used with completion styles that are currently unsupported (`initials`, `partial-completion`, `orderless`, etc). - - This restores completions for users that favor those styles - otherwise the would see bad or no completions. - - Relatedly, `cider-company-enable-fuzzy-completion` is now deprecated in favor of `cider-enable-flex-completion`. -- Improve support for multiple forms in the same line by replacing `beginning-of-defun` fn. -- [#3390](https://github.com/clojure-emacs/cider/issues/3390): Enhance `cider-connect` to show all nREPLs available ports, instead of only Leiningen ones. -- [#3408](https://github.com/clojure-emacs/cider/issues/3408): `cider-connect`: check `.nrepl-port`-like files for liveness, hiding them if they don't reflect an active port. -- Introduce [`cider-stacktrace-navigate-to-other-window`](https://docs.cider.mx/cider/usage/dealing_with_errors.html#configuration) defcustom. -- Preserve the `:cljs-repl-type` more reliably. -- Improve the presentation of `xref` data. -- [#3419](https://github.com/clojure-emacs/cider/issues/3419): Also match friendly sessions based on the buffer's ns form. -- Always match friendly sessions for `cider-ancillary-buffers` (like `*cider-error*`, `*cider-result*`, etc). -- `cider-test`: only show diffs for collections. -- `cider-inspector-def-current-val` now can suggest a var name (default none), which can be customized via [`cider-inspector-preferred-var-names`](https://docs.cider.mx/cider/debugging/inspector.html#configuration). -- The `"Member in class: "` prompt can now be optionally skipped in ido-mode by pressing `<up>` or `<down>` ([doc](https://docs.cider.mx/cider/usage/code_completion.html)). -- [#3375](https://github.com/clojure-emacs/cider/pull/3375): `cider-test`: don't render a newline between expected and actual, most times. -- Interactive evaluation: show a shorter overlay when rendering compilation errors. - - e.g., the `Syntax error compiling clojure.core/let at (foo/bar.clj:10:1)` prefix is now removed. -- Ensure there's a leading `:` when using `cider-clojure-cli-aliases`. -- Improve `nrepl-dict` error reporting. -- Bump the injected `piggieback` to [0.5.3](https://github.com/nrepl/piggieback/blob/0.5.3/CHANGES.md#053-2021-10-26). -- Bump the `clojure-mode` required version to [5.17.1](https://github.com/clojure-emacs/clojure-mode/blob/v5.17.1/CHANGELOG.md#5171-2023-09-12), and use `clojure-find-ns` more safely, which fixes issues such as #[2849](https://github.com/clojure-emacs/cider/issues/2849). -- Bump the `parseedn` require version, and wrap its usage with a more informative `user-error`. -- Bump the injected `cider-nrepl` to [0.39.1](https://github.com/clojure-emacs/cider-nrepl/blob/v0.39.1/CHANGELOG.md#0391-2023-10-12). - - Improves indentation, font-locking and other metadata support for ClojureScript. - - Updates [Orchard](https://github.com/clojure-emacs/orchard/blob/v0.16.1/CHANGELOG.md#0161-2023-10-05) - - introduces support for displaying the docstring and arglists of 'indirect' vars (e.g. `(def foo bar)`) for Clojure/Script. - - fixes xref support across deftest vars. - - Updates [Compliment](https://github.com/alexander-yakushev/compliment/blob/0.4.4/CHANGELOG.md#044-2023-10-10) - - Improves type hint propagation. - - Supports better completions for `doto`, `->`, `->>`, `some->`, and `some->>`. - - Supports better completions for var-quote (`#'some/var`). - - Supports better completions for deftype field names. - - Updates [Haystack](https://github.com/clojure-emacs/haystack/blob/v0.3.1/CHANGELOG.md#031-2023-09-29). - - Now, in `*cider-error*`, more internal stackframes will be hidden under the `tooling` category. - - Updates [Suitable](https://github.com/clojure-emacs/clj-suitable/blob/v0.5.0/CHANGELOG.md#050-2023-07-28) - - avoiding side-effecting `->` evaluation for pure-ClojureScript chains. - -## 1.7.0 (2023-03-23) - -### New features - -- [#3314](https://github.com/clojure-emacs/cider/issues/3314): Detect `nrepl+unix` sockets (say via `lein nrepl :headless :socket nrepl.sock`). -- [#3262](https://github.com/clojure-emacs/cider/issues/3262): Add navigation functionality to `n/p/f/b` keys inside the data inspector's buffer. -- [#3310](https://github.com/clojure-emacs/cider/issues/3310): Add ability to use custom coordinates in `cider-jack-in-dependencies`. -- [cider-nrepl#766](https://github.com/clojure-emacs/cider-nrepl/issues/766): Complete local bindings for ClojureScript files. -- [#3179](https://github.com/clojure-emacs/cider/issues/3179): Introduce `cider-jack-in-universal` to support jacking-in without a project from a set of pre-configured Clojure project tools. - -### Changes - -- Allow using `npx nbb` as `cider-nbb-command`. -- [#3281](https://github.com/clojure-emacs/cider/pull/3281): Replace newline chars with actual newlines in `*cider-test-report*` buffer, for prettier error messages. -- Bump the injected `cider-nrepl` to 0.30. -- [#3219](https://github.com/clojure-emacs/cider/issues/3219): Disable by default forcing the display of output when the REPL prompt is at the first line of the of the REPL window. This behavior is desirable, but very slow and rarely needed. It can be re-enabled by setting `cider-repl-display-output-before-window-boundaries` to `t`. -- [#3335](https://github.com/clojure-emacs/cider/issues/3335): Disable the Paredit binding of RET in cider-repl-mode buffers, which can cause unexpected behaviour by appearing to hang instead of evaluating forms. -- [#3307](https://github.com/clojure-emacs/cider/issues/3307): Make eldoc highlighting on emacs special forms better match the location of the point when latest `cider-nrepl` is used. - -## 1.6.0 (2022-12-21) - -### New features - -- [#3278](https://github.com/clojure-emacs/cider/pull/3278): Introduce integration tests, which also fix a long standing issue with orphaned process on MS-Windows by contracting `taskkill`, if available, to properly kill the nREPL server process tree. -- [#3061](https://github.com/clojure-emacs/cider/issues/3061): Add support for `nbb`. -- [#3249](https://github.com/clojure-emacs/cider/pull/3249): Add support for Clojure Spec 2. -- [#3247](https://github.com/clojure-emacs/cider/pull/3247): Add the `cider-stacktrace-analyze-at-point` and `cider-stacktrace-analyze-in-region` commands to view printed exceptions in the stacktrace inspector. - -### Changes - -- Bump the injected nREPL version to 1.0. -- [#3061](https://github.com/clojure-emacs/cider/issues/3061): Allow to use `cider-connect-clj` for self-hosted cljs repls (e.g. `nbb`). -- [#3291](https://github.com/clojure-emacs/cider/pull/3291): **Remove** the `'cljs-pending` `repl-type`. It is replaced by `cider-repl-cljs-upgrade-pending`. -- [#3261](https://github.com/clojure-emacs/cider/issues/3261): If user is connecting to nREPL from a TRAMP buffer, use its connection parameters (port, username) for establishing SSH tunnel. - -### Bugs fixed - -- Remove needless quotes from the choices of `cider-jack-in-auto-inject-clojure`. -- [#2561](https://github.com/clojure-emacs/cider/issues/2561): Disable undo in `*cider-test-report*` buffers. -- [#3251](https://github.com/clojure-emacs/cider/pull/3251): Disable undo in `*cider-stacktrace*` buffers. -- Consecutive overlays will not be spuriously deleted. -- [#3260](https://github.com/clojure-emacs/cider/pull/3260): Scroll REPL buffer in other frame. -- [#3293](https://github.com/clojure-emacs/cider/issues/3293): Can't jack in to more than one `bb` projects. - -## 1.5.0 (2022-08-24) - -### New features - -- [#3226](https://github.com/clojure-emacs/cider/pull/3226): Populate completions metadata, making it possible to change the style of completion via `completion-category-override` or `completion-category-defaults`. -- [#2946](https://github.com/clojure-emacs/cider/issues/2946): Add custom var `cider-merge-sessions` to allow combining sessions in two different ways: Setting `cider-merge-sessions` to `'host` will merge all sessions associated with the same host within a project. Setting it to `'project` will combine all sessions of a project irrespective of their host. -- Support Gradle jack-in via the Gradle wrapper (`gradlew`), instead of just a globally installed `gradle` on the `PATH`. -- Gradle projects can now inject dependencies and middleware as with other build tools (dependency injection requires [Clojurephant](https://github.com/clojurephant/clojurephant) 0.7.0 or higher). -- [#3239](https://github.com/clojure-emacs/cider/issues/3239): Added commands to evaluate and tap last sexp (`cider-tap-last-sexp`) and sexp at point (`cider-tap-sexp-at-point`). - -## Changes - -- Upgrade clojure-mode to [5.15.1](https://github.com/clojure-emacs/clojure-mode/blob/v5.15.1/CHANGELOG.md). -- Upgrade injected `cider-nrepl` to [0.28.5](https://github.com/clojure-emacs/cider-nrepl/releases/tag/v0.28.5). -- [#3200](https://github.com/clojure-emacs/cider/issues/3200): Improve cider-browse-ns interface to allow selective hiding of var types as well as grouping options. Include private vars in result list. -- Changed default `cider-gradle-command` to `./gradlew` to use the Gradle wrapper. -- Changed default `cider-gradle-global-options` to `""` (empty, formerly `--no-daemon`). -- [#3234](https://github.com/clojure-emacs/cider/pull/3234): Autocomplete multiple available ports on nREPL connect. - -### Bugs fixed - -- [#3235](https://github.com/clojure-emacs/cider/issues/3235): Check `name` is a TRAMP file in `cider--client-tramp-filename` via `tramp-tramp-file-p`. - -## 1.4.1 (2022-05-25) - -## Changes - -* Upgrade cider-nrepl to [0.28.4](https://github.com/clojure-emacs/cider-nrepl/releases/tag/v0.28.4). - -### Bugs fixed - -* [#3195](https://github.com/clojure-emacs/cider/issues/3195): Revert the change that resulted in `(error "Cyclic keymap inheritance")` on `cider-test-run-test`. -* [#3182](https://github.com/clojure-emacs/cider/issues/3182): Don't try to invoke -JVM-specific code outside of JVM Clojure. -* [#3202](https://github.com/clojure-emacs/cider/pull/3202): Fix `cider-eval-ns-form` - * Do not always perform `undef-all`. Undef only with `C-u` prefix. - * Fix extraction of namespace name. - -## 1.4.0 (2022-05-02) - -## New features - -* [#3188](https://github.com/clojure-emacs/cider/pull/3188): Add support for `undef-all` op, for removing stale vars and conflicting aliases. - * Add new command `cider-undef-all`. - * Existing commands `cider-load-buffer`, `cider-load-file`, and `cider-eval-ns-form` can be called with `C-u` prefix to execute `undef-all` before reloading the ns. -* [#3185](https://github.com/clojure-emacs/cider/pull/3185): Add feature to `cider-eval-in-context` for automatically extracting parent let bindings when called with `C-u` prefix argument. -* Add new interactive command `cider-inspire-me`. It does what you'd expect. -* [#3162](https://github.com/clojure-emacs/cider/pull/3162): Save eval results into kill ring and registers. - * Add new customization variable `cider-eval-register` to automatically store the last interactive eval result into the specified register. - * Add interactive command `cider-kill-last-result` to manually save the last eval result into kill ring. - -### Changes - -* [#3177](https://github.com/clojure-emacs/cider/pull/3177): Apply ANSI colorization to test assertion output. -* Use clojure-mode [5.14.0](https://github.com/clojure-emacs/clojure-mode/blob/v5.14.0/CHANGELOG.md#5140-2022-03-07). - -### Bugs fixed - -* [#3170](https://github.com/clojure-emacs/cider/issues/3170): Skip ensure repl available checks on xref functions. (this improves the interop with `clojure-lsp`) -* [#3173](https://github.com/clojure-emacs/cider/issues/3173): Locally remove `cider-complete-at-point` from `completion-at-point-functions` instead of killing it as a local variable. -* [#3172](https://github.com/clojure-emacs/cider/issues/3172): Restore the long-lost (but critical) inspirational message on connect. -* [#3186](https://github.com/clojure-emacs/cider/pull/3186): An assortment of small fixes. - -## 1.3.0 (2022-03-07) - -### New features - -* [#3148](https://github.com/clojure-emacs/cider/pull/3148): Display error messages in multiline comment eval results, and in result overlays when `cider-show-error-buffer` is set to `nil`. -* [#3149](https://github.com/clojure-emacs/cider/pull/3149): Add option `'change` to `cider-eval-result-duration`, allowing multiple eval result overlays to persist until the next change to the buffer. - -### Changes - -* [#3127](https://github.com/clojure-emacs/cider/pull/3040): Strip all exec-opts flags (`-A` `-M` `-T` `-X`) if they exist in `cider-clojure-cli-aliases`. Also addresses a duplicate `:` in the generated `clj` command. -* `cider-jack-in-lein-plugins` no longer affects non-Leiningen projects. - * Third-party packages should rely on `cider-jack-in-dependencies` instead. -* Upgrade cider-nrepl to [0.28.3](https://github.com/clojure-emacs/cider-nrepl/blob/v0.28.3/CHANGELOG.md#0283-2022-02-22). -* Remove `cider-jdk-src-paths` defcustom since enrich-classpath makes it redundant. -* Remove `cider-resolve-java-class` function since enrich-classpath makes it redundant. - -### Bugs fixed - -* Upgrade [enrich-classpath](https://github.com/clojure-emacs/enrich-classpath), which fixes various edge cases. - * Remember: at the moment the enrich-classpath is disabled by default. If you wish to try it out, you can customize `cider-enrich-classpath` to `t`. - * Also remember: for it to work, on Linux, you'll also have to do something like `sudo apt install openjdk-11-source` (depending on your package manager and JDK of choice). -* [#3145](https://github.com/clojure-emacs/cider/pull/3145): Allow fallback to other `xref` backends if cider-nrepl is not loaded. -* [#3148](https://github.com/clojure-emacs/cider/pull/3148): Fix eval result overlays at point inheriting the faces of following text. -* [#3133](https://github.com/clojure-emacs/cider/issues/3133): Respect `cider-injected-middleware-version`. -* [#3163](https://github.com/clojure-emacs/cider/pull/3163): `cider-clojuredocs`: prevent redundant prompt for a symbol. - -## 1.2.0 (2021-12-22) - -### New features - -* Integrate [enrich-classpath](https://github.com/clojure-emacs/enrich-classpath) by default for Leiningen projects. - * This enables functionality related to Java sources, javadocs or parsing thereof. - * This can slightly slow down jack-in for the _first_ time for a given project; later on the related work will be cached. - * The feature is experimental at this point and needs to be enabled with `(setq cider-enrich-classpath t)`. -* [#2831](https://github.com/clojure-emacs/cider/issues/2831): Add `xref` integration, configured with customizable variables `cider-use-xref` and `cider-xref-fn-depth`. -* [#3017](https://github.com/clojure-emacs/cider/issues/3017): Annotate company completion kinds. -* [#3040](https://github.com/clojure-emacs/cider/pull/3040): Support invoking `cider-clojuredocs` within the `*clojuredocs*` buffer. -* Make it possible to specify the version of `cider-nrepl` to use with `cider-jack-in`. See `cider-injected-middleware-version`. -* Make it possible to specify the version of nREPL to use with `cider-jack-in`. See `cider-injected-nrepl-version`. -* Upgrade `cider-nrepl`, `Orchard` and `clj-suitable` for pulling their latest bugfixes. -* Add support for babashka projects to `cider-jack-in`. -* Introduce `cider-jack-in-lein-middlewares` defcustom. -* [#3093](https://github.com/clojure-emacs/cider/pull/3093): Make `see-also`s clickable in ClojureDocs buffers. -* [#3044](https://github.com/clojure-emacs/cider/pull/3044): Dynamically upgrade nREPL connection. See `cider-upgrade-nrepl-connection`. - -### Bugs fixed - -* [#3022](https://github.com/clojure-emacs/cider/issues/3022): Handle empty stacktraces, pointing users to docs about the `OmitStackTraceInFastThrow` JVM optimization. -* [#3020](https://github.com/clojure-emacs/cider/issues/3020): Fix session linking on Windows, e.g. when jumping into a library on the classpath. -* [#3031](https://github.com/clojure-emacs/cider/pull/3031): Fix `cider-eval-defun-up-to-point` failing to match delimiters correctly in some cases, resulting in reader exceptions. -* [#3039](https://github.com/clojure-emacs/cider/pull/3039): Allow starting the sideloader for the tooling session. -* [#3041](https://github.com/clojure-emacs/cider/pull/3041): Sideloader: handle binary files, support multiple directories. -* [#3047](https://github.com/clojure-emacs/cider/pull/3047): Fix info/lookup fallback: response has an extra level. -* [#2746](https://github.com/clojure-emacs/cider/issues/2746): Handle gracefully Clojure versions with non-standard qualifiers (e.g. `1.11.0-master-SNAPSHOT`). -* [#3069](https://github.com/clojure-emacs/cider/pull/3069): Fix cursor color changing when it shouldn't in `evil-mode`. -* [#3071](https://github.com/clojure-emacs/cider/issues/3071): Use `xref` instead of `etags` to push point to marker stack. -* [#3074](https://github.com/clojure-emacs/cider/issues/3074): Recognize `pwsh` as a `powershell` executable. - -### Changes - -* Drop support for Emacs 25 (this tracks upstream deps like `parseedn` that no longer support Emacs 25 and is line with our compatibility policy for RHEL and Debian). - -## 1.1.1 (2021-05-24) - -### Bugs fixed - -* [#3014](https://github.com/clojure-emacs/cider/pull/3014): Update Krell repl initialization code to follow latest guidelines as found in Krell wiki. -* [#3012](https://github.com/clojure-emacs/cider/issues/3012): Allow connecting sibling repls from any buffer. -* [#3010](https://github.com/clojure-emacs/cider/issues/3010): Remove `::` auto-resolved keyword expansion logic from `cider-symbol-at-point`, moving it to `cider-browse-spec`. - -## 1.1.0 (2021-04-22) - -### New features - -* [#2930](https://github.com/clojure-emacs/cider/issues/2930): Add new customization variable `cider-test-default-include-selectors` and `cider-test-default-exclude-selectors` for specifying default test selectors when running commands such as `cider-test-run-ns-tests`. -* [#2907](https://github.com/clojure-emacs/cider/issues/2907): Add new customization variable `cider-format-code-options` to specify options used by `cljfmt` to format code when running commands `cider-format-buffer`, `cider-format-region` and `cider-format-defun`. -* [#3002](https://github.com/clojure-emacs/cider/pull/3002): [Inspector] Make collection member truncation limits configurable. - -### Bugs fixed - -* [#2871](https://github.com/clojure-emacs/cider/issues/2871): Restore the dynamic code completion (the actual fixes are in `clj-suitable` and `cider-nrepl`). -* [#2993](https://github.com/clojure-emacs/cider/issues/2993): Fix bug where calling `cider-repl-set-ns` for a cljs ns when `cider-repl-require-ns-on-set` is `t` would fail. -* [#2983](https://github.com/clojure-emacs/cider/issues/2983): Update signal description in nrepl server sentinel as a workaround for Emacs bug #46284 affecting v27.1 on Windows. -* [#2941](https://github.com/clojure-emacs/cider/issues/2941): Use main args in alias for clojure cli. -* [#2953](https://github.com/clojure-emacs/cider/issues/2953): Don't font-lock function/macro vars as generic vars. -* [#2964](https://github.com/clojure-emacs/cider/issues/2964): Fix issue with `cider-company-enable-fuzzy-completion` and Helm. -* [#2937](https://github.com/clojure-emacs/cider/issues/2937): Green fringe produced for extra line in rich comment block. -* [#2996](https://github.com/clojure-emacs/cider/issues/2937): Fix debugger incorrectly locating `#_` ignored forms. -* Fix a compatibility issue with Java 15 and fetching fresh ClojureDocs data. (fixed in `cider-nrepl` 0.25.6) -* [#3004](https://github.com/clojure-emacs/cider/pull/3004): Use appropriate coding system when unzipping jars. -* [#2934](https://github.com/clojure-emacs/cider/issues/2934): Enable `eldoc-mode` in existing clojure buffers. - -### Changes - -* Removed `cider-clojure-cli-parameters` due to clojure-cli jack-in changes. -* Changed the behaviour of `cider-last-sexp` so it returns only the sexp, excluding all whitespace and/or the first newline after. - -## 1.0.0 (2020-28-12) - -### New features - -* [#2909](https://github.com/clojure-emacs/cider/issues/2909): Add new customization variable `cider-inspector-auto-select-buffer` to control the auto selection of the inspector buffer. -* [#2940](https://github.com/clojure-emacs/cider/pull/2940): Add a new customization variable cider-shadow-watched-builds to allow watching several shadow-cljs builds at the same time. - -### Bugs fixed - -* Fix broken links to the docs in REPL warnings (the REPL links included the full CIDER version, but the docs URLs are without the patch version). -* [#2916](https://github.com/clojure-emacs/cider/issues/2916): Fix ordering of dependencies, global-opts and params for Clojure CLI projects when calling `cider-jack-in`. -* [#2929](https://github.com/clojure-emacs/cider/issues/2929): Fix handling of reader tags or metadata when calling `cider-eval-last-sexp-and-replace`. - -### Changes - -* Bump the injected nREPL version to 0.8.3. -* Bump the injected `cider-nrepl` version to 0.25.5. -* Bump the injected Piggieback version to 0.5.2. See [this issue](https://github.com/nrepl/piggieback/issues/118) for details. -* [#2897](https://github.com/clojure-emacs/cider/pull/2897): Translate paths from CIDER to nREPL and vice-versa. -* Set `cider-prompt-for-symbol` to `nil` by default. - -## 0.26.1 (2020-08-14) - -### Bugs fixed - -* [#2886](https://github.com/clojure-emacs/cider/pull/2886): Don't check for `node`'s presence before starting a browser REPL. -* [#2889](https://github.com/clojure-emacs/cider/pull/2889): Fix a typo in `cider-info-form`. - -### Changes - -* Bump the injected piggieback version to 0.5.1. - -## 0.26.0 (2020-08-03) - -### New features - -* Add first class support for Babashka (more warnings when you connect to `babashka.nrepl`). -* Add support for nREPL 0.8's `lookup` op. -* Add support for nREPL 0.7's sideloading functionality (experimental). -* Add support for nREPL 0.8's `ls-middleware` op. -* [#2861](https://github.com/clojure-emacs/cider/pull/2861): Add support for the Krell REPL. -* [#2881](https://github.com/clojure-emacs/cider/pull/2881): Add command to evaluate list around point (`cider-eval-list-at-point`). - -### Changes - -* [#2527](https://github.com/clojure-emacs/cider/issues/2527): Enable auto-clear of REPL buffer by setting a limit to the max buffer size. -* [#2852](https://github.com/clojure-emacs/cider/issues/2852): Convert 1-based column numbers in response map to Emacs' 0-based system. -* Differentiate between more types in `cider-eldoc`. They used to be just `var` and `fn` and now we have additional handling for -macros, special forms and methods. -* No longer fetches ClojureDocs data on first run (it's now bundled with `cider-nrepl`). -* No longer updates the ClojureDocs data automatically on startup (it has to be updated explicitly using `M-x cider-clojuredocs-refresh-cache`). -* Use nREPL 0.8 by default (when doing `cider-jack-in`). - -### Bugs fixed - -* Handle properly missing file metadata in `cider-doc` buffers, when you eval fallback to obtain var metadata. -* Show eldoc for `.` and `..`. -* [#2860](https://github.com/clojure-emacs/cider/issues/2860): Don't send blank strings in `eldoc` requests. -* [#2718](https://github.com/clojure-emacs/cider/issues/2718): When calling `cider-pprint-eval-last-sexp-to-comment`, avoid printing empty comment if eval throws error. -* [#2796](https://github.com/clojure-emacs/cider/issues/2796): Closing CIDER connection will disable the debug minor mode on clojure buffers. - -## 0.25.0 (2020-06-04) - -### New features - -* [#2482](https://github.com/clojure-emacs/cider/pull/2842): Improvements to CIDER Inspector. - * New defcustom `cider-inspector-skip-uninteresting` to control whether to skip over nils, numbers and keywords when navigating between values in the inspector buffer. - * New defcustom `cider-auto-inspect-after-eval` to control whether a visible inspector buffer is updated with the last evaluated result. -* [#2833](https://github.com/clojure-emacs/cider/pull/2833): Save command history for jack-in with universal arg. -* [#2828](https://github.com/clojure-emacs/cider/pull/2828): Bind "L" to toggle display of locals during a debug session. -* [#2800](https://github.com/clojure-emacs/cider/pull/2800): Add support for force-out debugger command. -* Add support for nREPL 0.8 `completions` op. It's used if `cider-nrepl` is not available. -* Add `browser` to the list of supported ClojureScript REPL types. -* Add an interactive command to toggle Clojure font-locking in the REPL (`cider-repl-toggle-clojure-font-lock`). -* Add a defcustom controlling nREPL's print buffer size (`cider-print-buffer-size`). It's set to 4K by default, nREPL own default is 1k. - -### Changes - -* [#2826](https://github.com/clojure-emacs/cider/pull/2826): Add support for symbols with quotes and resolving of ns-aliased keywords in `cider-symbol-at-point`. -* [#2617](https://github.com/clojure-emacs/cider/pull/2617): Add menu bar entry for `Insert last sexp in REPL`. -* Removed support for the Nashorn ClojureScript REPL. (it was removed upstream in ClojureScript) -* [#2825](https://github.com/clojure-emacs/cider/issues/2825): Disable support for displaying images in the REPL. (set `cider-repl-use-content-types` to re-enable it) -* [#2850](https://github.com/clojure-emacs/cider/issues/2850): Ensure you're in the middle of a window after commands like `cider-find-var`. - -### Bugs fixed - -* [#2839](https://github.com/clojure-emacs/cider/pull/2839): Fix symbol-at-point on var-quoted symbols. -* [#2807](https://github.com/clojure-emacs/cider/pull/2807): Fix require-repl-utils for shadow-cljs repls. -* [#1971](https://github.com/clojure-emacs/cider/issues/1971), [#2628](https://github.com/clojure-emacs/cider/issues/2628): Don't try to font-lock multi-chunk results in the REPL. -* [#2816](https://github.com/clojure-emacs/cider/issues/2816): Update eldoc to work with Emacs 28.1. - -## 0.24.0 (2020-02-15) - -### New features - -* [#2744](https://github.com/clojure-emacs/cider/pull/2744): Add startup commands to REPL banner. -* [#2499](https://github.com/clojure-emacs/cider/issues/2499): Add `cider-jump-to-pop-to-buffer-actions`. -* [#2738](https://github.com/clojure-emacs/cider/pull/2738): Add ability to lookup a function symbol when cursor is at the opening paren. -* [#2735](https://github.com/clojure-emacs/cider/pull/2735): New debugger command `P` to inspect an arbitrary expression, it was previously bound to `p` which now inspects the current value. -* [#2729](https://github.com/clojure-emacs/cider/pull/2729): New cider inspector command `cider-inspector-def-current-val` lets you define a var with the current inspector value. - -### Changes - -* [#2781](https://github.com/clojure-emacs/cider/pull/2781): Extend `cider-doc-xref-regexp` to recognize `[[var]]` syntax and fully qualified symbols as xref links in cider-doc buffers. -* [#2731](https://github.com/clojure-emacs/cider/pull/2731): Make the in-buffer debugging menu customizable via `cider-debug-prompt-commands`. - -### Bugs fixed - -* [#2787](https://github.com/clojure-emacs/cider/issues/2787): Fix nrepl process naming collision when using `nrepl-hide-special-buffers`. -* [#2739](https://github.com/clojure-emacs/cider/pull/2739): Start built-in shadow-cljs build profiles correctly (node-repl, browser-repl). -* [#2730](https://github.com/clojure-emacs/cider/pull/2730): Require REPL utilities into current namespace not just `user` ns. -* [#2614](https://github.com/clojure-emacs/cider/issues/2614): Fix error highlighting in source buffers for Clojure 1.10. -* [#2733](https://github.com/clojure-emacs/cider/issues/2733): Restore compatibility with Emacs 25.3. - -## 0.23.0 (2019-10-08) - -### New features - -* New configuration variable `cider-result-overlay-position` determining where debugger and inline eval result overlays should be displayed. Current options are 'at-eol and 'at-point. -* [#2606](https://github.com/clojure-emacs/cider/pull/2606): Defcustom `cider-path-translations` for translating paths from nREPL messages (useful where a file appears to be somewhere, but it's actually somewhere else). -* [#2698](https://github.com/clojure-emacs/cider/pull/2689): Infer figwheel builds automatically. -* New command `cider-clojuredocs-refresh-cache`. - -### Changes - -* [#2711](https://github.com/clojure-emacs/cider/pull/2711): `cider-selector` has more robust handling for edge cases. -* [#2572](https://github.com/clojure-emacs/cider/issues/2572): Make it possible to a start a one off ClojureScript REPL without defining a new REPL type. -* Dynamic cljs completions (via suitable) can be disable by setting `cider-enhanced-cljs-completion-p` to nil. - -### Bugs fixed - -* [#2715](https://github.com/clojure-emacs/cider/issues/2715): Fix the `shadow-cljs` presence check. -* [#2705](https://github.com/clojure-emacs/cider/issues/2705): Middleware version check looks at only at the minor version for comparison (when the major version is 0) and ensures a matching major and a minor >= required otherwise. -* Fixed some bugs related to the new suitable-powered ClojureScript code completion (this was fixed by upgrading the `suitable` used by `cider-nrepl`). -* Remove a misplaced error message when doing `clojuredocs-lookup`. -* [#2721](https://github.com/clojure-emacs/cider/issues/2721): Handle properly symbols ending in `.` (e.g. `SomeRecord.`). - -## 0.22.0 (2019-09-01) - -### New features - -* [#2656](https://github.com/clojure-emacs/cider/issues/2656): Base64 encode clojure command and arguments on jack-in when `cider-clojure-cli-command` is `"powershell"` to avoid escaping issues. If no `clojure` command is found on Windows `cider-clojure-cli-command` defaults to `"powershell"`. -* Allow editing of jack in command with prefix or when `cider-edit-jack-in-command` is truthy. -* New defcustom `cider-repl-require-ns-on-set`: Set it to make cider require the namespace before setting it, when calling `cider-repl-set-ns`. -* [#2611](https://github.com/clojure-emacs/cider/issues/2611): Add `eval`-based classpath lookup fallback. It's used when cider-nrepl is not present. -* [#2611](https://github.com/clojure-emacs/cider/issues/2611): Add `eval`-based var info lookup fallback. It's used when cider-nrepl is not present. -* [#1840](https://github.com/clojure-emacs/cider/issues/1840): Add a command to find runtime function references (`cider-xref-fn-refs`). -* Add a command to find runtime function dependencies (`cider-xref-fn-deps`). -* Add a menu to the inspector. -* Add completion of shadow-cljs build names in the minibuffer when connecting or jacking in. - -### Changes - -* `cider-use-tooltips` now also controls whether `help-echo` is used. -* `cider-print-options` is now supported by the `pr` option for `cider-print-fn`. The options will now be also used by interactive eval commands that do not use pretty-printing. -* `spec-list` and `spec-form` requests send the current namespace for alias resolution. -* `C-c , C-g` and `C-c C-t C-g` cancel the key chord instead of rerunning the last test. The respective command has been moved to `C-c , C-a`, `C-c , a`, `C-c C-t C-a` and `C-c C-t a`. -* [#2643](https://github.com/clojure-emacs/cider/issues/2643): **(Breaking)** Stop using the `cider.tasks/nrepl-server` custom task for `cider-jack-in` with Boot. -* [#2647](https://github.com/clojure-emacs/cider/issues/2647): `cider-repl-require-repl-utils` now loads cljs specific REPL utils in cljs buffers. -* [#2689](https://github.com/clojure-emacs/cider/issues/2689): `cider-load-buffer` now takes an optional `callback` that will override the default `cider-load-file-handler`. -* [#2689](https://github.com/clojure-emacs/cider/issues/2689): `cider-load-file-handler` now takes an optional `done-handler` lambda that is run once load is complete. - -### Bug fixes - -* [#2685](https://github.com/clojure-emacs/cider/pull/2658): Send `exclude-regexps` in apropos under correct key -* Stop cursor moving when initialising the CIDER REPL, when `cider-repl-pop-to-buffer-on-connect` is nil. This fixes a bug introduced by [commit e0aca78b](https://github.com/clojure-emacs/cider/commit/e0aca78ba56425e50ea895c5adc7c0331cee0b19). -* [#2577](https://github.com/clojure-emacs/cider/issues/2577): Ensure user friendly error messages if a REPL connection is expected but none was found in certain situations. -* [#2593](https://github.com/clojure-emacs/cider/issues/2593): The REPL's initial namespace is now set correctly if configured in another tool (e.g. Leiningen's `:init-ns`). -* [#2607](https://github.com/clojure-emacs/cider/pull/2607): Use markers for specifying insertion point for `cider-eval-*-to-comment`commands. This fixes a bug where editing the buffer during a pending evaluation resulted in comments appearing in unintended locations. -* [#2308](https://github.com/clojure-emacs/cider/issues/2308): Don't rely on the classpath in `cider-library-present-p`. Now it does a `require` instead to check if some library is present or not. -* [#2541](https://github.com/clojure-emacs/cider/issues/2541): Hook properly CIDER's code completion machinery. -* [#2659](https://github.com/clojure-emacs/cider/issues/2659): Handle `#shadow/env` reader tags in `cider--shadow-get-builds`. -* [#2676](https://github.com/clojure-emacs/cider/issues/2676): Widen before `cider--file-string`, to allow `cider-load-buffer` to work on narrowed buffers. -* Don't disable `cider-mode` until all CIDER sessions have been closed. - -## 0.21.0 (2019-02-19) - -### New features - -* The `cider-test-run-*` and `cider-ns-refresh-*` commands are now interruptible by the `cider-interrupt` command. -* Many commands now stream printed results back to the client incrementally – meaning it's now possible to, for example, interrupt evaluations while their result is being rendered. -* New option: `cider-repl-init-code`. This is a list of strings containing Clojure code to evaluate when the REPL starts (with bindings for any `set!`-able vars in place). Replaces `cider-print-length` and `cider-print-level`, which are now obsolete. -* New option: `cider-print-quota`. This is a hard limit on the number of bytes that will be returned by any printing operation. This defaults to one megabyte and can be set to `nil` if no limit is desired. - -### Changes - -* Add new defcustom `cider-switch-to-repl-on-insert`: Set to prevent cursor from going to the REPL when inserting a form in the REPL with the insert-to-repl commands. Replaces obsoleted `cider-switch-to-repl-after-insert-p` -* **(Breaking)** Upgrade to nREPL 0.6.0. This is now the minimum required version. -* **(Breaking)** Upgrade to piggieback 0.4.0. This is now the minimum required version. -* **(Breaking)** Remove `cider.nrepl.middleware.pprint`. All functionality has been replaced by the built-in printing support in nREPL 0.6. -* Option `cider-repl-scroll-on-output` is now obsolete, and the default REPL behavior has changed to _not_ recenter the window. The built-in variable `scroll-conservatively` can be set to 101 (either globally or locally in the REPL buffer) to restore the old behavior. This change has a dramatic positive effect on REPL performance. -* `cider-pprint-fn` and `cider-pprint-options` are now obsolete, replaced by `cider-print-fn` and `cider-print-options`. -* `cider-debug-print-options`, `cider-stacktrace-print-options`, and `cider-repl-pretty-print-width` are now all obsolete, replaced by `cider-print-options`. -* [#2546](https://github.com/clojure-emacs/cider/pull/2546): New defcustom `cider-ns-save-files-on-refresh-modes` to control for which buffers `cider-ns-refresh` should save before refreshing. - -### Bug fixes - -* Fix values for `cider-preferred-build-tool` variable. -* Fix value and safe property for `cider-allow-jack-in-without-project` variable. -* `cider-ns-save-files-on-refresh` will now save any modified buffers visiting files on the classpath, rather than just in the current project. -* `cider-expected-ns` no longer requires an absolute path as its argument, and now internally handles paths canonically and consistently. -* Fixed a bug causing REPL output to be inserted after the prompt. -* Fixed a bug causing `cider-pprint-eval-last-sexp-to-comment` and `cider-pprint-eval-defun-to-comment` to not insert anything. -* `cider-find-var` now correctly uses a new window when passed a prefix of `-` or a double prefix argument. - -## 0.20.0 (2019-01-14) - -### New features - -* Make it possible to pass an options map to the currently selected pprint function via `cider-pprint-options`. -* Add support for zprint. -* Make it possible to eval and pprint in the scratch buffer using `C-u C-j`. -* [#2532](https://github.com/clojure-emacs/cider/pull/2532): Add support for `CompilationException` dynamic source location discovery. - -### Changes - -* [#2496](https://github.com/clojure-emacs/cider/issues/2496): Replace CIDER's pprint implementation with nREPL 0.5's built-in pprint support. -* [#2558](https://github.com/clojure-emacs/cider/pull/2558): Load clj, cljc, & cljs (if cljs REPL available) files on `cider-load-all-files` (`C-c C-M-l`). Previously, this only loaded clj files. -* Enable pretty-printing in the REPL by default. - -### Bug fixes - -* [#2532](https://github.com/clojure-emacs/cider/pull/2532): Fix re-display hangs while dynamically recovering source locations under mouse pointer. -* [#2560](https://github.com/clojure-emacs/cider/pull/2560): Detect REPL type for completion, eldoc and info ops. - -## 0.19.0 (2019-01-01) - -### New features - -* [#2430](https://github.com/clojure-emacs/cider/issues/2375): `cider-find-var` opens archive files inside [AVFS](http://avf.sourceforge.net) folders if AVFS is detected. -* [#2446](https://github.com/clojure-emacs/cider/issues/2446): Implement Sesman friendly sessions to allow for on-the-fly association with sessions from dependency projects and jars. -* [#2253](https://github.com/clojure-emacs/cider/issues/2253): Split `continue` debug command into "continue till next breakpoint" (`c`) and "continue non stop" (`C`) commands. - -### Bug fixes - -* [#2474](https://github.com/clojure-emacs/cider/issues/2474): Fix incorrect detection of output and out-of-order printing. -* [#2514](https://github.com/clojure-emacs/cider/issues/2514): Don't auto-jump to warnings when `cider-auto-jump-to-error` is set to 'errors-only. -* [#2453](https://github.com/clojure-emacs/cider/issues/2453): Make it possible to debug deftype methods by direct insertion of #dbg and #break readers into the deftype methods. -* [#1869](https://github.com/clojure-emacs/cider/issues/1869),[cider-nrepl#460](https://github.com/clojure-emacs/cider-nrepl/issues/460): Fix `continue` debugger command which was stopping entering debugger on repeated invocations. -* [#2444](https://github.com/clojure-emacs/cider/issues/2444): Reuse dead REPL buffers on new connections. -* [#2441](https://github.com/clojure-emacs/cider/issues/2441): Make it possible to use `C-c C-x` keys without loading cider first (autoload `cider-start-map`). -* [#2440](https://github.com/clojure-emacs/cider/issues/2440): Make `cider-check-cljs-repl-requirements` take effect again. -* [#2439](https://github.com/clojure-emacs/cider/issues/2439): Remove mentions of `cider-toggle-connection-buffer` from the docs. -* [#2435](https://github.com/clojure-emacs/cider/issues/2435): Remove killed REPLs from sessions in client sentinel. -* Fix jack-in from inside of remote buffers. -* [#2454](https://github.com/clojure-emacs/cider/pull/2454): Fix erratic inspector behavior when multiple REPLs are connected -* [#2467](https://github.com/clojure-emacs/cider/pull/2467): Make generic CIDER ops use any available nREPL connection. -* [#2105](https://github.com/clojure-emacs/cider/issues/2105): Fix no comment syntax defined message when loading buffer after running a failing test. -* [#2115](https://github.com/clojure-emacs/cider/issues/2515): Reset the current buffer after `display-buffer`. - -### Changes - -* [#2482](https://github.com/clojure-emacs/cider/issues/2482): Don't bind nREPL server started by `cider-jack-in` to `::` (use `localhost` instead). -* [#2484](https://github.com/clojure-emacs/cider/pull/2484): Fix issues where some functionality in REPL buffers (like eldoc) was broken. -* [#2484](https://github.com/clojure-emacs/cider/pull/2484): REPL types are now symbols instead of strings. -* [#1544](https://github.com/clojure-emacs/cider/issues/1544): Add a new defcustom `cider-infer-remote-nrepl-ports` to control whether we use tramp/ssh to infer remote ports. Now defaulting to `nil` (previously it always tried to infer). - -## 0.18.0 (2018-09-02) - -### New features - -* [#2375](https://github.com/clojure-emacs/cider/issues/2375): Move `cider-eval-toplevel-inside-comment-form` into clojure-mode as `clojure-toplevel-inside-comment-form` so `beginning-of-defun` is aware of comment forms. -* Add new `cider-session-name-template` variable for flexible customization of cider session and REPL buffer names. -* Bind `C-c M-r` to `cider-restart`. -* Add new `cider-start-map` keymap (`C-c C-x`) for jack-in and connection commands. -* Add new `cider-ns-map` keymap (`C-c M-n`) for namespace related functionality. -* Allow evaling top level forms in a comment form rather than the entire comment form with `cider-eval-toplevel-inside-comment-form`. -* Create keymap for inserting forms into the REPL at `C-c C-j`. -* Add new defcustom `cider-invert-insert-eval-p`: Set to cause insert-to-repl commands to eval the forms by default when inserted. -* Add new defcustom `cider-switch-to-repl-after-insert-p`: Set to prevent cursor from going to the REPL when inserting a form in the REPL with the insert-to-repl commands. -* Inject piggieback automatically on `cider-jack-in-clojurescript`. -* Introduce a new command named `cider` (`C-c M-x`) that acts as a simple wrapper around all commands for starting/connecting to REPLs. -* [#2305](https://github.com/clojure-emacs/cider/issues/2305): Make it possible to disable the REPL type auto-detection by customizing `cider-repl-auto-detect-type`. -* [#2373](https://github.com/clojure-emacs/cider/issues/2373): Make it possible to configure the welcome message displayed in scratch buffers via `cider-scratch-initial-message`. -* Add the ability to jump to the profiler buffer using `cider-selector`. -* [#1980](https://github.com/clojure-emacs/cider/issues/1980): Echo back missing namespace name on interactive eval (requires nREPL 0.4.3+). -* [#2397](https://github.com/clojure-emacs/cider/pull/2397): Add shadow-select ClojureScript REPL type. -* [#2314](https://github.com/clojure-emacs/cider/pull/2314): Add `cider-ns-reload` and `cider-ns-reload-all` interactive commands. - -### Bugs fixed - -* [#2317](https://github.com/clojure-emacs/cider/issues/2317): The stdin prompt can now be cancelled. -* [#2328](https://github.com/clojure-emacs/cider/issues/2328): Added `cider-eval-sexp-to-point`. -* [#2310](https://github.com/clojure-emacs/cider/issues/2310): `cider-format-edn-last-sexp` will format the last sexp. -* [#2294](https://github.com/clojure-emacs/cider/issues/2294): Fix setting default stacktrace filters. -* [#2286](https://github.com/clojure-emacs/cider/issues/2286): Fix eldoc issue with images in the REPL. -* [#2307](https://github.com/clojure-emacs/cider/pull/2307): Use a better error when a cljs REPL form cannot be found. -* Fix the broken test selector functionality. -* [#2291](https://github.com/clojure-emacs/cider/issues/2291): `cider-use-tooltips` custom variable works as expected. -* [#2424](https://github.com/clojure-emacs/cider/issues/2424): Fallback to `lein` as the default jack-in command when `clojure` is not present. - -### Changes - -* **(Breaking)** Move `cider-repl-set-ns`, previously on `C-c M-n`, on `C-c M-n (M-)n` in the `cider-ns-map`. -* **(Breaking)** Move `cider-ns-refresh`, previously on `C-c C-x`, on `C-c M-n (M-)r` in the `cider-ns-map`. -* **(Breaking)** Bump the minimum required Emacs version to 25.1. -* **(Breaking)** Drop support for Java 7 and Clojure(Script) 1.7. -* **(Breaking)** Use session name as part of CIDER buffers names (REPL, server, messages), and obsolete `nrepl-buffer-name-separator` and `nrepl-buffer-name-show-port`. See `cider-session-name-template` and `cider-format-connection-params` for how to customize CIDER buffer names. -* **(Breaking)** Use a custom task (`cider.tasks/nrepl-server`) for `cider-jack-in` with Boot (that's done to provide access to newer nREPL features to users of older versions of Boot). -* Rename `cider-eval-defun-to-point` to `cider-eval-defun-up-to-point`. -* Add support for printing to the current buffer to `cider-eval-defun-up-to-point`. -* Remove `cider-ping` command. -* Remove `cider-visit-error-buffer` in favour of using `cider-selector`. -* Rename `cider-refresh` to `cider-ns-refresh` (and all the related defcustoms). -* **(Breaking)** Rewrote connection management (see https://docs.cider.mx/cider/usage/managing_connections.html for details). -* **(Breaking)** `cider-jack-in-clojurescript` now creates only a ClojureScript REPL (use `cider-jack-in-clj&cljs` to create both REPLs). -* [#2357](https://github.com/clojure-emacs/cider/issues/2357): Support both keywords and strings as test selectors (previously it was only strings). -* [#2378](https://github.com/clojure-emacs/cider/pull/2378): Add autoloads target to Makefile. -* Map `cider-pprint-eval-last-sexp` to `C-c C-v (C-)f (C-)e` in the `cider-eval-commands-map`. -* Map `cider-pprint-eval-defun-at-point` to `C-c C-v (C-)f (C-)d` in the `cider-eval-commands-map`. -* Accept bare figwheel-main build names (e.g., `dev`). Previously, a keyword (e.g., `:dev`) was required. -* Stop releasing CIDER and cider-nrepl together. cider-nrepl now has its own release cycle and CIDER introduces `cider-required-middleware-version` to track it. - -## 0.17.0 (2018-05-07) - -### New features - -* [#2248](https://github.com/clojure-emacs/cider/pull/2248): `cider-repl` can now display recognized images in the REPL buffer. -* [#2172](https://github.com/clojure-emacs/cider/pull/2172): Render diffs for expected / actual test results. -* [#2167](https://github.com/clojure-emacs/cider/pull/2167): Add new defcustom `cider-jdk-src-paths`. Configure it to connect stack trace links to Java source code. -* [#2161](https://github.com/clojure-emacs/cider/issues/2161): Add new interactive command `cider-eval-defun-to-point` which is bound to `C-c C-v (C-)z`. It evaluates the current top-level form up to the point. -* [#2113](https://github.com/clojure-emacs/cider/issues/2113): Add new interactive commands `cider-eval-last-sexp-in-context` (bound to `C-c C-v (C-)c`) and `cider-eval-sexp-at-point-in-context` (bound to `C-c C-v (C-)b`). -* Add new interactive command `cider-repl-set-type`. -* [#1976](https://github.com/clojure-emacs/cider/issues/1976): Add new interactive command `cider-connect-clojurescript`. -* Add a menu for `cider-browse-ns-mode`. -* [#2160](https://github.com/clojure-emacs/cider/issues/2160): Make it possible to configure the default `*print-level*` and `*print-length*` via defcustoms (`cider-repl-print-level` and `cider-repl-print-length`). -* New interactive command `cider-cheatsheet` allows you to browse the Clojure Cheatsheet with an Emacs interface. -* [#2191](https://github.com/clojure-emacs/cider/issues/2191): Add support for jacking-in just with the `clojure` command-line tool and `tools.deps`. -* Make it possible to start a Nashorn ClojureScript REPL. -* [#2235](https://github.com/clojure-emacs/cider/pull/2235): Make the REPL ignore blank input rather than evaluating. -* [#2241](https://github.com/clojure-emacs/cider/pull/2241): Make `cider-test-ediff` diff eval'ed values. -* Add support for shadow-cljs to `cider-jack-in`. -* [#2244](https://github.com/clojure-emacs/cider/issues/2244): Display the REPL type in the modeline. -* [#2238](https://github.com/clojure-emacs/cider/pull/2238): Allow specifying predicates for entries in `cider-jack-in-lein-plugins` and `cider-jack-in-nrepl-middlewares`. -* Add support for test selectors. If test all or all loaded is called with a prefix ask for filter test selectors in the minibuffer and only run those tests in the project which match the filters. Add variation of test namespace which asks for filter selectors the same way and only runs a subset of the namespace tests. -* Add a configuration variable allowing to control whether server output should be redirected to the REPL (`cider-redirect-server-output-to-repl`). - -### Bugs Fixed - -* [#1913](https://github.com/clojure-emacs/cider/issues/1913): Fix `cider-toggle-buffer-connection` to allow cycling of connection and restoring all connections in cljc buffers. -* [#2148](https://github.com/clojure-emacs/cider/issues/2148): Fix `jump to definition` working properly when remote `cider-jack-in` and `cider-connect`. -* Font-lock failed assertions even in tests that were evaluated interactively. -* [#2102](https://github.com/clojure-emacs/cider/issues/2102): Make `cider-format-buffer` handle mismatched parens gracefully. - -### Changes - -* [#2163](https://github.com/clojure-emacs/cider/issues/2163): Add `cider-browse-spec-regex`, and changed `cider-browse-spec-all` to use it. -* [#2029](https://github.com/clojure-emacs/cider/pull/2154): Make cider-doc use cider-browse-spec functionality to print the spec part of the doc buffer -* [#2151](https://github.com/clojure-emacs/cider/pull/2151): Improve formatting of spec in `cider-doc` buffer. -* Remove support for CLJX. -* Fix `cider-eval-region` masking `clojure-refactor-map` in `cider-repl-mode`. -* [#2171](https://github.com/clojure-emacs/cider/issues/2171): Update `See Also` mappings for Clojure 1.9. -* [#2202](https://github.com/clojure-emacs/cider/issues/2202): Make `cider-jack-in-clojurescript` prompt from the ClojureScript REPL type to use. -* [#2202](https://github.com/clojure-emacs/cider/issues/2202): Don't try to start a ClojureScript REPL before checking whether that's possible or not. -* [orchard#24](https://github.com/clojure-emacs/orchard/pull/24): Inspector now separately renders clickable keys and values when inspecting maps. -* [orchard#24](https://github.com/clojure-emacs/orchard/pull/24): Inspector now remembers the current page of each level of nesting when navigating big and nested collection. -* Require piggieback 0.3 or newer. -* Drops support for Rhino in favour of the modern Nashorn. - -## 0.16.0 (2017-12-28) - -### New Features - -* [#2082](https://github.com/clojure-emacs/cider/pull/2082), [cider-nrepl#440](https://github.com/clojure-emacs/cider-nrepl/pull/440): Add specialized stacktraces for clojure.spec assertions. -* [#2111](https://github.com/clojure-emacs/cider/pull/2111): Add `cider-pprint-eval-last-sexp-to-comment` and `cider-pprint-eval-defun-to-comment`. -* Add a REPL shortcut for `cider-repl-require-repl-utils` (this makes it easy to require common functions like `doc`, `source`, etc. in REPL buffers). -* [#2112](https://github.com/clojure-emacs/cider/issues/2112): Add a new interactive command `cider-find-keyword` (bound to `C-c C-:`). -* [#2144](https://github.com/clojure-emacs/cider/issues/2144): Create a Docker image to mimic the Travis CI environment. - -### Changes - -* `cider-switch-to-last-clojure-buffer` switches to most recent relevant Clojure(Script) buffer instead of the last "remembered" buffer. -* [cider-nrepl#438](https://github.com/clojure-emacs/cider-nrepl/pull/438): Improve startup time by deferring loading CIDER's middleware until the first usage. -* [#2078](https://github.com/clojure-emacs/cider/pull/2078): Improve startup time by bundling together sync requests during startup. -* `cider-rotate-default-connection` will warn if you use it with only a single active connection. -* `cider-format-buffer` tries to preserve the point position. - -### Bugs Fixed - -* [#2084](https://github.com/clojure-emacs/cider/issues/2084): Select correct REPL type (clj or cljs) in `cider-switch-to-repl-buffer` conditional on the current buffer. -* [#2088](https://github.com/clojure-emacs/cider/issues/2088): Fix functions defined with `def` being font-locked as vars instead of functions. -* [#1651](https://github.com/clojure-emacs/cider/issues/1651), [cider-nrepl#445](https://github.com/clojure-emacs/cider-nrepl/pull/455): Fix `cider-expected-ns` returns `nil` on boot projects. -* [#2120](https://github.com/clojure-emacs/cider/issues/2120): Fix Travis CI build errors for Emacs versions >25.2. -* [#2117](https://github.com/clojure-emacs/cider/pull/2117): Ensure `cider-repl-result-prefix` is only inserted before the first result chunk. -* [#2123](https://github.com/clojure-emacs/cider/issues/2123): Process properly the Java version in Java 9. - -## 0.15.1 (2017-09-13) - -### New Features - -* [#2083](https://github.com/clojure-emacs/cider/pull/2083): New utility function `cider-add-face`. -* [#2083](https://github.com/clojure-emacs/cider/pull/2083): New utility function `cider-run-chained-hook`. -* [#2083](https://github.com/clojure-emacs/cider/pull/2083): New `cider-repl-preoutput-hook` that allows custom output processing. -* [#2083](https://github.com/clojure-emacs/cider/pull/2083): Highlight clojure.spec keywords in REPL (`cider-repl-highlight-spec-keywords` pre-output processor). - -### Changes - -* [#2045](https://github.com/clojure-emacs/cider/issues/2045) `*cider-scratch*` buffers are no longer automatically killed on connection quit. -* [#2083](https://github.com/clojure-emacs/cider/pull/2083): Jump to other window when clicking on location references in REPL. -* [#2083](https://github.com/clojure-emacs/cider/pull/2083): Improve project namespace highlighting in REPLs. -* [#2083](https://github.com/clojure-emacs/cider/pull/2083): Find locations in more cases when clicking on references in REPL. - -### Bugs Fixed - -* [#2004](https://github.com/clojure-emacs/cider/issues/2004), [#2039](https://github.com/clojure-emacs/cider/issues/2039), [cider-nrepl#420](https://github.com/clojure-emacs/cider-nrepl/issues/420): Fix namespace issues in instrumentation and debugging commands. -* Project-Only stacktrace filter: hide all other tags when viewing project-only stacktrace. -* Fix interactive evaluation in cljc buffers with only one connection. -* [#2058](https://github.com/clojure-emacs/cider/pull/2058): Don't cache ns-forms in buffers with no such forms. -* [#2057](https://github.com/clojure-emacs/cider/pull/2057): Use `cider--font-lock-ensure` for compatibility with Emacs 24.5. -* [cider-nrepl#436](https://github.com/clojure-emacs/cider-nrepl/pull/436): Ensure that `*print-right-margin*` is not ignored by cider-nrepl middleware. -* [cider-nrepl#435](https://github.com/clojure-emacs/cider-nrepl/pull/435): Allow debugging of forms with `#?(:cljs ... :clj ..)` conditionals. -* [cider-nrepl#432](https://github.com/clojure-emacs/cider-nrepl/pull/432): Ensure `pprint` is after `load-file`. - -## 0.15.0 (2017-07-20) - -### New Features - -* [#2050](https://github.com/clojure-emacs/cider/pull/2050): Use `view-mode` for `cider-grimoire` buffers -* Make stacktraces and other location references in REPL clickable. -* Highlight root namespace in REPL stacktraces. -* Filter stacktrace to just frames from your project. -* [#1918](https://github.com/clojure-emacs/cider/issues/1918): Add new commands `cider-browse-spec` and `cider-browse-spec-all` which start a spec browser. -* [#2015](https://github.com/clojure-emacs/cider/pull/2015): Show symbols as special forms *and* macros in `cider-doc` -* [#2012](https://github.com/clojure-emacs/cider/pull/2012): Support special forms in `cider-apropos` and `cider-grimoire-lookup`. -* [#2007](https://github.com/clojure-emacs/cider/pull/2007): Fontify code blocks from `cider-grimoire` if possible. -* Add support for notifications from the NREPL server. -* [#1990](https://github.com/clojure-emacs/cider/issues/1990): Add new customation variable `cider-save-files-on-cider-refresh` to allow auto-saving buffers when `cider-refresh` is called. -* Add new function `cider-load-all-files`, along with menu bar update. -* Add new customization variable `cider-special-mode-truncate-lines`. -* Add an option `cider-inspector-fill-frame` to control whether the cider inspector window fills its frame. -* [#1893](https://github.com/clojure-emacs/cider/issues/1893): Add negative prefix argument to `cider-refresh` to inhibit invoking of cider-refresh-functions -* [#1776](https://github.com/clojure-emacs/cider/issues/1776): Add new customization variable `cider-test-defining-forms` allowing new test defining forms to be recognized. -* [#1860](https://github.com/clojure-emacs/cider/issues/1860): Add `cider-repl-history` to browse the REPL input history and insert elements from it into the REPL buffer. -* Add new customization variable `cider-font-lock-reader-conditionals` which toggles syntax highlighting of reader conditional expressions based on the buffer connection. -* Add new face `cider-reader-conditional-face` which is used to mark unused reader conditional expressions. -* [#1544](https://github.com/clojure-emacs/cider/issues/1544): Add a new defcustom `nrepl-use-ssh-fallback-for-remote-hosts` to control the behavior of `nrepl-connect` (and in turn that of `cider-connect`) for remote hosts. -* [#1910](https://github.com/clojure-emacs/cider/issues/1910): Add custom company-mode completion style to show fuzzy completions from Compliment. -* Introduce `cider-*-global-options` for customizing options that are not related to tasks. -* [#1731](https://github.com/clojure-emacs/cider/issues/1731): Change code in order to use the new `cider.tasks/add-middleware` boot tasks. -* [#1943](https://github.com/clojure-emacs/cider/pull/1943): Add interactive function to flush Compliment caches. -* [#1726](https://github.com/clojure-emacs/cider/issues/1726): Order keys in printed nrepl message objects. -* [#1832](https://github.com/clojure-emacs/cider/issues/1832): Add new customization variable `cider-eldoc-display-context-dependent-info` to control showing eldoc info for datomic query input parameters. -* Make it possible to disable auto-evaluation of changed ns forms via the defcustom `cider-auto-track-ns-form-changes`. -* [#1991](https://github.com/clojure-emacs/cider/issues/1832): Make it possible to disable the prompt to open a ClojureScript in a browser on connect via `cider-offer-to-open-cljs-app-in-browser`. -* [#1995](https://github.com/clojure-emacs/cider/pull/1995): Add new customization variable `cider-doc-auto-select-buffer` to control cider-doc popup buffer auto selection. -* Ensure that `cider-current-connection` picks the most recently used connection in ambiguous cases. -* Ensure that `cider-switch-to-repl-buffer` picks the most recent REPL buffer if multiple connections are available. -* Add new function `cider-project-connections-types`. - -### Changes - -* Handle ANSI REPL evaluation created by Puget. -* Drop support for Emacs 24.3. -* Don't try to use ssh automatically when connecting to remote hosts and a direct connection fails. See `nrepl-use-ssh-fallback-for-remote-hosts`. -* [#1945](https://github.com/clojure-emacs/cider/pull/1945): Start nREPL servers bound to `::` by default using `cider-jack-in`. -* Renamed `cider-prompt-save-file-on-load` to `cider-save-file-on-load` and adjust its supported values accordingly (the default now is `'prompt` and `'always-save` is now simply `t`). -* [#2014](https://github.com/clojure-emacs/cider/pull/2014): Unify the format for `forms-str` and `arglists-str`. -* [#2027](https://github.com/clojure-emacs/cider/pull/2027): Mark many custom variables relating to `cider-jack-in` as safe. -* [#2023](https://github.com/clojure-emacs/cider/issues/2023): Make popup-buffer sexp indentation optional. - -### Bugs Fixed - -* [#2040](https://github.com/clojure-emacs/cider/issues/2040): Fix fontification of conditional expressions in cljc files. -* [#2018](https://github.com/clojure-emacs/cider/issues/2018): Don't delete wrong overlays during code evaluation. -* [#1699](https://github.com/clojure-emacs/cider/issues/1699): Fix "Method code too large!" error that occurred during instrumentation for debugging. -* [#1987](https://github.com/clojure-emacs/cider/issues/1987): Fix: Update faces when disabling a theme -* [#1962](https://github.com/clojure-emacs/cider/issues/1962): Fix performance in fringe overlay placement. -* [#1947](https://github.com/clojure-emacs/cider/issues/1947): Fix error on `cider-jack-in` when `enlighten-mode` is enabled. -* [#1588](https://github.com/clojure-emacs/cider/issues/1588): Redirect `*err*`, `java.lang.System/out`, and `java.lang.System/err` to REPL buffer on all attached sessions. -* [#1707](https://github.com/clojure-emacs/cider/issues/1707): Allow to customize line truncating in CIDER's special buffers. -* [#1876](https://github.com/clojure-emacs/cider/issues/1876): Set pretty-printing width with `cider-repl-pretty-print-width`. If this variable is not set, fall back to `fill-column`. -* [#1875](https://github.com/clojure-emacs/cider/issues/1875): Ensure that loading and evaluation in cljc buffers is performed in both clj and cljs repls. -* [#1897](https://github.com/clojure-emacs/cider/issues/1897): Bind TAB in stacktrace buffers in the terminal. -* [#1895](https://github.com/clojure-emacs/cider/issues/1895): Connect to the same host:port after `cider-restart` if the connection was established with `cider-connect`. -* [#1881](https://github.com/clojure-emacs/cider/issues/1881): Add `cider-cljs-boot-repl` and `cider-cljs-gradle-repl` defcustom and hook `boot-cljs-repl`. -* [#1997](https://github.com/clojure-emacs/cider/pull/1997): Fix a nil error when loading a code buffer and the error buffer is visible. -* [#390](https://github.com/clojure-emacs/cider/issues/390): Workaround for orphaned java process on windows machine after quitting the REPL. - -## 0.14.0 (2016-10-13) - -### New Features - -* [#1825](https://github.com/clojure-emacs/cider/issues/1825): Display test input generated by `test.check`. -* [#1769](https://github.com/clojure-emacs/cider/issues/1769): Display function spec in the doc buffers. -* Add a new interactive command `cider-toggle-request-dispatch`. It allows you to quickly toggle between dynamic and static -request dispatch. -* Add a new interactive command `nrepl-toggle-message-logging`. It allows you to quickly toggle nREPL message logging on and off -within the scope of your current Emacs session. -* [#1851](https://github.com/clojure-emacs/cider/issues/1851): Add a command to rerun the last test ran via `cider-test-run-test`. The new command is named `cider-test-rerun-test` and is about to `C-c C-t (C-)g`. -* [#1748](https://github.com/clojure-emacs/cider/issues/1748): Add new interactive command `cider-pprint-eval-last-sexp-to-repl`. -* [#1789](https://github.com/clojure-emacs/cider/issues/1789): Make it easy to change the connection of the cider-scratch buffer from the mode's menu. -* New interactive command `cider-toggle-buffer-connection`. -* [#1861](https://github.com/clojure-emacs/cider/issues/1861): New interactive commands in message log buffer `nrepl-log-expand-button` and `nrepl-log-expand-all-buttons`. -* [#1872](https://github.com/clojure-emacs/cider/issues/1872): Add new value `display-only` for option `cider-repl-pop-to-buffer-on-connect` that allows for showing the REPL buffer without focusing it. - -### Changes - -* [#1758](https://github.com/clojure-emacs/cider/issues/1758): Disable nREPL message logging by default due to its negative impact on performance. -* Warn when running `cider-jack-in` without a Clojure project. This behavior is controllable via `cider-allow-jack-in-without-project`. - -### Bugs Fixed - -* [#1677](https://github.com/clojure-emacs/cider/issues/1677): Interpret `\r` as a newline. -* [#1819](https://github.com/clojure-emacs/cider/issues/1819): Handle properly missing commands on `cider-jack-in`. -* Add option to define exclusions for injected dependencies. Fixes [#1824](https://github.com/clojure-emacs/cider/issues/1824): Can no longer jack-in to an inherited clojure version. -* [#1820](https://github.com/clojure-emacs/cider/issues/1820): Don't try to display eldoc in EDN buffers. -* [#1823](https://github.com/clojure-emacs/cider/issues/1823): Fix column location metadata set by interactive evaluation. -* [#1859](https://github.com/clojure-emacs/cider/issues/1859): Make nREPL message log much faster. `nrepl-dict-max-message-size` custom variable was removed. -* [#1613](https://github.com/clojure-emacs/cider/issues/1859): Check whether a before/after refresh function is resolvable. - -## 0.13.0 (2016-07-25) - -### New Features - -* Add an option `nrepl-prompt-to-kill-server-buffer-on-quit` to control whether killing nREPL server buffer and process requires a confirmation prompt. -* [#1672](https://github.com/clojure-emacs/cider/issues/1672): Allow setting a preferred build tool when multiple are found via `cider-preferred-build-tool`. -* Ensure Clojure version meets minimum supported by CIDER (1.7.0). -* Fringe indicators highlight which sexps have been loaded. Disable it with `cider-use-fringe-indicators`. -* New command: `cider-inspect-last-result`. -* `cider-cljs-lein-repl` now also supports figwheel. -* Option `cider-jack-in-auto-inject-clojure` enables the user to specify a - version of Clojure for CIDER. This allows the user to override the version - used in a project, particular if it is lower than minimum required for CIDER. -* Allow the ns displayed by eldoc to be tailored via `cider-eldoc-ns-function`. -* After connecting a ClojureScript REPL, CIDER will try to figure out if it's being served on a port and will offer to open it in a browser. -* [#1720](https://github.com/clojure-emacs/cider/issues/1720): Add a command `cider-eval-sexp-at-point` to evaluate the form around point (bound to `C-c C-v v`). -* [#1564](https://github.com/clojure-emacs/cider/issues/1564): CIDER's internal namespaces and vars are filtered from the ns-browser and apropos functions. -* [#1725](https://github.com/clojure-emacs/cider/issues/1725): Display class names in eldoc for interop forms. -* [#1572](https://github.com/clojure-emacs/cider/issues/1572): Add support for variables in eldoc. -* [#1736](https://github.com/clojure-emacs/cider/issues/1736): Show "See Also" links for functions/variables in documentation buffers. -* [#1767](https://github.com/clojure-emacs/cider/issues/1767): Add a command `cider-read-and-eval-defun-at-point` to insert the defun at point into the minibuffer for evaluation (bound to `C-c C-v .`). -* [#1646](https://github.com/clojure-emacs/cider/issues/1646): Add an option `cider-apropos-actions` to control the list of actions to be applied on the symbol found by an apropos search. -* [#1783](https://github.com/clojure-emacs/cider/issues/1783): Put eval commands onto single map bound to `C-c C-v`. -* [#1804](https://github.com/clojure-emacs/cider/issues/1804): Remember cursor position between `cider-inspector-*` operations. - -### Changes - -* Simpler keybindings in macroexpand buffer. Expand one step with `m` and all expansions with `a`. Previously was `C-c C-m` and `C-c M-m`. -* Signal an error sooner if the user misconfigured `cider-known-endpoints`. -* `cider-inspect-read-and-inspect` is obsolete. Use `cider-inspect-expression` instead. -* Extremely long overlays are truncated and `cider-inspect-last-result` is recommended. -* Signal `user-error` instead of `error` on jack-in if a project type is not supported. -* Users with `boot.sh` instead of `boot` should customize `cider-boot-command` instead of relying on automatic detection. -* [#1737](https://github.com/clojure-emacs/cider/issues/1737): Show value of locals in debugger tooltip. -* Rebind `cider-eval-last-sexp-and-replace` to `C-c C-v w`. -* Rebind `cider-eval-region` to `C-c C-v r`. -* Rebind `cider-eval-ns-form` to `C-c C-v n`. -* [#1577](https://github.com/clojure-emacs/cider/issues/1577): Show first line of docstring in ns browser. -* `cider-repl-closing-return` (`C-<Return>`) now also completes brackets (`[]`) and curly braces (`{}`) in an expression. - -### Bugs fixed - -* [#1755](https://github.com/clojure-emacs/cider/issues/1755): Impossible completion for multiple zombie REPL buffers. -* [#1712](https://github.com/clojure-emacs/cider/issues/1712): Bad compilation issue caused when installed along with `nim-mode`. -* Fix arglist display for `def` in the doc buffer. -* Use `cider-apropos-select` instead of `cider-apropos` in `cider-apropos-documentation-select`. -* [#1561](https://github.com/clojure-emacs/cider/issues/1561): Use an appropriate font-lock-face for variables, macros and functions in -the ns-browser. -* [#1708](https://github.com/clojure-emacs/cider/issues/1708): Fix `cider-popup-buffer-display` when another frame is used for the error buffer. -* [#1733](https://github.com/clojure-emacs/cider/pull/1733): Better error handling when no boot command is found in `exec-path`. -* Fix orphaned nrepl-messages buffer after `cider-quit`. -* [#1782](https://github.com/clojure-emacs/cider/issues/1782): Disable mouse-over tooltips when `help-at-pt-display-when-idle` is non-nil. -* [#1811](https://github.com/clojure-emacs/cider/issues/1811): Handle properly jack-in commands with spaces in them. - -## 0.12.0 (2016-04-16) - -### New Features - -* Option `cider-use-tooltips` controls the display of mouse-over tooltips. -* `f` key reruns failed tests on the test-report buffer. -* `g` key reruns test at point on the test-report buffer. -* Debugger now supports step-in. -* Improve CIDER's menu-bar menu: - - Thoroughly reorganize it and split it into 3 separate menus; - - Add custom-written `:help` strings to some items, and automatically add help strings to the rest; - - Add a few commands; - - Grey-out commands that rely on connections while there is no connection. -* Var docstrings are automatically displayed in mouse-over tooltips. -* [#1636](https://github.com/clojure-emacs/cider/pull/1636): New minor-mode `cider-auto-test-mode` for test-driven-development. When activated, tests are rerun after every load-file. -* Javadoc commands take into account the variable `clojure.java.javadoc/*remote-javadocs*`. -* Javadoc also works on classes of the AmazonAWS Java SDK. -* Apropos commands now accept lists of space-separated words as arguments, in addition to regular expressions (similar to Emacs's own apropos commands). -* [#1541](https://github.com/clojure-emacs/cider/issues/1541): New commands `cider-apropos-select` (bound to `C-c C-d C-s`) and `cider-apropos-documentation-select` (bound to `C-c C-d c-e`). -* New function `cider-expected-ns` is like `clojure-expected-ns`, but uses classpath for better results. See [clojure-mode#372](https://github.com/clojure-emacs/clojure-mode/issues/372). -* A double prefix argument (`C-u C-u`) for `cider-eval-defun-at-point` debugs the sexp at point instead of the entire defun, and offers to create a conditional breakpoint. -* New command `cider-load-all-project-ns` allows you to load all project namespaces. -* Display eldoc for keywords used to get map keys. -* Display eldoc for `Classname.`. -* Display namespace in eldoc. -* [cider-nrepl#313](https://github.com/clojure-emacs/cider-nrepl/issues/313): Selectively suppress user-specified categories of middleware errors from foregrounding stacktrace buffers via the `cider-stacktrace-suppressed-errors` variable. - -### Changes - -* Doc buffer splits arglists into several lines. -* Changed the face of the words “Macro” and “Special form” in the doc buffer to be easier to see. -* Display multi-line eval overlays at the start of the following line. It looked weird that these overlays started on the middle of a line, but then folded onto the start of following lines. -* [#1627](https://github.com/clojure-emacs/cider/issues/1627): Align the terminology used by `cider-test` with the one used by lein and boot (use the terms `assertion` and `test`). -* Remove the warning about missing nREPl ops. -* [#1420](https://github.com/clojure-emacs/cider/issues/1420): Show stacktrace buffers for sync requests errors. - -### Bugs fixed - -* [cider-nrepl#329](https://github.com/clojure-emacs/cider-nrepl/pull/329): Fix error instrumenting functions that call clojure.tools.logging. -* [#1643](https://github.cim/clojure-emacs/cider/issues/1643): Running tests no longer deletes unrelated overlays. -* [#1632](https://github.com/clojure-emacs/cider/pull/1632): Redefining a function correctly updates eldoc. -* [#1630](https://github.com/clojure-emacs/cider/pull/1630): The debugger no longer gets confused inside `@` redefs. -* [#1599](https://github.com/clojure-emacs/cider/pull/1599): Don't error when test makes 0 assertions. -* [#1563](https://github.com/clojure-emacs/cider/issues/1563): Handle invalid regular expressions in apropos. -* [#1625](https://github.com/clojure-emacs/cider/issues/1625): Display a more meaningful message when running -an individual test using `C-c C-t t`. -* Fix buffer closing in `cider-close-ancillary-buffers`. -* Dynamic font-locking is also refreshed when a file's namespace depends on a namespace that was changed, so the traced-face should be immediately updated even on functions from another namespace. -* [#1656](https://github.com/clojure-emacs/cider/issues/1656): Apply ansi colors to output when doing eval and print. - -## 0.11.0 (2016-03-03) - -### New features - -* [#1545](https://github.com/clojure-emacs/cider/pull/1545): New feature: Enlighten. See the new Readme section for more information. -* [#1169](https://github.com/clojure-emacs/cider/pull/1169): New command `cider-eval-defun-to-comment`. -* Change default value of `cider-overlays-use-font-lock` to `t`. Unlike before, a value of `t`, causes `cider-result-overlay-face` is to be prepended to the font-lock faces (instead of just not being used). -* `cider-result-overlay-face` default value changed to a background and a box, so it can be prepended to other faces without overriding the foreground. -* [#1518](https://github.com/clojure-emacs/cider/pull/1518): Add `cider-dynamic-indentation` defcustom, to disable dynamic indent functionality. -* Font-lock traced vars. -* New defcustom, `cider-pprint-fn`, allows you to set the function to use when pretty-printing evaluation results. -* [#1432](https://github.com/clojure-emacs/cider/issues/1432): Show explicit error messages when invoking commands with no ClojureScript support. -* [#1463](https://github.com/clojure-emacs/cider/issues/1463): Assume that `cider-connect` is invoked from within a project, -and try to associate the created connection with this project automatically. -* Typing `s` in a debug session shows the current stack. -* Typing `h` (as in *h*ere) skips all sexps until the current point position. -* [#1507](https://github.com/clojure-emacs/cider/issues/1507): Add the ability to control the REPL's scroll on output functionality via `cider-repl-scroll-on-output`. -* [#1543](https://github.com/clojure-emacs/cider/issues/1543): Add some getting started instructions to the welcome banner. -* New command `cider-drink-a-sip`. Use in case you're thirsty for knowledge. -* Make the connection message configurable via `cider-connection-message-fn`. This means now you can have any function (e.g. `cider-random-tip`) provide the second part of the message. -* New command `cider-repl-clear-banners`. -* New command `cider-repl-clear-help-banner`. - -### Changes - -* [#1531](https://github.com/clojure-emacs/cider/issues/1531) `cider-jack-in` now injects its own dependencies using CLI. Both leiningen and boot are supported. Set `cider-inject-dependencies-at-jack-in` to nil to opt out. Extension point for other tools to inject their own dependencies is `cider-add-repl-dependencies`. -* `cider-inspect` now operates by default on the last sexp. Its behavior can be altered via prefix arguments. -* Requires Clojure(Script) 1.7 or newer. -* Requires Java 7 or newer. -* Improve stacktrace presentation of compiler errors (readability, DWIM point positioning). -* [#1458](https://github.com/clojure-emacs/cider/issues/1458): Separate nREPL messages by connections instead of by sessions. -* [#1226](https://github.com/clojure-emacs/cider/issues/1226): Enable running of all loaded and all project tests. -* Give test commands their own keybinding prefix (`C-c C-t`). Use both single-key and - `Control` + letter mnemonics for these commands (as for the documentation - commands). -* `cider-test` commands now have keybindings in `cider-repl-mode`. The keybindings are exactly the same as those in `cider-mode`. -* Changed the binding of `cider-apropos-documentation` to `C-c C-d f` and `C-c C-d C-f` (it was `C-c C-d A`). -* [#1584](https://github.com/clojure-emacs/cider/issues/1584): Don't enable `eldoc-mode` automatically in `cider-repl-mode`. -* [#1585](https://github.com/clojure-emacs/cider/issues/1585): Show the eval command in the debugger's prompt. - -### Bugs fixed - -* [#1578](https://github.com/clojure-emacs/cider/issues/1578): nrepl-server-filter called with dead process buffer in Windows. -* [#1441](https://github.com/clojure-emacs/cider/issues/1441): Don't popup a buffer that's already displayed. -* [#1557](https://github.com/clojure-emacs/cider/issues/1557): When a sibling REPL is started by hasn't yet turned into a cljs REPL, it won't hijack clj requests. -* [#1562](https://github.com/clojure-emacs/cider/issues/1562): Actually disable cider-mode when it gets disabled. -* [#1540](https://github.com/clojure-emacs/cider/issues/1540): Fix cider-complete-at-point. -* [cider-nrepl#294](https://github.com/clojure-emacs/cider-nrepl/issues/294): Handle errors in the `complete-doc` nREPL op. -* [#1493](https://github.com/clojure-emacs/cider/issues/1493): Support special forms in eldoc. -* [#1529](https://github.com/clojure-emacs/cider/issues/1529): Close nREPL message buffer when you quit its matching connection. -* [#707](https://github.com/clojure-emacs/cider/issues/707): Better support clojure.test/with-test. -* Fix namespace navigation in the namespace browser. -* [#1565](https://github.com/clojure-emacs/cider/issues/1565): Fix font-locking in apropos buffers. -* [#1570](https://github.com/clojure-emacs/cider/issues/1570): Handle properly rest params in eldoc. - -## 0.10.2 (2016-01-27) - -### Changes - -* `cider-current-connection` actually, really considers major mode before `cider-repl-type`. - -### Bugs fixed - -* [#1521](https://github.com/clojure-emacs/cider/pull/1521): Don't assume the REPL buffer is in the current frame in `cider-repl--show-maximum-output`. - -## 0.10.1 (2016-01-05) - -### Changes - -* Suppress eldoc when the current sexp seems to be too large. -* [#1500](https://github.com/clojure-emacs/cider/pull/1500): Improve the performance of REPL buffers by using text properties instead of overlays for ANSI coloring. -* `cider-current-connection` considers major mode before `cider-repl-type`. - -### Bugs fixed - -* [#1450](https://github.com/clojure-emacs/cider/pull/1450): Fix an error in `cider-restart` caused by a reference to a killed buffer. -* [#1456](https://github.com/clojure-emacs/cider/issues/1456): Don't font-lock buffer if font-lock-mode is OFF. -* [#1459](https://github.com/clojure-emacs/cider/issues/1459): Add support for dynamic dispatch in scratch buffers. -* [#1466](https://github.com/clojure-emacs/cider/issues/1466): Correctly font-lock pretty-printed results in the REPL. -* [#1475](https://github.com/clojure-emacs/cider/pull/1475): Fix `args-out-of-range` error in `cider--get-symbol-indent`. -* [#1479](https://github.com/clojure-emacs/cider/pull/1479): Make paredit and `cider-repl-mode` play nice. -* [#1452](https://github.com/clojure-emacs/cider/issues/1452): Fix wrong ANSI coloring in the REPL buffer. -* [#1486](https://github.com/clojure-emacs/cider/issues/1486): Complete a partial fix in stacktrace font-locking. -* [#1482](https://github.com/clojure-emacs/cider/issues/1482): Clear nREPL sessions when a connection is closed. -* [#1435](https://github.com/clojure-emacs/cider/issues/1435): Improve error display in cider-test. -* [#1379](https://github.com/clojure-emacs/cider/issues/1379): Fix test highlighting at start of line. -* [#1490](https://github.com/clojure-emacs/cider/issues/1490): Don't display the inspector buffer when evaluation fails. - -## 0.10.0 (2015-12-03) - -### New features - -* [#1406](https://github.com/clojure-emacs/cider/issues/1406): When running tests, report test ns in minibuffer messages. -* [#1402](https://github.com/clojure-emacs/cider/pull/1402): When tests pass after previously failing, update the test-report buffer to show success. -* [#1373](https://github.com/clojure-emacs/cider/issues/1373): Add gradle support for `cider-jack-in`. -* Indentation of macros (and functions) [can be specified](https://docs.cider.mx/cider/config/indentation.html#_dynamic_indentation) in the var's metadata, via [indent specs](https://docs.cider.mx/cider/indent_spec.html). -* [Abbreviated printing](https://github.com/clojure-emacs/cider-nrepl/pull/268) for functions multimethods. Instead of seeing `#object[clojure.core$_PLUS_ 0x4e648e99 "clojure.core$_PLUS_@4e648e99"]` you'll see `#function[clojure.core/+]`. -* [#1376](https://github.com/clojure-emacs/cider/pull/1376): Anything printed to `*out*` outside an eval scope is also forwarded to all nREPL sessions connected from CIDER. Normally it would only be sent to the server's `out`. -* [#1371](https://github.com/clojure-emacs/cider/issues/1371): Font-lock deprecated vars with a background color. -* [#1232](https://github.com/clojure-emacs/cider/pull/1232): Add `cider-load-buffer-and-switch-to-repl-buffer`. -* [#1325](https://github.com/clojure-emacs/cider/issues/1325): Jump to error location when clicking on the error message in the stack-trace pop-up. -* [#1301](https://github.com/clojure-emacs/cider/issues/1301): CIDER can do dynamic font-locking of defined variables, functions, and macros. This is controlled by the `cider-font-lock-dynamically` custom option. -* [#1271](https://github.com/clojure-emacs/cider/issues/1271): New possible value (`always-save`) for `cider-prompt-save-file-on-load`. -* [#1197](https://github.com/clojure-emacs/cider/issues/1197): Display some indication that we're waiting for a result for long-running evaluations. -* [#1127](https://github.com/clojure-emacs/cider/issues/1127): Make it possible to associate a buffer with a connection (via `cider-assoc-buffer-with-connection`). -* [#1217](https://github.com/clojure-emacs/cider/issues/1217): Add new command `cider-assoc-project-with-connection` to associate a project directory with a connection. -* [#1248](https://github.com/clojure-emacs/cider/pull/1248): Add <kbd>TAB</kbd> and <kbd>RET</kbd> keys to the test-report buffer. -* [#1245](https://github.com/clojure-emacs/cider/pull/1245): New variable, `cider-overlays-use-font-lock` controls whether results overlay should be font-locked or just use a single face. -* [#1235](https://github.com/clojure-emacs/cider/pull/1235): Add support for syntax-quoted forms to the debugger. -* [#1212](https://github.com/clojure-emacs/cider/pull/1212): Add pagination of long collections to inspector. -* [#1237](https://github.com/clojure-emacs/cider/pull/1237): Add two functions for use with `cider-repl-prompt-function`, `cider-repl-prompt-lastname` and `repl-prompt-abbreviated`. -* [#1201](https://github.com/clojure-emacs/cider/pull/1201): Integrate overlays with interactive evaluation. `cider-use-overlays` can be used to turn this on or off. -* [#1195](https://github.com/clojure-emacs/cider/pull/1195): CIDER can [create cljs REPLs](https://github.com/clojure-emacs/cider#clojurescript-usage). -* [#1191](https://github.com/clojure-emacs/cider/pull/1191): New custom variables `cider-debug-print-level` and `cider-debug-print-length`. -* [#1188](https://github.com/clojure-emacs/cider/pull/1188): New debugging tool-bar. -* [#1187](https://github.com/clojure-emacs/cider/pull/1187): The list of keys displayed by the debugger can be configured with `cider-debug-prompt`. -* [#1187](https://github.com/clojure-emacs/cider/pull/1187): While debugging, there is a menu on the menu-bar listing available commands. -* [#1184](https://github.com/clojure-emacs/cider/pull/1184): When the user kills the REPL buffer, CIDER will offer to kill the nrepl buffer and process too. Also, when the client (repl) process dies, the server (nrepl) process is killed too. -* [#1182](https://github.com/clojure-emacs/cider/pull/1182): New command `cider-browse-instrumented-defs`, displays a buffer listing all definitions currently instrumented by the debugger. -* [#1182](https://github.com/clojure-emacs/cider/pull/1182): Definitions currently instrumented by the debugger are marked with a red box in the source buffer. -* [#1174](https://github.com/clojure-emacs/cider/pull/1174): New command `cider-run`, runs the project's `-main` function. -* [#1176](https://github.com/clojure-emacs/cider/pull/1176): While debugging, cider's usual eval commands will evaluate code in the current lexical context. Additionally, the <kbd>l</kbd> key now inspects local variables. -* [#1149](https://github.com/clojure-emacs/cider/pull/1149): [Two new ways](https://github.com/clojure-emacs/cider#debugging) to debug code, the `#break` and `#dbg` reader macros. -* [#1219](https://github.com/clojure-emacs/cider/pull/1219): The output of `cider-refresh` is now sent to a dedicated `*cider-refresh-log*` buffer. -* [#1219](https://github.com/clojure-emacs/cider/pull/1219): New custom variables `cider-refresh-before-fn` and `cider-refresh-after-fn`. -* [#1220](https://github.com/clojure-emacs/cider/issues/1220): Treat keywords as symbols in lookup commands like `cider-find-var`. -* [#1241](https://github.com/clojure-emacs/cider/pull/1241): Passing a double prefix argument to `cider-refresh` will now clear the state of the namespace tracker used by the refresh middleware. This is useful for recovering from errors that a normal reload would not otherwise recover from, but may cause stale code in any deleted files to not be completely unloaded. -* New defcustom `cider-result-use-clojure-font-lock` allows you disable the use of Clojure font-locking for interactive results. -* [#1239](https://github.com/clojure-emacs/cider/issues/1239): New defcustom `cider-refresh-show-log-buffer`, controls the behavior of the `*cider-refresh-log*` buffer when calling `cider-refresh`. When set to nil (the default), the log buffer will still be written to, but not displayed automatically. Instead, the most relevant information will be displayed in the echo area. When set to non-nil, the log buffer will be displayed every time `cider-refresh` is called. -* [#1328](https://github.com/clojure-emacs/cider/issues/1328): Auto-scroll the `*nrepl-server*` buffer on new output. -* [#1300](https://github.com/clojure-emacs/cider/issues/1300): Add the ability to replicate an existing connection with `cider-replicate-connection`. -* [#1330](https://github.com/clojure-emacs/cider/issues/1330): Leverage nREPL 0.2.11's source-tracking feature. -* [#1392](https://github.com/clojure-emacs/cider/issues/1392): Track definitions made in the REPL. -* [#1337](https://github.com/clojure-emacs/cider/issues/1337): Added a command to switch between the Clojure and ClojureScript REPLs in the same project (bound to <kbd>C-c M-o</kbd> in `cider-repl-mode`). - -### Changes - -* [#1299](https://github.com/clojure-emacs/cider/issues/1299) <kbd>C-c C-k</kbd> and <kbd> C-c C-l</kbd> now dispatch to both the Clojure and ClojureScript REPL (in the same project) when called from a `.cljc` or `.cljx` file. -* [#1397](https://github.com/clojure-emacs/cider/issues/1297) <kbd>C-c M-n</kbd> now changes the ns of both the Clojure and ClojureScript REPL (in the same project) when called from a cljc or cljx file. -* [#1348](https://github.com/clojure-emacs/cider/issues/1348): Drop the dash dependency. -* The usage of the default connection has been reduced significantly. Now evaluations & related commands will be routed via the connection matching the current project automatically unless there's some ambiguity when determining the connection (like multiple or no matching connections). Simply put you'll no longer have to mess around much with connecting-setting commands (e.g. `nrepl-connection-browser`, `cider-rotate-default-connection`). -* [#732](https://github.com/clojure-emacs/cider/issues/732): `cider-quit` and `cider-restart` now operate on the current connection only. With a prefix argument they operate on all connections. -* `nrepl-log-messages` is now set to `t` by default. -* Renamed `cider-repl-output-face` to `cider-repl-stdout-face` and `cider-repl-err-output-face` to `cider-repl-stderr-face`. -* Clearing the REPL buffer is now bound to `C-u C-C C-o`. -* [#1422](https://github.com/clojure-emacs/cider/issues/1422): Don't display mismatching parens error on incomplete expressions in REPL buffers. -* [#1412](https://github.com/clojure-emacs/cider/issues/1412): nREPL messages for separate sessions are tracked in separate buffers. -* Removed `cider-switch-to-repl-command`. -* Renamed `cider-default-repl-command` to `cider-jack-in-default`. - -### Bugs fixed - -* [#1384](https://github.com/clojure-emacs/cider/pull/1384): Match windows file names in `cider-compilation-regexp`. -* [#1252](https://github.com/clojure-emacs/cider/issues/1252) `cider-repl-clear-buffer` stops working in certain circumstances. -* [#1164](https://github.com/clojure-emacs/cider/pull/1164): Fix an error in `cider-browse-ns--doc-at-point`. -* [#1189](https://github.com/clojure-emacs/cider/issues/1189): Don't show result from automatic ns form evaluation. -* [#1079](https://github.com/clojure-emacs/cider/issues/1079): Don't try to font-lock very long results. The maximum font-lockable result length is controlled by `cider-font-lock-max-length`. - -## 0.9.1 (2015-06-24) - -### New features - -* [#1155](https://github.com/clojure-emacs/cider/pull/1155): The debugger displays overlays highlighting the current sexp and its return value. - -### Bugs fixed - -* [#1142](https://github.com/clojure-emacs/cider/issues/1142): Don't retrieve nrepl ports when `cider-known-endpoints` entry already contains the port. -* [#1153](https://github.com/clojure-emacs/cider/pull/1153): Fix behavior of `cider-switch-to-current-repl-buffer`. -* [#1139](https://github.com/clojure-emacs/cider/issues/1139): Fix evaluation of ns forms and of forms with unevaluated namespaces. -* Replace `assert` with `cl-assert` (we don't use anything from `cl` now). -* [#1135](https://github.com/clojure-emacs/cider/pull/1135): Fix a corner case with locals display in the debugger. -* [#1129](https://github.com/clojure-emacs/cider/issues/1129): Fix occasional `(wrong-type-argument stringp nil)` on clojure-android. -* [#1122](https://github.com/clojure-emacs/cider/issues/1122): Run client initialization in new client buffer. -* [#1143](https://github.com/clojure-emacs/cider/issues/1143): Handle tests without location metadata. - -## 0.9.0 (2015-06-16) - -### New features - -* [#1109](https://github.com/clojure-emacs/cider/issues/1109): New defcustom `cider-auto-mode`. -On by default, when `nil` don't automatically enable `cider-mode` in all Clojure buffers. -* [#1061](https://github.com/clojure-emacs/cider/issues/1061): New command `cider-find-ns`, bound to <kbd>C-c C-.</kbd>, which prompts for an ns and jumps to the corresponding source file. -* [#1019](https://github.com/clojure-emacs/cider/pull/1019): New file, cider-debug.el. - Provides a new command, `cider-debug-defun-at-point`, bound to <kbd>C-u C-M-x</kbd>. - Interactively debug top-level clojure forms. -* New defcustom, `cider-auto-select-test-report-buffer` (boolean). - Controls whether the test report buffer is selected after running a test. Defaults to true. -* Trigger Grimoire doc lookup from doc buffers by pressing <kbd>g</kbd> (in Emacs) and <kbd>G</kbd> (in browser). -* [#903](https://github.com/clojure-emacs/cider/pull/903): Isolate - `nrepl-client` connection logic from CIDER. New hooks `cider-connected-hook` - and `cider-disconnected-hook`. -* [#920](https://github.com/clojure-emacs/cider/issues/920): Support `cider-jack-in` for boot-based projects. -* [#949](https://github.com/clojure-emacs/cider/issues/949): New custom var: `cider-default-repl-command`. -* New code formatting commands - `cider-format-buffer`, `cider-format-region` and `cider-format-defun`. -* New data formatting commands - `cider-format-edn-buffer` and `cider-format-edn-region`. -* New insert region in REPL command - `cider-insert-region-in-repl`. -* Pretty printing functionality moved to middleware, adding support for ClojureScript. - - New command to eval and pprint result: `cider-interactive-pprint-eval`. - - `cider-format-pprint-eval` has been removed. -* Warn when used with incompatible nREPL server. -* Allow the prompt to be tailored by adding `cider-repl-prompt-function` and `cider-repl-default-prompt`. -* Support for middleware-annotated completion candidates. - - `cider-annotate-completion-function` controls how the annotations are formatted. - - `cider-completion-annotations-alist` controls the abbreviations used in annotations. - - `cider-completion-annotations-include-ns` controls when to include the candidate namespace in annotations. -* Inspector middleware now relies on `eval` middleware, adding support for ClojureScript. -* Better printing of large amounts of exception cause data in the error buffer. - - New defcustom, `cider-stacktrace-print-length` (boolean). -* [#958](https://github.com/clojure-emacs/cider/pull/958): Reuse existing repl - buffers with dead processes. Users are now informed about existing zombie repl - buffers and are offered the choice to reuse those for new connections. -* New defcustom, `cider-prompt-for-symbol`. Controls whether to prompt for - symbol when interactive commands require one. Defaults to t, which always - prompts. Currently applies to all documentation and source lookup commands. -* [#1032](https://github.com/clojure-emacs/cider/issues/1032): New functions, `cider-find-dwim` and - `cider-find-dwim-other-window`. These functions combine the functionality of `cider-jump-to-var` and - `cider-jump-to-resource`. Which are now renamed to `cider-find-var` and `cider-find-resource` respectively. -* [#1014](https://github.com/clojure-emacs/cider/issues/1014): A prefix of <kbd>-</kbd> causes `cider-find-var` and - `cider-find-resource` to show results in other window. Additionally, a double prefix argument <kbd>C-u C-u</kbd> - inverts the meaning of `cider-prompt-for-symbol` and shows the results in other window. -* [#1062](https://github.com/clojure-emacs/cider/issues/1062): Added completion candidates to `cider-find-resource`. -* Middleware support for Piggieback 0.2.x. -* In the namespace browser, `d` and `s` are now bound to show the documentation - or the source respectively for the symbol at point. -* [#1090](https://github.com/clojure-emacs/cider/issues/1090): New defcustom, - `cider-macroexpansion-print-metadata` (boolean). Controls whether metadata of - forms is included in macroexpansion results. Defaults to nil. - -### Changes - -* Display the current connection instead of the current namespace in `cider-mode`'s modeline. -* [#1078](https://github.com/clojure-emacs/cider/issues/1078): Removed - `cider-load-fn-into-repl-buffer`, previously bound to `C-c M-f` in the REPL. -* [#1019](https://github.com/clojure-emacs/cider/pull/1019): - <kbd>C-u C-M-x</kbd> no longer does `eval-defun`+print-result. Instead it debugs the form at point. -* [#854](https://github.com/clojure-emacs/cider/pull/854): Error navigation now - favors line information reported by the stacktrace, being more detailed than - the info reported by `info` middleware. -* [#854](https://github.com/clojure-emacs/cider/pull/854): Add `nrepl-dict` constructor. -* [#934](https://github.com/clojure-emacs/cider/issues/934): Remove - `cider-turn-on-eldoc-mode` in favor of simply using `eldoc-mode`. -* [#953](https://github.com/clojure-emacs/cider/pull/953): Use `sshx` instead of `ssh` in `cider-select-endpoint`. -* [#956](https://github.com/clojure-emacs/cider/pull/956): Eval full ns form only when needed. -* Enable annotated completion candidates by default. -* [#1031](https://github.com/clojure-emacs/cider/pull/1031): Interactive functions prompt with - symbol at point as a default value. -* Remapped `cider-grimoire` to <kbd>C-c C-d r</kbd> & <kbd>C-c C-d C-r</kbd> -to avoid conflicts with <kbd>C-g</kbd>. -* [#1088](https://github.com/clojure-emacs/cider/issues/1088): Kill the -source-tracking evaluation hack as it wasn't compatible with ClojureScript. -* Removed `clojure-enable-cider` and `clojure-disable-cider`. - -### Bugs fixed - -* [#921](https://github.com/clojure-emacs/cider/issues/921): Fixed -non-functioning `cider-test-jump` from test reports. -* [#962](https://github.com/clojure-emacs/cider/pull/962): On error don't auto-jump to tooling files. -* [#909](https://github.com/clojure-emacs/cider/issues/909): Fixed -`cider-repl-set-ns`'s behavior for ClojureScript. -* [#950](https://github.com/clojure-emacs/cider/issues/950): Eval `ns` form in the -`user` namespace when using `cider-interactive-eval`. -* [#954](https://github.com/clojure-emacs/cider/issues/954): Detect properly a project's root -when in buffer that's not visiting a file (e.g. a REPL buffer). -* [#977](https://github.com/clojure-emacs/cider/issues/977): `cider-format-region` now respects indentation of the region start position. -* [#979](https://github.com/clojure-emacs/cider/issues/979): Fixed the inspector buffer popping up needlessly. -* [#981](https://github.com/clojure-emacs/cider/issues/981): Updated `cider-find-file` to use `find-buffer-visiting` instead of `get-file-buffer`. -* [#1004](https://github.com/clojure-emacs/cider/issues/1004): `:repl-env` key is now filtered from exception causes, as it contains unprintably large strings of compiled javascript when using ClojureScript. -* Tunneled ssh connection now deals correctly with the ssh password request. -* [#1033](https://github.com/clojure-emacs/cider/issues/1033): Removed erroneous underlining from stacktrace frames and disabled frame filters in the error buffer. -* The error buffer no longer pops up when there is no error to display. -* `cider-find-resource` now correctly throws an error when no path is provided. -* [#946](https://github.com/clojure-emacs/cider/issues/946): `cider-stacktrace-mode` is now enabled before the error buffer is displayed. -* [#1077](https://github.com/clojure-emacs/cider/issues/1077): Respect `cider-repl-display-in-current-window` in `cider-switch-to-last-clojure-buffer`. - -## 0.8.2 (2014-12-21) - -### Bugs fixed - -* [#867](https://github.com/clojure-emacs/cider/issues/867): Update Grimoire URL to fix (cider-grimoire-lookup) regression due to HTTP 301 (Moved Permanently). -* [#883](https://github.com/clojure-emacs/cider/issues/883): Encode properly the javadoc url. -* [#824](https://github.com/clojure-emacs/cider/issues/824): Fix REPL font-locking. -* [#888](https://github.com/clojure-emacs/cider/issues/888): Handle comments in `cider-repl-mode`. -* [#830](https://github.com/clojure-emacs/cider/issues/830): Stop using `load-file` for most interactive evaluation commands. -* [#885](https://github.com/clojure-emacs/cider/issues/885): Translate nREPL-delivered map keys to symbols before adding as text properties. -* Fix tab completion in `cider-read-from-minibuffer`. -* [#894](https://github.com/clojure-emacs/cider/issues/894): Make it possible to enter any symbol with `cider-read-symbol-name`. -* Report Clojure's version including its qualifier (e.g. `alpha4`) if present. -* Use the `field` text property to make move-beginning-of-line respect the REPL prompt instead of writing our own beginning-of-line commands. - -## 0.8.1 (2014-11-20) - -### Bugs fixed - -* Fixed version mismatch warning on CIDER startup (the actual bug was in `cider-nrepl`). - -## 0.8.0 (2014-11-20) - -### New features - -* `cider-auto-jump-to-error` accepts new option `'errors-only` -* `cider-connect` now asks for remote hosts defined in machine-wide `ssh` - configuration files and automatically detects running instances of lein - server, both on local and remote machines. -* New defcustom `cider-stacktrace-print-level`. Controls the `*print-level*` used when - pretty printing an exception cause's data. Defaults to 50. -* New interactive command `cider-undef`. -* New interactive command `cider-clear-compilation-highlights`. -* First pass at a CIDER quick reference card. -* `completion-at-point` now annotates functions, macros and special forms, thus making it -simpler to gain understanding of what you're using (disabled by default). -* When invoked with a prefix argument `cider-quit` doesn't ask for confirmation. -* Enhance stacktrace to definition navigation to work for interactively defined vars. -* New vars: `cider-to-nrepl-filename-function` and `cider-from-nrepl-filename-function` -are used to translate filenames from/to the nREPL server (default Cygwin implementation provided). -* Java classpath browser (`M-x cider-classpath`). -* Clojure namespace browser (`M-x cider-browse-ns` and `M-x cider-browse-ns-all`). -* Added the ability to jump to a definition from a docview buffer. -* New interactive command `cider-close-nrepl-session`. -* New interactive command `cider-describe-nrepl-session`. -* New interactive command `cider-toggle-trace-ns` (mapped to <kbd>C-c M-t n</kbd>) -* New interactive command `cider-repl-require-repl-utils`. -* [#784](https://github.com/clojure-emacs/cider/issues/784): Make it possible to run tests in -the current ns with `C-u C-c ,`. - -### Changes - -* bencode decoder was rewritten: - - nREPL dicts are now plists and accessor api is given by `nrepl-dict-p`, - `nrepl-dict-get` and `nrepl-dict-put`. - - nested stack is used for decoded messages to avoid re-parsing of incomplete messages - - queues are used for incoming strings from the server and for the decoded responses -* REPL buffers are now connection buffers for REPL client connections. -* Server and client cranking were isolated into `nrepl-start-server-process` and - `nrepl-start-client-process`. - -* nrepl-client.el refactoring: - - - `nrepl-send-request-sync` was renamed into `nrepl-send-sync-request` to comply - - with the names of other 'sync' variables. - - - nREPL requests are now named with `nrepl-request:OP` where "OP" stands for - the type of the request (eval, clone etc.). The following functions - were renamed: - - `nrepl-send-string` -> `nrepl-request:eval` - `nrepl-send-string-sync` -> `nrepl-sync-request:eval` - `nrepl-send-interrupt` -> `nrepl-request:interrupt` - `nrepl-send-stdin` -> `nrepl-request:stdin` - `nrepl-describe-session` -> `nrepl-request:describe` - `nrepl-create-client-session` -> `nrepl-request:clone` - -* Renamed `cider-macroexpansion-suppress-namespaces` to `cider-macroexpansion-display-namespaces`. -* [#652](https://github.com/clojure-emacs/cider/issues/652): Suppress eldoc when -an error message is displayed in the minibuffer. -* [#719](https://github.com/clojure-emacs/cider/issues/719) The customization -variable `cider-test-show-report-on-success` controls now, whether to show the -`*cider-test-report*` buffer on passing tests. The default is to not show the -buffer. -* Renamed `cider-toggle-trace` to `cider-toggle-trace-var` and remapped it to <kbd>C-c M-t v</kbd>. - -### Bugs fixed - -* [#705](https://github.com/clojure-emacs/cider/pull/705): Fixed macroexpansion -bug for `tidy` namespace display. -* Font-lock properly error messages in the REPL resulting from interactive evaluation. -* [#671](https://github.com/clojure-emacs/cider/issues/671): Remove problematic code that was -setting the REPL's initial ns based on lein's `:init-ns` option. -* [#695](https://github.com/clojure-emacs/cider/issues/695): Keep point at -original position when clearing or highlighting test results. -* [#744](https://github.com/clojure-emacs/cider/issues/744): Fix the ability to customize the -lein command invoked by `cider-jack-in`. -* [#752](https://github.com/clojure-emacs/cider/issues/752): Don't assume -`clojure.core/let` is always available as `let`. -* [#772](https://github.com/clojure-emacs/cider/issues/772): Don't try to read Clojure results as -Emacs Lisp code. -* [#631](https://github.com/clojure-emacs/cider/issues/631): Set `file` and `line` metadata when -doing interactive evaluation. -* nREPL sessions are now closed on `cider-quit`. -* Fix minibuffer history for `cider-read-and-eval`. - -## 0.7.0 (2014-08-05) - -### New features - -* New `cider-auto-jump-to-error` control variable for auto jumping to error - location. -* [#537](https://github.com/clojure-emacs/cider/pull/537): New support for -Java symbol lookup from cider-nrepl's info middleware. -* [#570](https://github.com/clojure-emacs/cider/pull/570): Enable toggling -of the 'all' filter on stacktraces. -* [#588](https://github.com/clojure-emacs/cider/pull/588): New `doc-mode` -for presenting fontified documentation, including Javadoc. -* New interactive command `cider-toggle-trace`. -* `cider-select` can now switch to the `*cider-error*` buffer (bound to `x`). -* [#613](https://github.com/clojure-emacs/cider/issues/613): New `clojure.test` -integration. -* [#22](https://github.com/clojure-emacs/cider/issues/22): New command -`cider-jump-to-resource` (bound to <kbd>C-c M-.</kbd>). -* [#664](https://github.com/clojure-emacs/cider/pull/664): New apropos support: -search function/var names (bound to <kbd>C-c C-d a</kbd>) or documentation -(bound to <kbd>C-c C-d A</kbd>). -* You can view Grimoire's entry for a particular Clojure (built-in) symbol in -Emacs with `cider-grimoire` (<kbd>C-c C-d g</kbd>) or your default browser with -`cider-grimoire-web` (<kbd>C-c C-d h</kbd>). -* `cider-mode` now displays the namespace of the current buffer in the mode-line - (as SLIME does). - -### Changes - -* [#597](https://github.com/clojure-emacs/cider/issues/597): Don't process nREPL - messages unless the whole message has been received. -* [#603](https://github.com/clojure-emacs/cider/pull/603): New variable -`cider-show-error-buffer` to control the behavior of the error buffer. Obsoletes -`cider-popup-on-error`, `cider-popup-stacktraces` and -`cider-repl-popup-stacktraces`. -* `cider-nrepl` is now required. Without it pretty much nothing will work. -* Removed redundant command `cider-src`. -* Renamed `nrepl-log-events` variable to `nrepl-log-messages`. -* Renamed `nrepl-log-events` command to `nrepl-log-messages`. -* Remove redundant `cider-src` command. -* [#582](https://github.com/clojure-emacs/cider/pull/582): Enable efficient -loading of jar/zip resources. -* [#589](https://github.com/clojure-emacs/cider/pull/589): Don't prefer local -paths over tramp by default. -* [#554](https://github.com/clojure-emacs/cider/issues/554): `cider-auto-select-error-buffer` is set to `t` by default. -* [#610](https://github.com/clojure-emacs/cider/pull/610): Present error and -stacktrace info for all exception causes. -* Removed `cider-repl-print-length` config option and -`cider-repl-toggle-print-length-limiting` command. -* Remapped `cider-doc` to <kbd>C-c C-d d</kbd>. -* Remapped `cider-javadoc` to <kbd>C-c C-d j</kbd> -* cider's scratch is now more consistent with an Emacs Lisp scratch buffer. - -### Bugs fixed - -* [#577](https://github.com/clojure-emacs/cider/pull/577): Fix bencode decoding -of negative integers. -* [#607](https://github.com/clojure-emacs/cider/pull/607): Respect - `*print-length*` in `cider-pprint-eval-defun-at-point` and - `cider-pprint-eval-last-sexp`. - -## 0.6.0 (2014-04-24) - -### New features - -* New interactive command `cider-change-buffers-designation`. -* Cider command uses `cider-known-endpoints`. -* [#490](https://github.com/clojure-emacs/cider/pull/490): Dedicated - support for `company-mode` in `cider-complete-at-point`. -* [#489](https://github.com/clojure-emacs/cider/issues/489): Enable - cider-jack-in on tramp source buffers. -* [#460](https://github.com/clojure-emacs/cider/issues/460): Support for -cider-nrepl's complete middleware for CLJ/CLJS autocomplete. -* [#465](https://github.com/clojure-emacs/cider/issues/465): Support for -cider-nrepl's info middleware for jump-to-definition. -* [#469](https://github.com/clojure-emacs/cider/issues/469): Add option -`cider-prompt-save-file-on-load`. -* New interactive command `cider-insert-defun-in-repl`. -* New interactive command `cider-insert-ns-form-in-repl`. -* New inspector inspired by SLIME's inspector -* STDERR output is now font-locked with `cider-repl-err-output-face` to make it -visually distinctive from `cider-repl-output-face` (used for STDOUT output). -* New interactive command `cider-scratch`. -* [#521](https://github.com/clojure-emacs/cider/pull/521): New interactive -stacktrace filtering/navigation using cider-nrepl's stacktrace middleware. - -### Changes - -* [#513](https://github.com/clojure-emacs/cider/issues/513): - Remove hardcoded use of IDO mode and use `completing-read`. -* Required Emacs version is now 24.1. -* [#486](https://github.com/clojure-emacs/cider/issues/486): Improve - support for tramp, so tramp paths do not get used in compiled debug - information. `cider-jump` still uses tramp filenames to find - definitions if used in a buffer associated with a tramp file. -* Renamed `cider` command to `cider-connect`. - -### Bugs fixed - -* [#515](https://github.com/clojure-emacs/cider/issues/515): Fix -inconsistent prompt used for load symbol functions. -* [#501](https://github.com/clojure-emacs/cider/issues/501): Fix -nil appearing in nrepl-server buffer name when no project directory. -* [#493](https://github.com/clojure-emacs/cider/issues/493) Fix rotate connection to handle no -nREPL connection. -* [#468](https://github.com/clojure-emacs/cider/issues/468): Fix -pretty-printing of evaluation results so that `*1` is set properly. -* [#439](https://github.com/clojure-emacs/cider/issues/439): Fix -race condition bug in `cider-restart`. -* [#441](https://github.com/clojure-emacs/cider/issues/441): Fix timing bug in `cider-jack-in`. -* [#482](https://github.com/clojure-emacs/cider/issues/482): Fix jump-to-def for cljx dependency jars. - -## 0.5.0 (2014-01-24) - -### New features - -* <kbd>C-c M-f</kbd> Select a function from the current namespace using IDO and insert into the REPL buffer. -* `cider-read-and-eval` now supports completion and keeps history. -* Added ability to limit the number of objects printed in collections - by managing `*print-length*`. `cider-repl-print-length` can be used - to set a limit, and `cider-repl-toggle-print-length-limiting` can be - used to toggle the enforcement of the limit. -* New config `cider-eval-result-prefix` controls the prefix displayed before results -from interactive evaluation displayed in the minibuffer. -* New config `cider-repl-result-prefix` controls the prefix displayed before results in the REPL. -* Font-lock interactive evaluation results as Clojure code. -* Added the ability to font-lock input and results in the REPL as Clojure code. This is controlled via -the option `cider-repl-use-clojure-font-lock`. -* Added `cider-pprint-eval-defun-at-point`, a companion to `cider-pprint-eval-last-sexp` which works on the top-level form. -* The REPL buffer name uses host if no project directory available; `*cider-repl*` will appear as `*cider-repl <host>*`. - -### Bugs fixed - -* [#316](https://github.com/clojure-emacs/cider/issues/316): Honor the `:init-ns` namespace on startup. -* [#436](https://github.com/clojure-emacs/cider/issues/436): Fix an infinite loop when evaluating ns forms. -* [#435](https://github.com/clojure-emacs/cider/issues/435): Fix trampling of `cider-switch-to-repl-buffer` by `cider-switch-to-relevant-repl-buffer`. - -## 0.4.0 (2013-12-03) - -### New features - -* Added new interactive command `cider-read-and-eval` (bound to `C-c M-:` in `cider-mode`). -* Added new interactive command `cider-eval-last-sexp-to-repl` (`C-c M-e`). The command will output the result -of the evaluated code to the REPL buffer, so you can easily play with the output there afterwards. -* Added new interactive command `cider-insert-last-sexp-in-repl` (`C-c M-p`). -* Added new interactive command `cider-eval-last-expression-and-replace` (`C-c C-w`). -* Implemented REPL shortcuts, triggered by pressing `,` at the start of a REPL input line (similar to the ones in SLIME). -* Added new interactive command `cider-ping` to check connectivity with the server. - -### Changes - -* Renamed `cider-history-size` to `cider-repl-history-size`. -* Renamed `cider-history-file` to `cider-repl-history-file`. -* Renamed `cider-wrap-history` to `cider-repl-wrap-history`. -* Renamed `cider-eval-expression-at-point` to `cider-eval-defun-at-point`. -* Changed `last-expression` to `last-sexp` in a number of functions. - -### Bugs fixed - -* [#315](https://github.com/clojure-emacs/cider/issues/393): Removed spurious newlines in output. -* [#237](https://github.com/clojure-emacs/cider/issues/237): Don't swallow output from futures. -* Create non-existing namespaces, when evaluating code in Clojure buffers. - -## 0.3.1 (2013-10-29) - -* Fix REPL init - -## 0.3.0 (2013-10-28) - -### New features - -* The variable `cider-repl-display-in-current-window` controls whether the REPL should be displayed in the current window when switched to. -* `cider-repl-set-ns` can now be invoked in the REPL. -* The content of `.nrepl-port`, if present, will be used as the - default port for <kbd>M-x nrepl</kbd>. This is in addition to `target/repl-port`. -* Applies ANSI color to all output in the REPL buffer. - -### Changes - -* Renamed package to CIDER. -* Split package into several files. -* Renamed `cider-interaction-mode` to `cider-mode`. - -### Bugs fixed - -* [#393](https://github.com/clojure-emacs/cider/issues/393) - Error when evaluating strings with a namespace declaration in them. - -## 0.2.0 (2013-10-10) - -### New features - -* <kbd>C-c M-d</kbd> will display default nREPL connection details. -* <kbd>C-c M-r</kbd> will rotate and display the default nREPL connection. -* Setting the variable `nrepl-buffer-name-show-port` will display the port on which the nREPL server is running. -* The REPL buffer name uses project directory name; `*nrepl*` will appear as `*nrepl project-directory-name*`. -* The nREPL connection buffer name uses project directory name; `*nrepl-connection*` will appear as `*nrepl-connection project-directory-name*`. -* nREPL server buffer name uses project directory name; `*nrepl-server*` will appear as `*nrepl-server project-directory-name*`. -* <kbd>C-c C-Z</kbd> will select the nrepl buffer based on the current namespace. -* <kbd>C-u C-c C-Z</kbd> will select the nrepl buffer based on a user project directory prompt. -* Bind <kbd>C-c C-q</kbd> to `nrepl-quit` -* Added an option to auto-select error popups (`nrepl-auto-select-error-buffer`) -* Made the display of the REPL buffer on connect optional - -### Changes - -* Renamed `nrepl-mode` to `nrepl-repl-mode` - -### Bugs fixed - -* <kbd>C-c M-s</kbd> (`nrepl-selector`) was bound to non-existing symbol. -* Fix indentation in REPL buffers. -* Fix `nrepl-doc` on Clojure 1.5 - -## 0.1.8 (2013-08-08) - -### New features - -* Evaluate all namespace forms `(ns ...)` in the user namespace. -* Add highlighting of compilation warnings in addition to existing highlighting of errors -* Add support for selecting last Clojure source buffer with keybinding -<kbd>C-c C-z</kbd> (the same as `nrepl-switch-to-repl-buffer`). -* The content of `target/repl-port`, if present, will be used as the - default port for <kbd>M-x nrepl</kbd> -* Added an extendable slime-style selector command and binding <kbd>C-c M-s</kbd> - -### Bugs fixed - -* <kbd>M-.</kbd> (`nrepl-jump`) on remote nrepl connection (across OS hosts) has been fixed. - -## 0.1.7 (2013-03-13) - -### New features - -* Add support for multiple nrepl sessions. A single session is closed with - `M-x nrepl-close`. A REPL session is made default with - `M-x nrepl-make-repl-connection-default`. -* Added support for pretty-printing in the REPL buffer. -* Added a check for the presence of an existing `*nrepl*` buffer before -creating a new one with `nrepl-jack-in` or `nrepl`. -* `M-.` learned about namespaces. -* Added new customization variable `nrepl-popup-stacktraces-in-repl`. -* Added some convenience keybindings to `clojure-mode` - -`nrepl-jack-in` is now bound to <kbd>C-c M-j</kbd> and `nrepl` is -bound to <kbd>C-c M-c</kbd>. -* Added `nrepl-hide-special-buffers` setting to control the display of special -buffers like `*nrepl-server*` and `*nrepl-connection*`. -* Apply ANSI color codes to output sent to nrepl buffers. -* Add a connection browser `nrepl-connection-browser` to allow control of - multiple connections. -* Add macroexpand key bindings to `nrepl-mode-map`. -* Don't suppress namespaces in macroexpansion. -* Add explicit require of expected namespaces in the REPL buffer. - -* Add command `nrepl-pprint-eval-last-expression`. -* Add an event buffer for debugging. -* Allow connections without REPL buffers. -* Add hook `nrepl-file-loaded-hook` which runs on load-file - completion. -* Expand ido-completion to include "used" variables in addition to - "interned" variables. - -### Bugs fixed - -* More accurate matching of filenames in stacktraces. -* Fix #290 - Macroexpand buffer truncates long expansions - -## 0.1.6 (2013-01-29) - -### New features - -* Ported SLIME macroexpansion mode (see README for full documentation) -* Updated macroexpansion to use pprint with code-dispatch -* Eldoc argument highlighting -* Simplify popup buffer quit/restore using `quit-window'. -* Add nrepl-disconnected-hook and disable nrepl when disconnected. -* Get key bindings documentation into the minor mode descriptions (Ivan Necas) -* made the TAB command in the nrepl-mode buffers configurable (Bozhidar Batsov) -* Added convenience function to report the version of nREPL in use. (fogus) -* Shift-Home and Shift-Ctrl-a in repl, which select just the user input when on the input line. (Ivan Kozik) - -### Bugs fixed - -* Emit server log output at bottom of `*nrepl-server*` buffer. (Brian Rowe) -* Reset nrepl-buffer-ns on nrepl-restart. Fixes issue #187. -* Implement nrepl-mode as a derived mode. (Bozhidar Batsov) -* fix #194 - stacktrace buffer was not respecting nrepl-popup-stacktraces (Bozhidar Batsov) -* Fix message formatting for results containing "%" (fixes issue #195). -* Fix NPE in nrepl-jump (issue #124). (cola-zero) -* Fix nrepl to work with fish shell (issue #192). (Dario Bertini) -* Adjusted the javadoc keybinding and mentioned it in the README. (Bozhidar Batsov) -* Fix issue #163 - exclude ns from nrepl-load-file. -* Ignore "killed" and "hangup" events in sentinel (Chris Bilson) -* Clear the correct region when replacing the input line. (Ivan Kozik) -* Fix issue #146. Include "@" in nrepl-input-complete-p. -* Handle stdout messages that arrive after status "done" - -## 0.1.5 (2012-10-22) - -### New features - -* Support for describe op to determine which server ops are available at startup -* Support for the following server ops (if available): load-file, complete, and javadoc (available in ritz) -* Added nrepl-host and nrepl-port custom variables M-x nrepl default hostname/port -* Ported over the following REPL buffer functions from slime: - History regexp filtering - M-s nrepl-next-matching-input, M-r nrepl-previous-matching-input - C-c C-u nrepl-kill-input - C-c C-n nrepl-next-prompt/C-c C-p nrepl-previous-prompt -* Added nrepl-quit and nrepl-restart commands -* Added menus for nrepl-mode and nrepl-interaction-mode -* Add nrepl-eval-print-last-expression - -### Bugs fixed - -* Ensure nrepl-eval-sync waits for :done when response is chunked - -## 0.1.4 (2012-09-18) - -### New features - -* Improvements and simplifications for completion (Tassilo Horn) -* Documentation additions and fixes (Ryan Fowler, Nikita Beloglazov, Bozhidar Batsov, Juha Syrjl, Philipp Meier) -* Make completion back-end and error handler configurable (Hugo Duncan) -* Accept host as well as port on connect (Ken Restivo) -* Enable nrepl-interaction-mode in clojurescript-mode (Nelson Morris) -* Emit stdout from interactive evaluations into the REPL buffer - -### Bugs fixed - -* Fix paredit .. don't make clojure-mode-map parent of nrepl-interaction-mode-map (Tassilo Horn) -* Fixes for ECB interop (Matthew Willson) -* Namespace qualify tooling calls (Justin Kramer) -* Eldoc fixes (Jack Moffitt) -* Fix path quoting in load file for Windows (Philipp Meier) -* Fix nREPL / Emacs error "Unable to resolve symbol: if-let" - -## 0.1.3 (2012-08-19) - -### New features - -* eldoc support for displaying arglists in the minibuffer (Stefan Kamphausen) -* persistent REPL history (Stefan Kamphausen) -* fix for jumbled stacktraces (Ryan Fowler) -* add a doc keybinding for the REPL buffer (Ken Restivo) -* plumbing to support ac-nrepl [https://github.com/purcell/ac-nrepl] (Steve Purcell) -* stdin support (which also provides support for debug-repl - [https://github.com/GeorgeJahad/debug-repl] and limit-break [https://github.com/technomancy/limit-break]) - -## 0.1.2 (2012-07-24) - -### New features - -* convert nrepl-interaction-mode into a major mode -* display stacktrace on eval-error -* change lein command to `lein` -* add fn to eval current buffer's ns -* handle filter messages spanning multiple chunks of output -* Let nrepl-jack-in accept project dir when given a prefix arg. -* C-c C-b nrepl-interrupt -* client session management -* added words of inspiration + version at startup -* Add M-n and M-p to nrepl-mode-map. -* Implement M-.: nrepl-jump-to-def. -* Implement basic completion. -* Implement nrepl-doc. -* Prevent M-p at top of history from pushing position one step further. -* M-n after end of history should blank out input. -* Add M-n and M-p to nrepl-mode-map. -* Implement M-.: nrepl-jump-to-def. - -## 0.1.1 (2012-07-11) - -* Initial version diff --git a/elpa/cider-1.12.0/Eldev b/elpa/cider-1.12.0/Eldev @@ -1,59 +0,0 @@ -; -*- mode: emacs-lisp; lexical-binding: t; no-byte-compile: t -*- - -(eldev-require-version "0.6") - -(eldev-use-package-archive 'gnu) -;; For compatibility; e.g. with MELPA Stable one test fails. -(eldev-use-package-archive 'melpa-unstable) - -(eldev-use-plugin 'autoloads) - -(eldev-add-loading-roots 'test "test/utils") -(eldev-add-extra-dependencies 'runtime '(:package logview :optional t)) - -;; slightly increase the maximum (applies to checkdoc and the byte compiler alike) -(setq byte-compile-docstring-max-column 100) - -;; allow commas to indicate that the first sentence continues, which enables longer first sentences -(setq checkdoc-permit-comma-termination-flag t) - -(defvar cider-test-type 'main) -(setf eldev-standard-excludes `(:or ,eldev-standard-excludes - ;; Avoid including files in test "projects". - (eldev-pcase-exhaustive cider-test-type - (`main "./test/*/") - (`integration '("./test/" "!./test/integration")) - (`enrich '("./test/" "!./test/enrich")) - (`all '("./test/*/" "!./test/integration"))) - "test/integration/projects" - ;; This file is _supposed_ to be excluded - ;; from automated testing. - "test/cider-tests--no-auto.el")) - -(eldev-defoption cider-test-selection (type) - "Select tests to run; type can be `main', `integration', `enrich' or `all'" - :options (-T --test-type) - :for-command test - :value TYPE - :default-value cider-test-type - (unless (memq (intern type) '(main integration enrich all)) - (signal 'eldev-wrong-option-usage `("unknown test type `%s'" ,type))) - (setf cider-test-type (intern type))) - -(add-hook 'eldev-test-hook - (lambda () - (eldev-verbose "Using cider tests of type `%s'" cider-test-type))) -(add-hook 'eldev-executing-command-hook - (lambda (command) - (unless (eq command 'test) - ;; So that e.g. byte-compilation works on all tests. - (setf cider-test-type 'all)))) - -;; CIDER cannot be compiled otherwise. -(setf eldev-build-load-before-byte-compiling t) - -(setf eldev-lint-default '(elisp)) -(with-eval-after-load 'elisp-lint - ;; We will byte-compile with Eldev. - (setf elisp-lint-ignored-validators '("package-lint" "fill-column" "byte-compile") - enable-local-variables :safe)) diff --git a/elpa/cider-1.12.0/Makefile b/elpa/cider-1.12.0/Makefile @@ -1,37 +0,0 @@ -.PHONY: clean compile lint test-all test-integration test-unit -.DEFAULT_GOAL := test - -# Per our CircleCI, linting/compiling assumes Emacs 28. -# If you primarily use a different version, you can download Emacs 28 to a separate directory and set up: -# export ELDEV_EMACS="$HOME/emacs28/Emacs.app/Contents/MacOS/Emacs" - -# Remove byte-compilation artifacts, which can alter the result of the test suite: -clean: - cd ~/.emacs.d; find . -type f -name "*.elc" -exec rm {} + - -# You can find a generic `eldev` installation script in https://github.com/emacs-eldev/eldev/blob/master/webinstall/eldev -# (Don't use the one defined for CircleCI in your local machine) - -lint: clean - eldev lint - -# Checks for byte-compilation warnings. -compile: clean - eldev -dtT compile --warnings-as-errors - -test/File.edn: - cd dev; ../clojure.sh clojure -M:gen - -test-all: clean test/File.edn - eldev -dtT -p test --test-type all - -test-enrich: clean test/File.edn - eldev -dtT -p test --test-type enrich - -test-integration: clean - eldev -dtT -p test --test-type integration - -test-unit: clean - eldev -dtT -p test - -test: lint test-unit compile diff --git a/elpa/cider-1.12.0/README.md b/elpa/cider-1.12.0/README.md @@ -1,273 +0,0 @@ -<p align="center"> - <img src="https://raw.github.com/clojure-emacs/cider/master/logo/cider-logo-w640.png" alt="CIDER Logo"/> -</p> - ------------ -[![License GPL 3][badge-license]](http://www.gnu.org/licenses/gpl-3.0.txt) -[![CircleCI](https://circleci.com/gh/clojure-emacs/cider.svg?style=svg)](https://circleci.com/gh/clojure-emacs/cider) -[![Spell-check Status](https://github.com/clojure-emacs/cider/actions/workflows/spell_checking.yml/badge.svg)](https://github.com/clojure-emacs/cider/actions/workflows/spell_checking.yml) -[![Discord](https://img.shields.io/badge/chat-on%20discord-7289da.svg?sanitize=true)](https://discord.com/invite/nFPpynQPME) -[![Slack](https://img.shields.io/badge/chat-%23cider-green.svg?style=flat)](http://clojurians.net) - -CIDER is the **C**lojure(Script) **I**nteractive **D**evelopment **E**nvironment -that **R**ocks! - -CIDER extends Emacs with support for [interactive -programming](https://docs.cider.mx/cider/usage/interactive_programming.html) -in Clojure. The features are centered around `cider-mode`, an Emacs -minor-mode that complements [clojure-mode][]. While `clojure-mode` -supports editing Clojure source files, `cider-mode` adds support for -interacting with a running Clojure process for compilation, code -completion, debugging, definition and documentation lookup, running -tests and so on. - ----------- -[![OpenCollective](https://opencollective.com/cider/backers/badge.svg)](#open-collective-backers) -[![OpenCollective](https://opencollective.com/cider/sponsors/badge.svg)](#open-collective-sponsors) -[![Patreon](https://img.shields.io/badge/patreon-donate-orange.svg)](https://www.patreon.com/bbatsov) -[![Paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=GRQKNBM6P8VRQ) - -Bozhidar (a.k.a. Bug, CIDER's primary author/maintainer) has spent countless hours working on -CIDER and the [numerous related projects](https://metaredux.com/posts/2018/11/09/ciders-orchard-the-heart.html). That's a lot of work and not all of it is fun! - -**Please consider [supporting financially CIDER's ongoing development](#funding).** - -## Quickstart - -The instructions that follow are meant to get you from zero to a running CIDER -REPL in under 5 minutes. See the -[online documentation](https://docs.cider.mx) for (way) more -details. - -### Installation - -[![MELPA](http://melpa.org/packages/cider-badge.svg)](http://melpa.org/#/cider) -[![MELPA Stable](http://stable.melpa.org/packages/cider-badge.svg)](http://stable.melpa.org/#/cider) -[![NonGNU ELPA](https://elpa.nongnu.org/nongnu/cider.svg)](https://elpa.nongnu.org/nongnu/cider.html) - -The recommended way to install CIDER is via `package.el` - the built-in package -manager in Emacs. - -CIDER is available on all major `package.el` community -maintained repos - [NonGNU ELPA](https://elpa.nongnu.org), -[MELPA Stable](http://stable.melpa.org) -and [MELPA](http://melpa.org). - -Provided you've enabled one of them in your Emacs setup, you can -install CIDER with the following command: - -<kbd>M-x</kbd> `package-install` <kbd>RET</kbd> `cider` <kbd>RET</kbd> - -### Launch an nREPL server and client from Emacs - -Simply open in Emacs a file belonging to your `lein`, `tools.deps` or `boot` project (like -`foo.clj`) and type <kbd>M-x</kbd> `cider-jack-in`. This will start an nREPL -server with all the project dependencies loaded in and CIDER will automatically -connect to it. - -Alternatively you can use <kbd>C-u M-x</kbd> `cider-jack-in` to specify the path to -a Clojure project, without having to visit any file in it. - -**Tip:** In Clojure(Script) buffers the command `cider-jack-in` is bound to -<kbd>C-c C-x (C-)j</kbd>. - -### Connect to a running nREPL server - -You can go to your project's directory in a terminal and type there -(assuming you're using Leiningen that is): - -``` -$ lein repl -``` - -Or with Boot: - -``` -$ boot repl -s wait -``` - -Alternatively you can start nREPL either manually or by the facilities provided -by your project's build tool (`tools.deps`, Gradle, Maven, etc). - -After you get your nREPL server running go back to Emacs. Typing there <kbd>M-x</kbd> -`cider-connect` will allow you to connect to the running nREPL server. - -**Tip:** In Clojure(Script) buffers the command `cider-connect` is bound to -<kbd>C-c C-x (C-)c (C-)j</kbd> and the command `cider-connect-cljs` is bound to -<kbd>C-c C-x (C-)c (C-)s</kbd>. - -## Diving Deeper - -CIDER packs a ton of functionality and you really want to be familiar with it, -so you can fully empower your workflow. The best way to get acquainted with all -available features is to go over the entire -[CIDER manual](https://docs.cider.mx/). - -If you're into video lessons, you might also check out -this [intro to CIDER demo](https://www.youtube.com/watch?v=aYA4AAjLfT0) as well. - -## Quick Reference Card - -You'll find all of CIDER's essential commands and their keybindings in its -one-page printable [quick reference card](https://github.com/clojure-emacs/cider/blob/master/refcard/cider-refcard.pdf). - -New CIDER users might benefit from keeping a copy close to their keyboard. - -## Get Help - -Start with CIDER's [discussions board](https://github.com/clojure-emacs/cider/discussions). If it doesn't get the job done consider some of the other available -[support channels](https://docs.cider.mx/cider/about/support.html). - -## Changelog - -An extensive changelog is available [here](CHANGELOG.md). - -## Team - -### The Core Team - -The direction of the project is being stewarded by the CIDER core team. This -group of long-term contributors manage releases, evaluate pull-requests, and -does a lot of the groundwork on major new features. - -* [Bozhidar Batsov](https://github.com/bbatsov) (author & head maintainer) -* [Vitalie Spinu](https://github.com/vspinu) -* [Michael Griffiths](https://github.com/cichli) -* [Lars Andersen](https://github.com/expez) - -### CIDER Alumni - -In addition, we'd like to extend a special thanks the following retired CIDER -core team members. Lovingly known as The Alumni: - -* [Tim King](https://github.com/kingtim) (original author) -* [Phil Hagelberg](https://github.com/technomancy) -* [Hugo Duncan](https://github.com/hugoduncan) -* [Steve Purcell](https://github.com/purcell) -* [Artur Malabarba](https://github.com/malabarba) -* [Jeff Valk](https://github.com/jeffvalk) - -## Release policy - -We’re following [SemVer](http://semver.org/). - -You can read more on the subject [here](https://docs.cider.mx/cider/about/release_policy.html). - -## Logo - -CIDER's logo was created by [@tapeinosyne](https://github.com/tapeinosyne). You can find -the logo in various formats -[here](https://github.com/clojure-emacs/cider/tree/master/logo). - -The logo is licensed under a -[Creative Commons Attribution-NonCommercial 4.0 International License](http://creativecommons.org/licenses/by-nc/4.0/deed.en_GB). - -## Homepage - -CIDER's homepage <https://cider.mx> is in the `gh-pages` branch of this repository and is deployed -automatically when changes are made to it. - -It's just a single `index.html` file and a bit of Bootstrap 4. Contributions to it are very welcome! - -## Funding - -While CIDER is free software and will always be, the project would benefit immensely from some funding. -Raising a monthly budget of a couple of thousand dollars would make it possible to pay people to work on -certain complex features, fund other development related stuff (e.g. hardware, conference trips) and so on. -Raising a monthly budget of over $5000 would open the possibility of someone working full-time on the project -which would speed up the pace of development significantly. - -We welcome both individual and corporate sponsors! We also offer a wide array of funding channels to account -for your preferences (although currently [Open Collective](https://opencollective.com/cider) is our preferred funding platform). - -If you're working in a company that's making significant use of CIDER we'd appreciate it if you suggest to your company -to become a CIDER sponsor. - -You can support the development of CIDER, [clojure-mode][] and [inf-clojure][] via -[Open Collective](https://opencollective.com/cider), -[GitHub Sponsors](https://github.com/sponsors/bbatsov), -[Patreon](https://www.patreon.com/bbatsov) and -[PayPal](https://www.paypal.me/bbatsov). - -### Open Collective Backers - -<a href="https://opencollective.com/cider/backer/0/website" target="_blank"><img src="https://opencollective.com/cider/backer/0/avatar.svg"></a> -<a href="https://opencollective.com/cider/backer/1/website" target="_blank"><img src="https://opencollective.com/cider/backer/1/avatar.svg"></a> -<a href="https://opencollective.com/cider/backer/2/website" target="_blank"><img src="https://opencollective.com/cider/backer/2/avatar.svg"></a> -<a href="https://opencollective.com/cider/backer/3/website" target="_blank"><img src="https://opencollective.com/cider/backer/3/avatar.svg"></a> -<a href="https://opencollective.com/cider/backer/4/website" target="_blank"><img src="https://opencollective.com/cider/backer/4/avatar.svg"></a> -<a href="https://opencollective.com/cider/backer/5/website" target="_blank"><img src="https://opencollective.com/cider/backer/5/avatar.svg"></a> -<a href="https://opencollective.com/cider/backer/6/website" target="_blank"><img src="https://opencollective.com/cider/backer/6/avatar.svg"></a> -<a href="https://opencollective.com/cider/backer/7/website" target="_blank"><img src="https://opencollective.com/cider/backer/7/avatar.svg"></a> -<a href="https://opencollective.com/cider/backer/8/website" target="_blank"><img src="https://opencollective.com/cider/backer/8/avatar.svg"></a> -<a href="https://opencollective.com/cider/backer/9/website" target="_blank"><img src="https://opencollective.com/cider/backer/9/avatar.svg"></a> -<a href="https://opencollective.com/cider/backer/10/website" target="_blank"><img src="https://opencollective.com/cider/backer/10/avatar.svg"></a> -<a href="https://opencollective.com/cider/backer/11/website" target="_blank"><img src="https://opencollective.com/cider/backer/11/avatar.svg"></a> -<a href="https://opencollective.com/cider/backer/12/website" target="_blank"><img src="https://opencollective.com/cider/backer/12/avatar.svg"></a> -<a href="https://opencollective.com/cider/backer/13/website" target="_blank"><img src="https://opencollective.com/cider/backer/13/avatar.svg"></a> -<a href="https://opencollective.com/cider/backer/14/website" target="_blank"><img src="https://opencollective.com/cider/backer/14/avatar.svg"></a> -<a href="https://opencollective.com/cider/backer/15/website" target="_blank"><img src="https://opencollective.com/cider/backer/15/avatar.svg"></a> -<a href="https://opencollective.com/cider/backer/16/website" target="_blank"><img src="https://opencollective.com/cider/backer/16/avatar.svg"></a> -<a href="https://opencollective.com/cider/backer/17/website" target="_blank"><img src="https://opencollective.com/cider/backer/17/avatar.svg"></a> -<a href="https://opencollective.com/cider/backer/18/website" target="_blank"><img src="https://opencollective.com/cider/backer/18/avatar.svg"></a> -<a href="https://opencollective.com/cider/backer/19/website" target="_blank"><img src="https://opencollective.com/cider/backer/19/avatar.svg"></a> -<a href="https://opencollective.com/cider/backer/20/website" target="_blank"><img src="https://opencollective.com/cider/backer/20/avatar.svg"></a> -<a href="https://opencollective.com/cider/backer/21/website" target="_blank"><img src="https://opencollective.com/cider/backer/21/avatar.svg"></a> -<a href="https://opencollective.com/cider/backer/22/website" target="_blank"><img src="https://opencollective.com/cider/backer/22/avatar.svg"></a> -<a href="https://opencollective.com/cider/backer/23/website" target="_blank"><img src="https://opencollective.com/cider/backer/23/avatar.svg"></a> -<a href="https://opencollective.com/cider/backer/24/website" target="_blank"><img src="https://opencollective.com/cider/backer/24/avatar.svg"></a> -<a href="https://opencollective.com/cider/backer/25/website" target="_blank"><img src="https://opencollective.com/cider/backer/25/avatar.svg"></a> -<a href="https://opencollective.com/cider/backer/26/website" target="_blank"><img src="https://opencollective.com/cider/backer/26/avatar.svg"></a> -<a href="https://opencollective.com/cider/backer/27/website" target="_blank"><img src="https://opencollective.com/cider/backer/27/avatar.svg"></a> -<a href="https://opencollective.com/cider/backer/28/website" target="_blank"><img src="https://opencollective.com/cider/backer/28/avatar.svg"></a> -<a href="https://opencollective.com/cider/backer/29/website" target="_blank"><img src="https://opencollective.com/cider/backer/29/avatar.svg"></a> - -### Open Collective Sponsors - -Become a sponsor and get your logo on our README on Github with a link to your -site. [[Become a sponsor](https://opencollective.com/cider#sponsor)] - -<a href="https://opencollective.com/cider/sponsor/0/website" target="_blank"><img src="https://opencollective.com/cider/sponsor/0/avatar.svg"></a> -<a href="https://opencollective.com/cider/sponsor/1/website" target="_blank"><img src="https://opencollective.com/cider/sponsor/1/avatar.svg"></a> -<a href="https://opencollective.com/cider/sponsor/2/website" target="_blank"><img src="https://opencollective.com/cider/sponsor/2/avatar.svg"></a> -<a href="https://opencollective.com/cider/sponsor/3/website" target="_blank"><img src="https://opencollective.com/cider/sponsor/3/avatar.svg"></a> -<a href="https://opencollective.com/cider/sponsor/4/website" target="_blank"><img src="https://opencollective.com/cider/sponsor/4/avatar.svg"></a> -<a href="https://opencollective.com/cider/sponsor/5/website" target="_blank"><img src="https://opencollective.com/cider/sponsor/5/avatar.svg"></a> -<a href="https://opencollective.com/cider/sponsor/6/website" target="_blank"><img src="https://opencollective.com/cider/sponsor/6/avatar.svg"></a> -<a href="https://opencollective.com/cider/sponsor/7/website" target="_blank"><img src="https://opencollective.com/cider/sponsor/7/avatar.svg"></a> -<a href="https://opencollective.com/cider/sponsor/8/website" target="_blank"><img src="https://opencollective.com/cider/sponsor/8/avatar.svg"></a> -<a href="https://opencollective.com/cider/sponsor/9/website" target="_blank"><img src="https://opencollective.com/cider/sponsor/9/avatar.svg"></a> -<a href="https://opencollective.com/cider/sponsor/10/website" target="_blank"><img src="https://opencollective.com/cider/sponsor/10/avatar.svg"></a> -<a href="https://opencollective.com/cider/sponsor/11/website" target="_blank"><img src="https://opencollective.com/cider/sponsor/11/avatar.svg"></a> -<a href="https://opencollective.com/cider/sponsor/12/website" target="_blank"><img src="https://opencollective.com/cider/sponsor/12/avatar.svg"></a> -<a href="https://opencollective.com/cider/sponsor/13/website" target="_blank"><img src="https://opencollective.com/cider/sponsor/13/avatar.svg"></a> -<a href="https://opencollective.com/cider/sponsor/14/website" target="_blank"><img src="https://opencollective.com/cider/sponsor/14/avatar.svg"></a> -<a href="https://opencollective.com/cider/sponsor/15/website" target="_blank"><img src="https://opencollective.com/cider/sponsor/15/avatar.svg"></a> -<a href="https://opencollective.com/cider/sponsor/16/website" target="_blank"><img src="https://opencollective.com/cider/sponsor/16/avatar.svg"></a> -<a href="https://opencollective.com/cider/sponsor/17/website" target="_blank"><img src="https://opencollective.com/cider/sponsor/17/avatar.svg"></a> -<a href="https://opencollective.com/cider/sponsor/18/website" target="_blank"><img src="https://opencollective.com/cider/sponsor/18/avatar.svg"></a> -<a href="https://opencollective.com/cider/sponsor/19/website" target="_blank"><img src="https://opencollective.com/cider/sponsor/19/avatar.svg"></a> -<a href="https://opencollective.com/cider/sponsor/20/website" target="_blank"><img src="https://opencollective.com/cider/sponsor/20/avatar.svg"></a> -<a href="https://opencollective.com/cider/sponsor/21/website" target="_blank"><img src="https://opencollective.com/cider/sponsor/21/avatar.svg"></a> -<a href="https://opencollective.com/cider/sponsor/22/website" target="_blank"><img src="https://opencollective.com/cider/sponsor/22/avatar.svg"></a> -<a href="https://opencollective.com/cider/sponsor/23/website" target="_blank"><img src="https://opencollective.com/cider/sponsor/23/avatar.svg"></a> -<a href="https://opencollective.com/cider/sponsor/24/website" target="_blank"><img src="https://opencollective.com/cider/sponsor/24/avatar.svg"></a> -<a href="https://opencollective.com/cider/sponsor/25/website" target="_blank"><img src="https://opencollective.com/cider/sponsor/25/avatar.svg"></a> -<a href="https://opencollective.com/cider/sponsor/26/website" target="_blank"><img src="https://opencollective.com/cider/sponsor/26/avatar.svg"></a> -<a href="https://opencollective.com/cider/sponsor/27/website" target="_blank"><img src="https://opencollective.com/cider/sponsor/27/avatar.svg"></a> -<a href="https://opencollective.com/cider/sponsor/28/website" target="_blank"><img src="https://opencollective.com/cider/sponsor/28/avatar.svg"></a> -<a href="https://opencollective.com/cider/sponsor/29/website" target="_blank"><img src="https://opencollective.com/cider/sponsor/29/avatar.svg"></a> - -## License - -CIDER is distributed under the GNU General Public License, version 3. - -Copyright © 2012-2023 Bozhidar Batsov, Artur Malabarba, Tim King, Phil Hagelberg and -[contributors](https://github.com/clojure-emacs/cider/contributors). - -[badge-license]: https://img.shields.io/badge/license-GPL_3-green.svg -[nREPL]:https://github.com/nrepl/nrepl -[Sly]: https://github.com/joaotavora/sly -[Geiser]: https://github.com/jaor/geiser -[clojure-mode]: https://github.com/clojure-emacs/clojure-mode -[inf-clojure]: https://github.com/clojure-emacs/inf-clojure diff --git a/elpa/cider-1.12.0/ROADMAP.md b/elpa/cider-1.12.0/ROADMAP.md @@ -1,112 +0,0 @@ -# CIDER Roadmap (as of July, 2020) - -That's a very high-level roadmap for CIDER. It focuses on the most -important challenges we need to tackle. - -It's meant to give users a general idea about the direction we -envision for the project's future, and collaborators a good list of -high-impact tasks to tackle. - -## Misc Features - -* ~~find-references (https://github.com/clojure-emacs/cider/issues/1840)~~ (**DONE/0.22**) -* highlight symbol occurrences (https://github.com/clojure-emacs/cider/issues/1461) -* macrostep style of macro expansion (https://github.com/clojure-emacs/cider/issues/1850) - -## Internal improvements - -* ~~Replace usages of Elisp's `read` with `parseedn`.~~ -* ~~Break down `cider-interaction.el` and remove this file completely.~~ (**DONE/0.18**) -* ~~Improve the connection management (https://github.com/clojure-emacs/cider/pull/2069)~~ (**DONE/0.18**) -* Improve nREPL callback handling (https://github.com/clojure-emacs/cider/issues/1099) -* ~~Better handling for huge output/results (we can warn users about it, - truncate it in the REPL and store the whole result internally, etc).~~ - -## Better ClojureScript support - -### Make it easier to start ClojureScript REPLs - -* Implement some deps injection for ClojureScript REPLs -* ~~Providing meaningful errors when starting ClojureScript REPLs.~~ (**DONE/0.17**) -* ~~Make it possible to have a project with only a ClojureScript REPL.~~(**DONE/0.18**) -* ~~Merge cljs-tooling into orchard and evolve it a bit (under - consideration, might be better to keep it a separate library).~~ (**Done/Orchard 0.5**) -* Add ability to restart a ClojureScript REPL (https://github.com/clojure-emacs/cider/issues/1874) - -### Add ClojureScript support for more commands - -* clojure.test -* tracing - -### Always show meaningful errors if a command is not supported under ClojureScript - -Right now it's very confusing if you try to run a Clojure-only command with a ClojureScript REPL. -You'd get some really weird error instead of something nice like "command X is not supported for ClojureScript". - -### Add debugging support for ClojureScript - -There's a bit of info on the subject [here](https://github.com/clojure-emacs/cider/issues/1416). - -## Implement new nREPL features - -* sideloading (there's some experimental support for this) -* dynamic middleware loading -* ~~completion~~ -* ~~lookup~~ - -## Make CIDER somewhat Clojure-agnostic - -There are many languages that provide their nREPL implementations and it'd be nice if -they worked with CIDER as far as the core nREPL protocol goes. - -Here's [an example](https://github.com/clojure-emacs/cider/issues/2848) of how little work is needed to have CIDER work with -Fennel. - -## Gradual merger with refactor-nrepl - -It would make sense to move some important refactor-nrepl -functionality into CIDER, provided it doesn't depend on anything -complex (e.g. building an AST for the entire project). - -Below follow a few such candidates. - -This merger also relies on collaboration from the refactor-nrepl team. - -### Move hotload deps to CIDER - -The deps hotloading has been broken in clj-refactor.el for a while now. -It'd be nice if we reimplement it in CIDER. - -### Move the ns-cleanup functionality to CIDER - -Pretty useful functionality, although potentially this can be achieved by shelling out some external tool as well. - -## Socket REPL support (and potentially unrepl/prepl support as well) - -Eventually we want to support socket REPLs of any kind (plain, unrepl, -prepl) in the same manner we support nREPL today (meaning everything -should work with them). The bulk of the work to achieve this is -related to making the CIDER client and server code nREPL agnostic, -so. Work for this is already underway with respect to the server code -(that's the `orchard` project), but hasn't started on the client -(Emacs) side. - -**Update 07/2020** Now that nREPL is once again actively maintained the priority -of this has dropped significantly for us. - -### Decouple the CIDER code from nREPL - -* Isolate the connection-specific code in a couple of client libraries and build a -generic API on top of them dispatching based on the connection type. - -### Implement a socket REPL client - -That should be relatively straightforward, as the communication -protocol for the socket REPL is pretty simple. `parseedn` should be -used to "encode/decode" EDN data. - -### Transition everything non-nREPL specific to Orchard - -As of July, 2020 that's mostly done. We still need to decide if we want to extra pieces -of code like the test runner and the debugger, which are unlikely to be used outside -of nREPL. diff --git a/elpa/cider-1.12.0/Vagrantfile b/elpa/cider-1.12.0/Vagrantfile @@ -1,8 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -Vagrant::Config.run do |config| - config.vm.box = "ubuntu/trusty64" - - config.vm.provision :shell, :path => "vagrant/provision.sh" -end diff --git a/elpa/cider-1.12.0/cider-apropos.el b/elpa/cider-1.12.0/cider-apropos.el @@ -1,210 +0,0 @@ -;;; cider-apropos.el --- Apropos functionality for Clojure -*- lexical-binding: t -*- - -;; Copyright © 2014-2023 Jeff Valk, Bozhidar Batsov and CIDER contributors -;; -;; Author: Jeff Valk <jv@jeffvalk.com> - -;; This program is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see <http://www.gnu.org/licenses/>. - -;; This file is not part of GNU Emacs. - -;;; Commentary: - -;; Apropos functionality for Clojure. - -;;; Code: - -(require 'cider-doc) ; for cider-doc-lookup -(require 'cider-find) ; for cider--find-var -(require 'cider-util) -(require 'subr-x) -(require 'cider-connection) ; for cider-ensure-connected - -(require 'cider-client) -(require 'cider-popup) -(require 'nrepl-dict) - -(require 'apropos) -(require 'button) - -(defconst cider-apropos-buffer "*cider-apropos*") - -(defcustom cider-apropos-actions '(("display-doc" . cider-doc-lookup) - ("find-def" . cider--find-var) - ("lookup-on-clojuredocs" . cider-clojuredocs-lookup)) - "Controls the actions to be applied on the symbol found by an apropos search. -The first action key in the list will be selected as default. If the list -contains only one action key, the associated action function will be -applied automatically. An action function can be any function that receives -the symbol found by the apropos search as argument." - :type '(alist :key-type string :value-type function) - :group 'cider - :package-version '(cider . "0.13.0")) - -(define-button-type 'apropos-special-form - 'apropos-label "Special form" - 'apropos-short-label "s" - 'face 'font-lock-keyword-face - 'help-echo "mouse-2, RET: Display more help on this special form" - 'follow-link t - 'action (lambda (button) - (describe-function (button-get button 'apropos-symbol)))) - -(defun cider-apropos-doc (button) - "Display documentation for the symbol represented at BUTTON." - (cider-doc-lookup (button-get button 'apropos-symbol))) - -(defun cider-apropos-summary (query ns docs-p include-private-p case-sensitive-p) - "Return a short description for the performed apropos search. - -QUERY can be a regular expression list of space-separated words -\(e.g take while) which will be converted to a regular expression -\(like take.+while) automatically behind the scenes. The search may be -limited to the namespace NS, and may optionally search doc strings -\(based on DOCS-P), include private vars (based on INCLUDE-PRIVATE-P), -and be case-sensitive (based on CASE-SENSITIVE-P)." - (concat (if case-sensitive-p "Case-sensitive " "") - (if docs-p "Documentation " "") - (format "Apropos for %S" query) - (if ns (format " in namespace %S" ns) "") - (if include-private-p - " (public and private symbols)" - " (public symbols only)"))) - -(defun cider-apropos-highlight (doc query) - "Return the DOC string propertized to highlight QUERY matches." - (let ((pos 0)) - (while (string-match query doc pos) - (setq pos (match-end 0)) - (put-text-property (match-beginning 0) - (match-end 0) - 'font-lock-face apropos-match-face doc))) - doc) - -(defvar cider-use-tooltips) -(defun cider-apropos-result (result query docs-p) - "Emit a RESULT matching QUERY into current buffer, formatted for DOCS-P." - (nrepl-dbind-response result (name type doc) - (let* ((label (capitalize (if (string= type "variable") "var" type))) - (help (concat "Display doc for this " (downcase label))) - (props (list 'apropos-symbol name - 'action #'cider-apropos-doc)) - (props (if cider-use-tooltips - (append props (list 'help-echo help)) - props))) - (cider-propertize-region props - (insert-text-button name 'type 'apropos-symbol) - (insert "\n ") - (insert-text-button label 'type (intern (concat "apropos-" type))) - (insert ": ") - (let ((beg (point))) - (if docs-p - (insert (cider-apropos-highlight doc query) "\n") - (insert doc) - (fill-region beg (point)))) - (insert "\n"))))) - -(defun cider-show-apropos (summary results query docs-p) - "Show SUMMARY and RESULTS for QUERY in a pop-up buffer, formatted for DOCS-P." - (with-current-buffer (cider-popup-buffer cider-apropos-buffer 'select 'apropos-mode 'ancillary) - (let ((inhibit-read-only t)) - (if (boundp 'header-line-format) - (setq-local header-line-format summary) - (insert summary "\n\n")) - (dolist (result results) - (cider-apropos-result result query docs-p)) - (goto-char (point-min))))) - -;;;###autoload -(defun cider-apropos (query &optional ns docs-p privates-p case-sensitive-p) - "Show all symbols whose names match QUERY, a regular expression. -QUERY can also be a list of space-separated words (e.g. take while) which -will be converted to a regular expression (like take.+while) automatically -behind the scenes. The search may be limited to the namespace NS, and may -optionally search doc strings (based on DOCS-P), include private vars -\(based on PRIVATES-P), and be case-sensitive (based on CASE-SENSITIVE-P)." - (interactive - (cons (read-string "Search for Clojure symbol (a regular expression): ") - (when current-prefix-arg - (list (let ((ns (completing-read "Namespace (default is all): " (cider-sync-request:ns-list)))) - (if (string= ns "") nil ns)) - (y-or-n-p "Search doc strings? ") - (y-or-n-p "Include private symbols? ") - (y-or-n-p "Case-sensitive? "))))) - (cider-ensure-connected) - (cider-ensure-op-supported "apropos") - (if-let* ((summary (cider-apropos-summary - query ns docs-p privates-p case-sensitive-p)) - (results (cider-sync-request:apropos query ns docs-p privates-p case-sensitive-p))) - (cider-show-apropos summary results query docs-p) - (message "No apropos matches for %S" query))) - -;;;###autoload -(defun cider-apropos-documentation () - "Shortcut for (cider-apropos <query> nil t)." - (interactive) - (cider-ensure-connected) - (cider-ensure-op-supported "apropos") - (cider-apropos (read-string "Search for Clojure documentation (a regular expression): ") nil t)) - -(defun cider-apropos-act-on-symbol (symbol) - "Apply selected action on SYMBOL." - (let* ((first-action-key (car (car cider-apropos-actions))) - (action-key (if (= 1 (length cider-apropos-actions)) - first-action-key - (completing-read (format "Choose action to apply to `%s` (default %s): " - symbol first-action-key) - cider-apropos-actions nil nil nil nil first-action-key))) - (action-fn (cdr (assoc action-key cider-apropos-actions)))) - (if action-fn - (funcall action-fn symbol) - (user-error "Unknown action `%s`" action-key)))) - -;;;###autoload -(defun cider-apropos-select (query &optional ns docs-p privates-p case-sensitive-p) - "Similar to `cider-apropos', but presents the results in a completing read. -Show all symbols whose names match QUERY, a regular expression. -QUERY can also be a list of space-separated words (e.g. take while) which -will be converted to a regular expression (like take.+while) automatically -behind the scenes. The search may be limited to the namespace NS, and may -optionally search doc strings (based on DOCS-P), include private vars -\(based on PRIVATES-P), and be case-sensitive (based on CASE-SENSITIVE-P)." - (interactive - (cons (read-string "Search for Clojure symbol (a regular expression): ") - (when current-prefix-arg - (list (let ((ns (completing-read "Namespace (default is all): " (cider-sync-request:ns-list)))) - (if (string= ns "") nil ns)) - (y-or-n-p "Search doc strings? ") - (y-or-n-p "Include private symbols? ") - (y-or-n-p "Case-sensitive? "))))) - (cider-ensure-connected) - (cider-ensure-op-supported "apropos") - (if-let* ((summary (cider-apropos-summary - query ns docs-p privates-p case-sensitive-p)) - (results (mapcar (lambda (r) (nrepl-dict-get r "name")) - (cider-sync-request:apropos query ns docs-p privates-p case-sensitive-p)))) - (cider-apropos-act-on-symbol (completing-read (concat summary ": ") results)) - (message "No apropos matches for %S" query))) - -;;;###autoload -(defun cider-apropos-documentation-select () - "Shortcut for (cider-apropos-select <query> nil t)." - (interactive) - (cider-ensure-connected) - (cider-ensure-op-supported "apropos") - (cider-apropos-select (read-string "Search for Clojure documentation (a regular expression): ") nil t)) - -(provide 'cider-apropos) - -;;; cider-apropos.el ends here diff --git a/elpa/cider-1.12.0/cider-autoloads.el b/elpa/cider-1.12.0/cider-autoloads.el @@ -1,688 +0,0 @@ -;;; cider-autoloads.el --- automatically extracted autoloads (do not edit) -*- lexical-binding: t -*- -;; Generated by the `loaddefs-generate' function. - -;; This file is part of GNU Emacs. - -;;; Code: - -(add-to-list 'load-path (or (and load-file-name (directory-file-name (file-name-directory load-file-name))) (car load-path))) - - - -;;; Generated autoloads from cider.el - -(autoload 'cider-version "cider" "\ -Display CIDER's version." t) - (autoload 'cider-start-map "cider" "CIDER jack-in and connect keymap." t 'keymap) -(autoload 'cider-jack-in-clj "cider" "\ -Start an nREPL server for the current project and connect to it. -PARAMS is a plist optionally containing :project-dir and :jack-in-cmd. -With the prefix argument, allow editing of the jack in command; with a -double prefix prompt for all these parameters. - -(fn PARAMS)" t) -(autoload 'cider-jack-in-cljs "cider" "\ -Start an nREPL server for the current project and connect to it. -PARAMS is a plist optionally containing :project-dir, :jack-in-cmd and -:cljs-repl-type (e.g. 'shadow, 'node, 'figwheel, etc). - -With the prefix argument, -allow editing of the jack in command; with a double prefix prompt for all -these parameters. - -(fn PARAMS)" t) -(autoload 'cider-jack-in-clj&cljs "cider" "\ -Start an nREPL server and connect with clj and cljs REPLs. -PARAMS is a plist optionally containing :project-dir, :jack-in-cmd and -:cljs-repl-type (e.g. 'shadow, 'node, 'fighweel, etc). - -With the prefix argument, allow for editing of the jack in command; -with a double prefix prompt for all these parameters. - -When SOFT-CLJS-START is non-nil, start cljs REPL -only when the ClojureScript dependencies are met. - -(fn &optional PARAMS SOFT-CLJS-START)" t) -(autoload 'cider-connect-sibling-clj "cider" "\ -Create a Clojure REPL with the same server as OTHER-REPL. -PARAMS is for consistency with other connection commands and is currently -ignored. OTHER-REPL defaults to `cider-current-repl' and in programs can -also be a server buffer, in which case a new session with a REPL for that -server is created. - -(fn PARAMS &optional OTHER-REPL)" t) -(autoload 'cider-connect-sibling-cljs "cider" "\ -Create a ClojureScript REPL with the same server as OTHER-REPL. -PARAMS is a plist optionally containing :cljs-repl-type (e.g. 'node, -'figwheel, 'shadow, etc). - -All other parameters are inferred from the OTHER-REPL. -OTHER-REPL defaults to `cider-current-repl' but in programs can also be a -server buffer, in which case a new session for that server is created. - -(fn PARAMS &optional OTHER-REPL)" t) -(autoload 'cider-connect-clj "cider" "\ -Initialize a Clojure connection to an nREPL server. -PARAMS is a plist optionally containing :host, :port and :project-dir. On -prefix argument, prompt for all the parameters. - -(fn &optional PARAMS)" t) -(autoload 'cider-connect-cljs "cider" "\ -Initialize a ClojureScript connection to an nREPL server. -PARAMS is a plist optionally containing :host, :port, :project-dir and -:cljs-repl-type (e.g. 'shadow, 'node, 'figwheel, etc). - -On prefix, prompt for all the -parameters regardless of their supplied or default values. - -(fn &optional PARAMS)" t) -(autoload 'cider-connect-clj&cljs "cider" "\ -Initialize a Clojure and ClojureScript connection to an nREPL server. -PARAMS is a plist optionally containing :host, :port, :project-dir and -:cljs-repl-type (e.g. 'shadow, 'node, 'figwheel, etc). When SOFT-CLJS-START is -non-nil, don't start if ClojureScript requirements are not met. - -(fn PARAMS &optional SOFT-CLJS-START)" t) -(autoload 'cider "cider" "\ -Start a connection of any type interactively." t) -(defalias 'cider-jack-in #'cider-jack-in-clj) -(defalias 'cider-connect #'cider-connect-clj) -(autoload 'cider-jack-in-universal "cider" "\ -Start and connect to an nREPL server for the current project or ARG project id. - -If a project is found in current dir, call `cider-jack-in' passing ARG as -first parameter, of which see. Otherwise, ask user which project type to -start an nREPL server and connect to without a project. - -But if invoked with a numeric prefix ARG, then start an nREPL server for -the project type denoted by ARG number and connect to it, even if there is -no project for it in the current dir. - -The supported project tools and their assigned numeric prefix ids are -sourced from `cider-jack-in-universal-options', of which see. - -You can pass a numeric prefix argument n with `M-n` or `C-u n`. - -For example, to jack in to leiningen which is assigned to prefix arg 2 type - -M-2 \\[cider-jack-in-universal]. - -(fn ARG)" t) -(with-eval-after-load 'clojure-mode (define-key clojure-mode-map (kbd "C-c M-x") #'cider) (define-key clojure-mode-map (kbd "C-c M-j") #'cider-jack-in-clj) (define-key clojure-mode-map (kbd "C-c M-J") #'cider-jack-in-cljs) (define-key clojure-mode-map (kbd "C-c M-c") #'cider-connect-clj) (define-key clojure-mode-map (kbd "C-c M-C") #'cider-connect-cljs) (define-key clojure-mode-map (kbd "C-c C-x") 'cider-start-map) (define-key clojure-mode-map (kbd "C-c C-s") 'sesman-map) (require 'sesman) (sesman-install-menu clojure-mode-map) (add-hook 'clojure-mode-hook (lambda nil (setq-local sesman-system 'CIDER)))) -(register-definition-prefixes "cider" '("cider-")) - - -;;; Generated autoloads from cider-apropos.el - -(autoload 'cider-apropos "cider-apropos" "\ -Show all symbols whose names match QUERY, a regular expression. -QUERY can also be a list of space-separated words (e.g. take while) which -will be converted to a regular expression (like take.+while) automatically -behind the scenes. The search may be limited to the namespace NS, and may -optionally search doc strings (based on DOCS-P), include private vars -(based on PRIVATES-P), and be case-sensitive (based on CASE-SENSITIVE-P). - -(fn QUERY &optional NS DOCS-P PRIVATES-P CASE-SENSITIVE-P)" t) -(autoload 'cider-apropos-documentation "cider-apropos" "\ -Shortcut for (cider-apropos <query> nil t)." t) -(autoload 'cider-apropos-select "cider-apropos" "\ -Similar to `cider-apropos', but presents the results in a completing read. -Show all symbols whose names match QUERY, a regular expression. -QUERY can also be a list of space-separated words (e.g. take while) which -will be converted to a regular expression (like take.+while) automatically -behind the scenes. The search may be limited to the namespace NS, and may -optionally search doc strings (based on DOCS-P), include private vars -(based on PRIVATES-P), and be case-sensitive (based on CASE-SENSITIVE-P). - -(fn QUERY &optional NS DOCS-P PRIVATES-P CASE-SENSITIVE-P)" t) -(autoload 'cider-apropos-documentation-select "cider-apropos" "\ -Shortcut for (cider-apropos-select <query> nil t)." t) -(register-definition-prefixes "cider-apropos" '("apropos-special-form" "cider-")) - - -;;; Generated autoloads from cider-browse-ns.el - -(autoload 'cider-browse-ns "cider-browse-ns" "\ -List all NAMESPACE's vars in BUFFER. - -(fn NAMESPACE)" t) -(autoload 'cider-browse-ns-all "cider-browse-ns" "\ -List all loaded namespaces in BUFFER." t) -(register-definition-prefixes "cider-browse-ns" '("cider-browse-ns-")) - - -;;; Generated autoloads from cider-browse-spec.el - -(autoload 'cider-browse-spec "cider-browse-spec" "\ -Browse SPEC definition. - -(fn SPEC)" t) -(autoload 'cider-browse-spec-all "cider-browse-spec" "\ -Open list of specs in a popup buffer. - -With a prefix argument ARG, prompts for a regexp to filter specs. -No filter applied if the regexp is the empty string. - -(fn &optional ARG)" t) -(register-definition-prefixes "cider-browse-spec" '("cider-")) - - -;;; Generated autoloads from cider-cheatsheet.el - -(autoload 'cider-cheatsheet "cider-cheatsheet" "\ -Navigate `cider-cheatsheet-hierarchy' with `completing-read'. - -When you make it to a Clojure var its doc buffer gets displayed." t) -(register-definition-prefixes "cider-cheatsheet" '("cider-cheatsheet-")) - - -;;; Generated autoloads from cider-classpath.el - -(autoload 'cider-classpath "cider-classpath" "\ -List all classpath entries." t) -(autoload 'cider-open-classpath-entry "cider-classpath" "\ -Open a classpath entry." t) -(register-definition-prefixes "cider-classpath" '("cider-classpath-")) - - -;;; Generated autoloads from cider-client.el - -(register-definition-prefixes "cider-client" '("cider-")) - - -;;; Generated autoloads from cider-clojuredocs.el - -(autoload 'cider-clojuredocs-web "cider-clojuredocs" "\ -Open ClojureDocs documentation in the default web browser. - -Prompts for the symbol to use, or uses the symbol at point, depending on -the value of `cider-prompt-for-symbol'. With prefix arg ARG, does the -opposite of what that option dictates. - -(fn &optional ARG)" t) -(autoload 'cider-clojuredocs-refresh-cache "cider-clojuredocs" "\ -Refresh the ClojureDocs cache." t) -(autoload 'cider-clojuredocs "cider-clojuredocs" "\ -Open ClojureDocs documentation in a popup buffer. - -Prompts for the symbol to use, or uses the symbol at point, depending on -the value of `cider-prompt-for-symbol'. With prefix arg ARG, does the -opposite of what that option dictates. - -(fn &optional ARG)" t) -(register-definition-prefixes "cider-clojuredocs" '("cider-")) - - -;;; Generated autoloads from cider-common.el - -(register-definition-prefixes "cider-common" '("cider-")) - - -;;; Generated autoloads from cider-completion.el - -(register-definition-prefixes "cider-completion" '("cider-")) - - -;;; Generated autoloads from cider-completion-context.el - -(register-definition-prefixes "cider-completion-context" '("cider-completion-")) - - -;;; Generated autoloads from cider-connection.el - -(register-definition-prefixes "cider-connection" '("cider-")) - - -;;; Generated autoloads from cider-debug.el - -(autoload 'cider-debug-defun-at-point "cider-debug" "\ -Instrument the \"top-level\" expression at point. -If it is a defn, dispatch the instrumented definition. Otherwise, -immediately evaluate the instrumented expression. - -While debugged code is being evaluated, the user is taken through the -source code and displayed the value of various expressions. At each step, -a number of keys will be prompted to the user." t) -(register-definition-prefixes "cider-debug" '("cider-")) - - -;;; Generated autoloads from cider-doc.el - -(register-definition-prefixes "cider-doc" '("cider-")) - - -;;; Generated autoloads from cider-docstring.el - -(register-definition-prefixes "cider-docstring" '("cider-")) - - -;;; Generated autoloads from cider-eldoc.el - -(register-definition-prefixes "cider-eldoc" '("cider-")) - - -;;; Generated autoloads from cider-eval.el - -(register-definition-prefixes "cider-eval" '("cider-")) - - -;;; Generated autoloads from cider-find.el - -(autoload 'cider-find-var "cider-find" "\ -Find definition for VAR at LINE. -Prompt according to prefix ARG and `cider-prompt-for-symbol'. -A single or double prefix argument inverts the meaning of -`cider-prompt-for-symbol'. A prefix of `-` or a double prefix argument causes -the results to be displayed in a different window. The default value is -thing at point. - -(fn &optional ARG VAR LINE)" t) -(autoload 'cider-find-dwim-at-mouse "cider-find" "\ -Find and display variable or resource at mouse EVENT. - -(fn EVENT)" t) -(autoload 'cider-find-dwim "cider-find" "\ -Find and display the SYMBOL-FILE at point. -SYMBOL-FILE could be a var or a resource. If thing at point is empty then -show Dired on project. If var is not found, try to jump to resource of the -same name. When called interactively, a prompt is given according to the -variable `cider-prompt-for-symbol'. A single or double prefix argument -inverts the meaning. A prefix of `-' or a double prefix argument causes -the results to be displayed in a different window. A default value of thing -at point is given when prompted. - -(fn SYMBOL-FILE)" t) -(autoload 'cider-find-resource "cider-find" "\ -Find the resource at PATH. -Prompt for input as indicated by the variable `cider-prompt-for-symbol'. -A single or double prefix argument inverts the meaning of -`cider-prompt-for-symbol'. A prefix argument of `-` or a double prefix -argument causes the results to be displayed in other window. The default -value is thing at point. - -(fn PATH)" t) -(autoload 'cider-find-ns "cider-find" "\ -Find the file containing NS. -A prefix ARG of `-` or a double prefix argument causes -the results to be displayed in a different window. - -(fn &optional ARG NS)" t) -(autoload 'cider-find-keyword "cider-find" "\ -Find the namespace of the keyword at point and its primary occurrence there. - -For instance - if the keyword at point is \":cider.demo/keyword\", this command -would find the namespace \"cider.demo\" and afterwards find the primary (most relevant or first) -mention of \"::keyword\" there. - -Prompt according to prefix ARG and `cider-prompt-for-symbol'. -A single or double prefix argument inverts the meaning of -`cider-prompt-for-symbol'. A prefix of `-` or a double prefix argument causes -the results to be displayed in a different window. The default value is -thing at point. - -(fn &optional ARG)" t) -(register-definition-prefixes "cider-find" '("cider-")) - - -;;; Generated autoloads from cider-format.el - -(autoload 'cider-format-region "cider-format" "\ -Format the Clojure code in the current region. -START and END represent the region's boundaries. - -(fn START END)" t) -(autoload 'cider-format-defun "cider-format" "\ -Format the code in the current defun." t) -(autoload 'cider-format-buffer "cider-format" "\ -Format the Clojure code in the current buffer." t) -(autoload 'cider-format-edn-buffer "cider-format" "\ -Format the EDN data in the current buffer." t) -(autoload 'cider-format-edn-region "cider-format" "\ -Format the EDN data in the current region. -START and END represent the region's boundaries. - -(fn START END)" t) -(autoload 'cider-format-edn-last-sexp "cider-format" "\ -Format the EDN data of the last sexp." t) -(register-definition-prefixes "cider-format" '("cider--format-")) - - -;;; Generated autoloads from cider-inspector.el - -(autoload 'cider-inspect-last-sexp "cider-inspector" "\ -Inspect the result of the the expression preceding point." t) -(autoload 'cider-inspect-defun-at-point "cider-inspector" "\ -Inspect the result of the \"top-level\" expression at point." t) -(autoload 'cider-inspect-last-result "cider-inspector" "\ -Inspect the most recent eval result." t) -(autoload 'cider-inspect "cider-inspector" "\ -Inspect the result of the preceding sexp. - -With a prefix argument ARG it inspects the result of the \"top-level\" form. -With a second prefix argument it prompts for an expression to eval and inspect. - -(fn &optional ARG)" t) -(autoload 'cider-inspect-expr "cider-inspector" "\ -Evaluate EXPR in NS and inspect its value. -Interactively, EXPR is read from the minibuffer, and NS the -current buffer's namespace. - -(fn EXPR NS)" t) -(autoload 'cider-sync-request:inspect-last-exception "cider-inspector" "\ -Inspects the exception in the cause stack identified by INDEX, -V2 indicates if the entire response should be returned -instead of just its \"value\" entry. - -(fn INDEX &optional V2)") -(register-definition-prefixes "cider-inspector" '("cider-")) - - -;;; Generated autoloads from cider-jar.el - -(register-definition-prefixes "cider-jar" '("cider-jar-")) - - -;;; Generated autoloads from cider-log.el - - (autoload 'cider-log-info "cider-log-info" "Show the Cider log current log buffer, framework, appender and consumer." t) - (autoload 'cider-log-framework "cider-log" "Show the Cider log framework menu." t) - (autoload 'cider-log-appender "cider-log" "Show the Cider log appender menu." t) - (autoload 'cider-log-consumer "cider-log" "Show the Cider log consumer menu." t) - (autoload 'cider-log-event "cider-log" "Show the Cider log event menu." t) - (autoload 'cider-log "cider-log" "Show the Cider log menu." t) -(register-definition-prefixes "cider-log" '("cider-")) - - -;;; Generated autoloads from cider-macroexpansion.el - -(autoload 'cider-macroexpand-1 "cider-macroexpansion" "\ -Invoke \\=`macroexpand-1\\=` on the expression preceding point. -If invoked with a PREFIX argument, use \\=`macroexpand\\=` instead of -\\=`macroexpand-1\\=`. - -(fn &optional PREFIX)" t) -(autoload 'cider-macroexpand-all "cider-macroexpansion" "\ -Invoke \\=`macroexpand-all\\=` on the expression preceding point." t) -(register-definition-prefixes "cider-macroexpansion" '("cider-")) - - -;;; Generated autoloads from cider-mode.el - -(defvar cider-mode-line '(:eval (format " cider[%s]" (cider--modeline-info))) "\ -Mode line lighter for cider mode. - -The value of this variable is a mode line template as in -`mode-line-format'. See Info Node `(elisp)Mode Line Format' for details -about mode line templates. - -Customize this variable to change how cider mode displays its status in the -mode line. The default value displays the current connection. Set this -variable to nil to disable the mode line entirely.") -(custom-autoload 'cider-mode-line "cider-mode" t) -(with-eval-after-load 'clojure-mode (easy-menu-define cider-clojure-mode-menu-open clojure-mode-map "Menu for Clojure mode. - This is displayed in `clojure-mode' buffers, if `cider-mode' is not active." `("CIDER" :visible (not cider-mode) ["Start a Clojure REPL" cider-jack-in-clj :help "Starts an nREPL server and connects a Clojure REPL to it."] ["Connect to a Clojure REPL" cider-connect-clj :help "Connects to a REPL that's already running."] ["Start a ClojureScript REPL" cider-jack-in-cljs :help "Starts an nREPL server and connects a ClojureScript REPL to it."] ["Connect to a ClojureScript REPL" cider-connect-cljs :help "Connects to a ClojureScript REPL that's already running."] ["Start a Clojure REPL, and a ClojureScript REPL" cider-jack-in-clj&cljs :help "Starts an nREPL server, connects a Clojure REPL to it, and then a ClojureScript REPL."] "--" ["View user manual" cider-view-manual]))) -(autoload 'cider-mode "cider-mode" "\ -Minor mode for REPL interaction from a Clojure buffer. - -\\{cider-mode-map} - -This is a minor mode. If called interactively, toggle the `Cider - mode' mode. If the prefix argument is positive, enable the - mode, and if it is zero or negative, disable the mode. - -If called from Lisp, toggle the mode if ARG is `toggle'. Enable - the mode if ARG is nil, omitted, or is a positive number. - Disable the mode if ARG is a negative number. - -To check whether the minor mode is enabled in the current buffer, - evaluate `cider-mode'. - -The mode's hook is called both when the mode is enabled and when - it is disabled. - -(fn &optional ARG)" t) -(register-definition-prefixes "cider-mode" '("cider-")) - - -;;; Generated autoloads from cider-ns.el - -(autoload 'cider-ns-reload "cider-ns" "\ -Send a (require 'ns :reload) to the REPL. - -With an argument PROMPT, it prompts for a namespace name. This is the -Clojure out of the box reloading experience and does not rely on -org.clojure/tools.namespace. See Commentary of this file for a longer list -of differences. From the Clojure doc: \":reload forces loading of all the -identified libs even if they are already loaded\". - -(fn &optional PROMPT)" t) -(autoload 'cider-ns-reload-all "cider-ns" "\ -Send a (require 'ns :reload-all) to the REPL. - -With an argument PROMPT, it prompts for a namespace name. This is the -Clojure out of the box reloading experience and does not rely on -org.clojure/tools.namespace. See Commentary of this file for a longer list -of differences. From the Clojure doc: \":reload-all implies :reload and -also forces loading of all libs that the identified libs directly or -indirectly load via require\". - -(fn &optional PROMPT)" t) -(autoload 'cider-ns-refresh "cider-ns" "\ -Reload modified and unloaded namespaces on the classpath. - -With a single prefix argument, or if MODE is `refresh-all', reload all -namespaces on the classpath unconditionally. - -With a double prefix argument, or if MODE is `clear', clear the state of -the namespace tracker before reloading. This is useful for recovering from -some classes of error (for example, those caused by circular dependencies) -that a normal reload would not otherwise recover from. The trade-off of -clearing is that stale code from any deleted files may not be completely -unloaded. - -With a negative prefix argument, or if MODE is `inhibit-fns', prevent any -refresh functions (defined in `cider-ns-refresh-before-fn' and -`cider-ns-refresh-after-fn') from being invoked. - -(fn &optional MODE)" t) -(register-definition-prefixes "cider-ns" '("cider-ns-")) - - -;;; Generated autoloads from cider-overlays.el - -(register-definition-prefixes "cider-overlays" '("cider-")) - - -;;; Generated autoloads from cider-popup.el - -(register-definition-prefixes "cider-popup" '("cider-")) - - -;;; Generated autoloads from cider-profile.el - -(autoload 'cider-profile-samples "cider-profile" "\ -Displays current max-sample-count. -If optional QUERY is specified, set max-sample-count and display new value. - -(fn &optional QUERY)" t) -(autoload 'cider-profile-var-profiled-p "cider-profile" "\ -Displays the profiling status of var under point. -Prompts for var if none under point or QUERY is present. - -(fn QUERY)" t) -(autoload 'cider-profile-ns-toggle "cider-profile" "\ -Toggle profiling for the ns associated with optional QUERY. - -If optional argument QUERY is non-nil, prompt for ns. Otherwise use -current ns. - -(fn &optional QUERY)" t) -(autoload 'cider-profile-toggle "cider-profile" "\ -Toggle profiling for the given QUERY. -Defaults to the symbol at point. -With prefix arg or no symbol at point, prompts for a var. - -(fn QUERY)" t) -(autoload 'cider-profile-summary "cider-profile" "\ -Display a summary of currently collected profile data." t) -(autoload 'cider-profile-var-summary "cider-profile" "\ -Display profile data for var under point QUERY. -Defaults to the symbol at point. With prefix arg or no symbol at point, -prompts for a var. - -(fn QUERY)" t) -(autoload 'cider-profile-clear "cider-profile" "\ -Clear any collected profile data." t) -(register-definition-prefixes "cider-profile" '("cider-profile-")) - - -;;; Generated autoloads from cider-repl.el - -(register-definition-prefixes "cider-repl" '("cider-")) - - -;;; Generated autoloads from cider-repl-history.el - -(autoload 'cider-repl-history "cider-repl-history" "\ -Display items in the CIDER command history in another buffer." t) -(register-definition-prefixes "cider-repl-history" '("cider-repl-history-")) - - -;;; Generated autoloads from cider-resolve.el - -(register-definition-prefixes "cider-resolve" '("cider-resolve-")) - - -;;; Generated autoloads from cider-scratch.el - -(autoload 'cider-scratch "cider-scratch" "\ -Go to the scratch buffer named `cider-scratch-buffer-name'." t) -(register-definition-prefixes "cider-scratch" '("cider-")) - - -;;; Generated autoloads from cider-selector.el - -(autoload 'cider-selector "cider-selector" "\ -Select a new buffer by type, indicated by a single character. -The user is prompted for a single character indicating the method by -which to choose a new buffer. The `?' character describes the -available methods. OTHER-WINDOW provides an optional target. -See `def-cider-selector-method' for defining new methods. - -(fn &optional OTHER-WINDOW)" t) -(register-definition-prefixes "cider-selector" '("??" "?c" "?d" "?e" "?m" "?p" "?q" "?r" "?s" "?x" "cider-selector-" "def-cider-selector-method")) - - -;;; Generated autoloads from cider-stacktrace.el - -(register-definition-prefixes "cider-stacktrace" '("cider-")) - - -;;; Generated autoloads from cider-test.el - -(defvar cider-auto-test-mode nil "\ -Non-nil if Cider-Auto-Test mode is enabled. -See the `cider-auto-test-mode' command -for a description of this minor mode. -Setting this variable directly does not take effect; -either customize it (see the info node `Easy Customization') -or call the function `cider-auto-test-mode'.") -(custom-autoload 'cider-auto-test-mode "cider-test" nil) -(autoload 'cider-auto-test-mode "cider-test" "\ -Toggle automatic testing of Clojure files. - -When enabled this reruns tests every time a Clojure file is loaded. -Only runs tests corresponding to the loaded file's namespace and does -nothing if no tests are defined or if the file failed to load. - -This is a global minor mode. If called interactively, toggle the - `Cider-Auto-Test mode' mode. If the prefix argument is - positive, enable the mode, and if it is zero or negative, - disable the mode. - -If called from Lisp, toggle the mode if ARG is `toggle'. Enable - the mode if ARG is nil, omitted, or is a positive number. - Disable the mode if ARG is a negative number. - -To check whether the minor mode is enabled in the current buffer, - evaluate `(default-value \\='cider-auto-test-mode)'. - -The mode's hook is called both when the mode is enabled and when - it is disabled. - -(fn &optional ARG)" t) -(register-definition-prefixes "cider-test" '("cider-")) - - -;;; Generated autoloads from cider-tracing.el - -(autoload 'cider-toggle-trace-var "cider-tracing" "\ -Toggle var tracing. -Prompts for the symbol to use, or uses the symbol at point, depending on -the value of `cider-prompt-for-symbol'. With prefix arg ARG, does the -opposite of what that option dictates. - -(fn ARG)" t) -(autoload 'cider-toggle-trace-ns "cider-tracing" "\ -Toggle ns tracing. -Defaults to the current ns. With prefix arg QUERY, prompts for a ns. - -(fn QUERY)" t) -(register-definition-prefixes "cider-tracing" '("cider-")) - - -;;; Generated autoloads from cider-util.el - -(autoload 'cider-view-manual "cider-util" "\ -View the manual in your default browser." t) -(register-definition-prefixes "cider-util" '("cider-")) - - -;;; Generated autoloads from cider-xref.el - -(autoload 'cider-xref-fn-refs "cider-xref" "\ -Show all functions that reference the var matching NS and SYMBOL. - -(fn &optional NS SYMBOL)" t) -(autoload 'cider-xref-fn-deps "cider-xref" "\ -Show all functions referenced by the var matching NS and SYMBOL. - -(fn &optional NS SYMBOL)" t) -(autoload 'cider-xref-fn-refs-select "cider-xref" "\ -Displays the references for NS and SYMBOL using completing read. - -(fn &optional NS SYMBOL)" t) -(autoload 'cider-xref-fn-deps-select "cider-xref" "\ -Displays the function dependencies for NS and SYMBOL using completing read. - -(fn &optional NS SYMBOL)" t) -(register-definition-prefixes "cider-xref" '("cider-")) - - -;;; Generated autoloads from cider-xref-backend.el - -(register-definition-prefixes "cider-xref-backend" '("cider--")) - - -;;; Generated autoloads from nrepl-client.el - -(register-definition-prefixes "nrepl-client" '("cider-" "emacs-bug-46284/when-27.1-windows-nt" "nrepl-")) - - -;;; Generated autoloads from nrepl-dict.el - -(register-definition-prefixes "nrepl-dict" '("nrepl-")) - -;;; End of scraped data - -(provide 'cider-autoloads) - -;; Local Variables: -;; version-control: never -;; no-byte-compile: t -;; no-update-autoloads: t -;; no-native-compile: t -;; coding: utf-8-emacs-unix -;; End: - -;;; cider-autoloads.el ends here diff --git a/elpa/cider-1.12.0/cider-browse-ns.el b/elpa/cider-1.12.0/cider-browse-ns.el @@ -1,550 +0,0 @@ -;;; cider-browse-ns.el --- CIDER namespace browser -*- lexical-binding: t; -*- - -;; Copyright © 2014-2023 John Andrews, Bozhidar Batsov and CIDER contributors - -;; Author: John Andrews <john.m.andrews@gmail.com> - -;; This program is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see <http://www.gnu.org/licenses/>. - -;; This file is not part of GNU Emacs. - -;;; Commentary: - -;; M-x cider-browse-ns -;; -;; Display a list of all vars in a namespace. -;; Pressing <enter> will take you to the cider-doc buffer for that var. -;; Pressing ^ will take you to a list of all namespaces (akin to `dired-mode'). - -;; M-x cider-browse-ns-all -;; -;; Explore Clojure namespaces by browsing a list of all namespaces. -;; Pressing <enter> expands into a list of that namespace's vars as if by -;; executing the command (cider-browse-ns "my.ns"). - -;;; Code: - -(require 'cider-client) -(require 'cider-popup) -(require 'cider-util) -(require 'nrepl-dict) - -(require 'subr-x) -(require 'easymenu) -(require 'button) -(require 'cl-lib) -(require 'thingatpt) - - -(defgroup cider-browse-ns nil - "Display contents of namespaces for CIDER." - :prefix "cider-browse-ns-" - :group 'cider) - -(defface cider-browse-ns-extra-info-face - '((t (:inherit shadow))) - "Face for displaying extra info of namespace vars." - :package-version '(cider . "1.4.0")) - -(defcustom cider-browse-ns-default-filters nil - "List of default hide filters to apply to browse-ns buffer. - -Available options include `private', `test', `macro', `function', and -`var'." - :type 'list - :package-version '(cider . "1.4.0")) - -(defconst cider-browse-ns-buffer "*cider-ns-browser*") - -(defvar-local cider-browse-ns-current-ns nil) - -(defvar-local cider-browse-ns-filters nil) -(defvar-local cider-browse-ns-show-all nil) -(defvar-local cider-browse-ns-group-by nil) -(defvar-local cider-browse-ns-items nil) -(defvar-local cider-browse-ns-title nil) -(defvar-local cider-browse-ns-group-by nil) - - -;; Mode Definition - -(defvar cider-browse-ns-mode-map - (let ((map (make-sparse-keymap))) - (set-keymap-parent map cider-popup-buffer-mode-map) - (define-key map "d" #'cider-browse-ns-doc-at-point) - (define-key map "s" #'cider-browse-ns-find-at-point) - (define-key map (kbd "RET") #'cider-browse-ns-operate-at-point) - (define-key map "^" #'cider-browse-ns-all) - (define-key map "n" #'next-line) - (define-key map "p" #'previous-line) - - (define-key map "a" #'cider-browse-ns-toggle-all) - - (define-key map (kbd "h p") #'cider-browse-ns-toggle-hide-private) - (define-key map (kbd "h t") #'cider-browse-ns-toggle-hide-test) - (define-key map (kbd "h m") #'cider-browse-ns-toggle-hide-macro) - (define-key map (kbd "h f") #'cider-browse-ns-toggle-hide-function) - (define-key map (kbd "h v") #'cider-browse-ns-toggle-hide-var) - - (define-key map (kbd "g t") #'cider-browse-ns-group-by-type) - (define-key map (kbd "g v") #'cider-browse-ns-group-by-visibility) - - (easy-menu-define cider-browse-ns-mode-menu map - "Menu for CIDER's namespace browser" - '("Namespace Browser" - ["Show doc" cider-browse-ns-doc-at-point] - ["Go to definition" cider-browse-ns-find-at-point] - "--" - ["Browse all namespaces" cider-browse-ns-all])) - map)) - -(defvar cider-browse-ns-mouse-map - (let ((map (make-sparse-keymap))) - (define-key map [mouse-1] #'cider-browse-ns-handle-mouse) - map)) - -(define-derived-mode cider-browse-ns-mode special-mode "browse-ns" - "Major mode for browsing Clojure namespaces. - -\\{cider-browse-ns-mode-map}" - (setq-local electric-indent-chars nil) - (setq-local sesman-system 'CIDER) - (when cider-special-mode-truncate-lines - (setq-local truncate-lines t)) - (setq-local cider-browse-ns-current-ns nil)) - -(defun cider-browse-ns--text-face (var-meta) - "Return font-lock-face for a var. -VAR-META contains the metadata information used to decide a face. -Presence of \"arglists\" and \"macro\" indicates a macro form. -Only \"arglists\" indicates a function. Otherwise, its a variable. -If the NAMESPACE is not loaded in the REPL, assume TEXT is a fn." - (cond - ((not var-meta) 'font-lock-function-name-face) - ((and (nrepl-dict-contains var-meta "arglists") - (string= (nrepl-dict-get var-meta "macro") "true")) - 'font-lock-keyword-face) - ((nrepl-dict-contains var-meta "arglists") 'font-lock-function-name-face) - (t 'font-lock-variable-name-face))) - -(defun cider-browse-ns--properties (var var-meta) - "Decorate VAR with a clickable keymap and a face. -VAR-META is used to decide a font-lock face." - (let ((face (cider-browse-ns--text-face var-meta))) - (propertize var - 'font-lock-face face - 'mouse-face 'highlight - 'keymap cider-browse-ns-mouse-map))) - -(defun cider-browse-ns--ns-list (buffer title nss) - "List the namespaces NSS in BUFFER. - -Buffer is rendered with TITLE at the top and lists ITEMS filtered according -to user settings." - (let ((dict (nrepl-dict))) - (dolist (ns nss) - (nrepl-dict-put dict ns (nrepl-dict "ns" "true"))) - (cider-browse-ns--list buffer title dict nil))) - -(defun cider-browse-ns--list (buffer title items ns) - "Initialize rendering of browse-ns BUFFER. - -Initialize the buffer's TITLE, namespace NS, and the nrepl-dict ITEMS to be -displayed." - (with-current-buffer buffer - (cider-browse-ns-mode) - (setq-local cider-browse-ns-items items) - (setq-local cider-browse-ns-title title) - (setq-local cider-browse-ns-filters cider-browse-ns-default-filters) - (setq-local cider-browse-ns-current-ns ns)) - (cider-browse-ns--render-buffer)) - -(defun cider-browse-ns--meta-macro-p (var-meta) - "Return non-nil if VAR-META is the metadata of a macro." - (and (nrepl-dict-contains var-meta "arglists") - (string= (nrepl-dict-get var-meta "macro") "true"))) - -(defun cider-browse-ns--meta-test-p (var-meta) - "Return non-nil if VAR-META is the metadata of a test." - (nrepl-dict-contains var-meta "test")) - -(defun cider-browse-ns--meta-function-p (var-meta) - "Return non-nil if VAR-META is the metadata of a function." - (and (nrepl-dict-contains var-meta "arglists") - (not (cider-browse-ns--meta-macro-p var-meta)))) - -(defun cider-browse-ns--meta-private-p (var-meta) - "Return non-nil if VAR-META indicates a private element." - (string= (nrepl-dict-get var-meta "private") "true")) - -(defun cider-browse-ns--meta-var-p (var-meta) - "Return non-nil if VAR-META indicates a var." - (not (or (cider-browse-ns--meta-test-p var-meta) - (cider-browse-ns--meta-macro-p var-meta) - (cider-browse-ns--meta-function-p var-meta)))) - -(defun cider-browse-ns--item-filter (_ var-meta) - "Return non-nil if item containing VAR-META should be listed in buffer." - (let ((function-filter-p (memq 'function cider-browse-ns-filters)) - (var-filter-p (memq 'var cider-browse-ns-filters)) - (private-filter-p (memq 'private cider-browse-ns-filters)) - (test-filter-p (memq 'test cider-browse-ns-filters)) - (macro-filter-p (memq 'macro cider-browse-ns-filters))) - ;; check if item should be displayed - (let* ((macro-p (cider-browse-ns--meta-macro-p var-meta)) - (function-p (cider-browse-ns--meta-function-p var-meta)) - (private-p (cider-browse-ns--meta-private-p var-meta)) - (test-p (cider-browse-ns--meta-test-p var-meta)) - (var-p (cider-browse-ns--meta-var-p var-meta))) - (or cider-browse-ns-show-all - (not (or (and macro-p macro-filter-p) - (and function-p function-filter-p) - (and test-p test-filter-p) - (and var-p var-filter-p) - (and private-p private-filter-p))))))) - -(defun cider-browse-ns--propertized-item (key items) - "Return propertized line of item KEY in nrepl-dict ITEMS." - (let* ((var-meta (nrepl-dict-get items key)) - (face (cider-browse-ns--text-face (nrepl-dict-get items key))) - (private-p (string= (nrepl-dict-get var-meta "private") "true")) - (test-p (nrepl-dict-contains var-meta "test")) - (ns-p (nrepl-dict-contains var-meta "ns"))) - (concat - (propertize key - 'font-lock-face face - 'ns ns-p) - " " - (cond - (test-p (propertize "(test) " 'face 'cider-browse-ns-extra-info-face)) - (private-p (propertize "(-) " 'face 'cider-browse-ns-extra-info-face)) - (t ""))))) - -(defun cider-browse-ns--display-list (keys items max-length &optional label) - "Render the items of KEYS as condained in the nrepl-dict ITEMS. - -Pad the row to be MAX-LENGTH+1. If LABEL is non-nil, add a header to the -list of items." - (when keys - (when label - (insert " " label ":\n")) - (dolist (key keys) - (let* ((doc (nrepl-dict-get-in items (list key "doc"))) - (doc (when doc (read doc))) - (first-doc-line (cider-browse-ns--first-doc-line doc)) - (item-line (cider-browse-ns--propertized-item key items))) - (insert " ") - (insert item-line) - (when cider-browse-ns-current-ns - (insert (make-string (+ (- max-length (string-width item-line)) 1) ?·)) - (insert " " (propertize first-doc-line 'font-lock-face 'font-lock-doc-face))) - (insert "\n"))) - (insert "\n"))) - -(defun cider-browse-ns--column-width (items) - "Determine the display width of displayed ITEMS." - (let* ((propertized-lines - (seq-map (lambda (key) - (cider-browse-ns--propertized-item key items)) - (nrepl-dict-keys items)))) - (if propertized-lines - (apply #'max (seq-map (lambda (entry) (string-width entry)) - propertized-lines)) - 0))) - -(defun cider-browse-ns--render-items (items) - "Render the nrepl-dict ITEMS to the browse-ns buffer." - (let* ((max-length (cider-browse-ns--column-width items))) - (cl-labels - ((keys-from-pred - (pred items) - (nrepl-dict-keys (nrepl-dict-filter (lambda (_ var-meta) - (funcall pred var-meta)) - items)))) - (cond - ((eql cider-browse-ns-group-by 'type) - (let* ((func-keys (keys-from-pred #'cider-browse-ns--meta-function-p items)) - (macro-keys (keys-from-pred #'cider-browse-ns--meta-macro-p items)) - (var-keys (keys-from-pred #'cider-browse-ns--meta-var-p items)) - (test-keys (keys-from-pred #'cider-browse-ns--meta-test-p items))) - (cider-browse-ns--display-list func-keys items max-length "Functions") - (cider-browse-ns--display-list macro-keys items max-length "Macros") - (cider-browse-ns--display-list var-keys items max-length "Vars") - (cider-browse-ns--display-list test-keys items max-length "Tests"))) - ((eql cider-browse-ns-group-by 'visibility) - (let* ((public-keys - (keys-from-pred - (lambda (var-meta) - (not (cider-browse-ns--meta-private-p var-meta))) - items)) - (private-keys (keys-from-pred #'cider-browse-ns--meta-private-p items))) - (cider-browse-ns--display-list public-keys items max-length "Public") - (cider-browse-ns--display-list private-keys items max-length "Private"))) - (t - (cider-browse-ns--display-list - (nrepl-dict-keys items) items max-length)))))) - -(defun cider-browse-ns--filter (flag) - "Toggle the filter indicated by FLAG and re-render the buffer." - (setq cider-browse-ns-filters - (if (memq flag cider-browse-ns-filters) - (remq flag cider-browse-ns-filters) - (cons flag cider-browse-ns-filters))) - (cider-browse-ns--render-buffer)) - -(defun cider-browse-ns--button-filter (button) - "Handle filter action for BUTTON." - (let ((flag (button-get button 'filter))) - (cider-browse-ns--filter flag))) - -(defun cider-browse-ns--group (flag) - "Set the group-by option to FLAG and re-renderthe buffer." - (setq cider-browse-ns-group-by - (if (eql flag cider-browse-ns-group-by) nil flag)) - (cider-browse-ns--render-buffer)) - -(defun cider-browse-ns--button-group (button) - "Handle grouping action for BUTTON." - (let ((flag (button-get button 'group-by))) - (cider-browse-ns--group flag))) - -(defun cider-browse-ns--toggle-all (_button) - "Toggle the display-all visibility setting." - (setq cider-browse-ns-show-all (not cider-browse-ns-show-all)) - (cider-browse-ns--render-buffer)) - -(defun cider-browse-ns--render-header (&optional filtered-items-ct) - "Render the section at the top of the buffer displaying visibility controls. - -If FILTERED-ITEMS-CT is non-nil, then display a message of how many items -are being filtered." - ;; Display Show line - (insert " Show: ") - (insert-text-button "All" - 'follow-link t - 'action #'cider-browse-ns--toggle-all - ;; 'help-echo (cider-stacktrace-tooltip) - 'face (if cider-browse-ns-show-all - 'cider-stacktrace-filter-active-face - nil)) - (insert "\n") - ;; Display Filters - (let ((filters '(("Private" private) - ("Test" test) - ("Macro" macro) - ("Function" function) - ("Var" var)))) - (insert " Hide: ") - (dolist (filter filters) - (seq-let (title key) filter - (let ((is-active (memq key cider-browse-ns-filters))) - (insert-text-button title - 'filter key - 'follow-link t - 'action #'cider-browse-ns--button-filter - ;; 'help-echo (cider-stacktrace-tooltip) - 'face (if (and is-active (not cider-browse-ns-show-all)) - 'cider-stacktrace-filter-active-face - nil)) - (insert " ")))) - (when filtered-items-ct - (insert (format "(%d items filtered)" filtered-items-ct)))) - (insert "\n") - ;; Groupings - (insert " Group-by: ") - (let ((groupings '(("Type" type) - ("Visibility" visibility)))) - (dolist (grouping groupings) - (seq-let (title key) grouping - (let ((is-active (eql key cider-browse-ns-group-by))) - (insert-text-button title - 'group-by key - 'follow-link t - 'action #'cider-browse-ns--button-group - ;; 'help-echo () - 'face (if is-active - 'cider-stacktrace-filter-active-face - nil))) - (insert " ")))) - (insert "\n\n")) - -(defun cider-browse-ns--render-buffer (&optional buffer) - "Render the sections of the browse-ns buffer. - -Render occurs in BUFFER if non-nil. This function is the main entrypoint -for redisplaying the buffer when filters change." - (with-current-buffer (or buffer (current-buffer)) - (let* ((inhibit-read-only t) - (point (point)) - (filtered-items (nrepl-dict-filter #'cider-browse-ns--item-filter - cider-browse-ns-items)) - (filtered-item-ct (- (length (nrepl-dict-keys cider-browse-ns-items)) - (length (nrepl-dict-keys filtered-items))))) - (erase-buffer) - (insert (propertize (cider-propertize cider-browse-ns-title 'ns) 'ns t) "\n") - (when cider-browse-ns-current-ns - (cider-browse-ns--render-header filtered-item-ct)) - (cider-browse-ns--render-items filtered-items) - (goto-char point)))) - -(defun cider-browse-ns--first-doc-line (doc) - "Return the first line of the given DOC string. -If the first line of the DOC string contains multiple sentences, only -the first sentence is returned. If the DOC string is nil, a Not documented -string is returned." - (if doc - (let* ((split-newline (split-string doc "\n")) - (first-line (car split-newline))) - (cond - ((string-match "\\. " first-line) (substring first-line 0 (match-end 0))) - ((= 1 (length split-newline)) first-line) - (t (concat first-line "...")))) - "Not documented.")) - -(defun cider-browse-ns--combined-vars-with-meta (namespace) - "Return the combined public and private vars in NAMESPACE. - -Private vars have the additional metadata \"private\": \"true\" in their -var-meta map." - (let ((items (cider-sync-request:ns-vars-with-meta namespace)) - (private-items (cider-sync-request:private-ns-vars-with-meta namespace))) - (when private-items - (dolist (key (nrepl-dict-keys private-items)) - (let ((var-meta (nrepl-dict-put (nrepl-dict-get private-items key) - "private" "true"))) - (setq items (nrepl-dict-put items key var-meta))))) - items)) - -;; Interactive Functions - -;;;###autoload -(defun cider-browse-ns (namespace) - "List all NAMESPACE's vars in BUFFER." - (interactive (list (completing-read "Browse namespace: " (cider-sync-request:ns-list)))) - (with-current-buffer (cider-popup-buffer cider-browse-ns-buffer 'select nil 'ancillary) - (cider-browse-ns--list (current-buffer) - namespace - (cider-browse-ns--combined-vars-with-meta namespace) - namespace))) - -;;;###autoload -(defun cider-browse-ns-all () - "List all loaded namespaces in BUFFER." - (interactive) - (with-current-buffer (cider-popup-buffer cider-browse-ns-buffer 'select nil 'ancillary) - (let ((names (cider-sync-request:ns-list))) - (cider-browse-ns--ns-list - (current-buffer) - "All loaded namespaces" - (mapcar (lambda (name) - (cider-browse-ns--properties name nil)) - names))))) - -(defun cider-browse-ns--thing-at-point () - "Get the thing at point. -Return a list of the type ('ns or 'var) and the value." - (let ((ns-p (get-text-property (point) 'ns)) - (line (car (split-string (string-trim (thing-at-point 'line)) " ")))) - (if (or ns-p (string-match "\\." line)) - `(ns ,line) - `(var ,(format "%s/%s" - (or (get-text-property (point) 'cider-browse-ns-current-ns) - cider-browse-ns-current-ns) - line))))) - -(defun cider-browse-ns-toggle-all () - "Toggle showing all of the items in the browse-ns buffer." - (interactive) - (cider-browse-ns--toggle-all nil)) - -(defun cider-browse-ns-toggle-hide-private () - "Toggle visibility of private items displayed in browse-ns buffer." - (interactive) - (cider-browse-ns--filter 'private)) - -(defun cider-browse-ns-toggle-hide-test () - "Toggle visibility of test items displayed in browse-ns buffer." - (interactive) - (cider-browse-ns--filter 'test)) - -(defun cider-browse-ns-toggle-hide-macro () - "Toggle visibility of macro items displayed in browse-ns buffer." - (interactive) - (cider-browse-ns--filter 'macro)) - -(defun cider-browse-ns-toggle-hide-function () - "Toggle visibility of function items displayed in browse-ns buffer." - (interactive) - (cider-browse-ns--filter 'function)) - -(defun cider-browse-ns-toggle-hide-var () - "Toggle visibility of var items displayed in browse-ns buffer." - (interactive) - (cider-browse-ns--filter 'var)) - -(defun cider-browse-ns-group-by-type () - "Toggle visibility of var items displayed in browse-ns buffer." - (interactive) - (cider-browse-ns--group 'type)) - -(defun cider-browse-ns-group-by-visibility () - "Toggle visibility of var items displayed in browse-ns buffer." - (interactive) - (cider-browse-ns--group 'visibility)) - - -(declare-function cider-doc-lookup "cider-doc") - -(defun cider-browse-ns-doc-at-point () - "Show the documentation for the thing at current point." - (interactive) - (let* ((thing (cider-browse-ns--thing-at-point)) - (value (cadr thing))) - ;; value is either some ns or a var - (cider-doc-lookup value))) - -(defun cider-browse-ns-operate-at-point () - "Expand browser according to thing at current point. -If the thing at point is a ns it will be browsed, -and if the thing at point is some var - its documentation will -be displayed." - (interactive) - (let* ((thing (cider-browse-ns--thing-at-point)) - (type (car thing)) - (value (cadr thing))) - (if (eq type 'ns) - (cider-browse-ns value) - (cider-doc-lookup value)))) - -(declare-function cider-find-ns "cider-find") -(declare-function cider-find-var "cider-find") - -(defun cider-browse-ns-find-at-point () - "Find the definition of the thing at point." - (interactive) - (let* ((thing (cider-browse-ns--thing-at-point)) - (type (car thing)) - (value (cadr thing))) - (if (eq type 'ns) - (cider-find-ns nil value) - (cider-find-var current-prefix-arg value)))) - -(defun cider-browse-ns-handle-mouse (_event) - "Handle mouse click EVENT." - (interactive "e") - (cider-browse-ns-operate-at-point)) - -(provide 'cider-browse-ns) - -;;; cider-browse-ns.el ends here diff --git a/elpa/cider-1.12.0/cider-browse-spec.el b/elpa/cider-1.12.0/cider-browse-spec.el @@ -1,455 +0,0 @@ -;;; cider-browse-spec.el --- CIDER spec browser -*- lexical-binding: t; -*- - -;; Copyright © 2017-2023 Juan Monetta, Bozhidar Batsov and CIDER contributors - -;; Author: Juan Monetta <jpmonettas@gmail.com> - -;; This program is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see <http://www.gnu.org/licenses/>. - -;; This file is not part of GNU Emacs. - -;;; Commentary: - -;; M-x cider-browse-spec -;; -;; Display a spec description you can browse. -;; Pressing <enter> over a sub spec will take you to the description of that sub spec. -;; Pressing ^ takes you to the list of all specs. - -;; M-x cider-browse-spec-all -;; -;; Explore clojure.spec registry by browsing a list of all specs. -;; Pressing <enter> over a spec display the spec description you can browse. - -;;; Code: - -(require 'cider-client) -(require 'cider-popup) -(require 'cider-util) -(require 'cl-lib) -(require 'nrepl-dict) -(require 'seq) -(require 'subr-x) -(require 'help-mode) - -;; The buffer names used by the spec browser -(defconst cider-browse-spec-buffer "*cider-spec-browser*") -(defconst cider-browse-spec-example-buffer "*cider-spec-example*") - -;; Mode Definition - -(defvar cider-browse-spec-mode-map - (let ((map (make-sparse-keymap))) - (set-keymap-parent map (make-composed-keymap button-buffer-map - cider-popup-buffer-mode-map)) - (define-key map (kbd "RET") #'cider-browse-spec--browse-at) - (define-key map "n" #'forward-button) - (define-key map "p" #'backward-button) - map) - "Keymap for `cider-browse-spec-mode'.") - -(define-derived-mode cider-browse-spec-mode special-mode "Specs" - "Major mode for browsing Clojure specs. - -\\{cider-browse-spec-mode-map}" - (setq-local electric-indent-chars nil) - (setq-local sesman-system 'CIDER) - (when cider-special-mode-truncate-lines - (setq-local truncate-lines t))) - -(defvar cider-browse-spec--current-spec nil) - -(defvar cider-browse-spec-view-mode-map - (let ((map (make-sparse-keymap))) - (set-keymap-parent map help-mode-map) - (define-key map (kbd "RET") #'cider-browse-spec--browse-at) - (define-key map "^" #'cider-browse-spec-all) - (define-key map "e" #'cider-browse-spec--print-curr-spec-example) - (define-key map "n" #'forward-button) - (define-key map "p" #'backward-button) - map) - "Keymap for `cider-browse-spec-view-mode'.") - -(define-derived-mode cider-browse-spec-view-mode help-mode "Spec" - "Major mode for displaying CIDER spec. - -\\{cider-browse-spec-view-mode-map}" - (setq-local cider-browse-spec--current-spec nil) - (setq-local electric-indent-chars nil) - (setq-local sesman-system 'CIDER) - (when cider-special-mode-truncate-lines - (setq-local truncate-lines t))) - -(defvar cider-browse-spec-example-mode-map - (let ((map (make-sparse-keymap))) - (set-keymap-parent map cider-popup-buffer-mode-map) - (define-key map "^" #'cider-browse-spec-all) - (define-key map "e" #'cider-browse-spec--print-curr-spec-example) - (define-key map "g" #'revert-buffer) - map) - "Keymap for `cider-browse-spec-example-mode'.") - -(define-derived-mode cider-browse-spec-example-mode special-mode "Example" - "Major mode for Clojure spec examples. - -\\{cider-browse-spec-example-mode-map}" - (setq-local electric-indent-chars nil) - (setq-local revert-buffer-function #'cider-browse-spec--example-revert-buffer-function) - (setq-local sesman-system 'CIDER) - (when cider-special-mode-truncate-lines - (setq-local truncate-lines t))) - -;; Non interactive functions - -(define-button-type 'cider-browse-spec--spec - 'action #'cider-browse-spec--browse-at - 'face nil - 'follow-link t - 'help-echo "View spec") - -(defun cider-browse-spec--draw-list-buffer (buffer title specs) - "Reset contents of BUFFER. -Display TITLE at the top and SPECS are indented underneath." - (with-current-buffer buffer - (cider-browse-spec-mode) - (let ((inhibit-read-only t)) - (erase-buffer) - (goto-char (point-max)) - (insert (cider-propertize title 'emph) "\n") - (dolist (spec-name specs) - (insert (propertize " " 'spec-name spec-name)) - (thread-first - (cider-font-lock-as-clojure spec-name) - (insert-text-button 'type 'cider-browse-spec--spec) - (button-put 'spec-name spec-name)) - (insert (propertize "\n" 'spec-name spec-name))) - (goto-char (point-min))))) - -(defun cider--qualified-keyword-p (str) - "Return non nil if STR is a namespaced keyword." - (string-match-p "^:.+/.+$" str)) - -(defun cider--spec-fn-p (value fn-name) - "Return non nil if VALUE is clojure.spec.[alpha]/FN-NAME." - (string-match-p (concat "^\\(clojure.spec\\|clojure.spec.alpha\\|clojure.alpha.spec\\)/" fn-name "$") value)) - -(defun cider-browse-spec--render-schema-map (spec-form) - "Render the s/schema map declaration SPEC-FORM." - (let ((name-spec-pairs (seq-partition (cdaadr spec-form) 2))) - (format "(s/schema\n {%s})" - (string-join - (thread-last - (seq-sort-by #'car #'string< name-spec-pairs) - (mapcar (lambda (s) (concat (cl-first s) " " (cider-browse-spec--pprint (cl-second s)))))) - "\n ")))) - -(defun cider-browse-spec--render-schema-vector (spec-form) - "Render the s/schema vector declaration SPEC-FORM." - (format "(s/schema\n [%s])" - (string-join - (thread-last - (cl-second spec-form) - (mapcar (lambda (s) (cider-browse-spec--pprint s)))) - "\n "))) - -(defun cider-browse-spec--render-schema (spec-form) - "Render the s/schema SPEC-FORM." - (let ((schema-args (cl-second spec-form))) - (if (and (listp schema-args) - (nrepl-dict-p (cl-first schema-args))) - (cider-browse-spec--render-schema-map spec-form) - (cider-browse-spec--render-schema-vector spec-form)))) - -(defun cider-browse-spec--render-select (spec-form) - "Render the s/select SPEC-FORM." - (let ((keyset (cl-second spec-form)) - (selection (cl-third spec-form))) - (format "(s/select\n %s\n [%s])" - (cider-browse-spec--pprint keyset) - (string-join - (thread-last - selection - (mapcar (lambda (s) (cider-browse-spec--pprint s)))) - "\n ")))) - -(defun cider-browse-spec--render-union (spec-form) - "Render the s/union SPEC-FORM." - (let ((keyset (cl-second spec-form)) - (selection (cl-third spec-form))) - (format "(s/union\n %s\n [%s])" - (cider-browse-spec--pprint keyset) - (string-join - (thread-last - selection - (mapcar (lambda (s) (cider-browse-spec--pprint s)))) - "\n ")))) - -(defun cider-browse-spec--render-vector (spec-form) - "Render SPEC-FORM as a vector." - (format "[%s]" (string-join (mapcar #'cider-browse-spec--pprint spec-form)))) - -(defun cider-browse-spec--render-map-entry (spec-form) - "Render SPEC-FORM as a map entry." - (let ((key (cl-first spec-form)) - (value (cl-second spec-form))) - (format "%s %s" (cider-browse-spec--pprint key) - (if (listp value) - (cider-browse-spec--render-vector value) - (cider-browse-spec--pprint value))))) - -(defun cider-browse-spec--render-map (spec-form) - "Render SPEC-FORM as a map." - (let ((map-entries (cl-rest spec-form))) - (format "{%s}" (thread-last - (seq-partition map-entries 2) - (seq-map #'cider-browse-spec--render-map-entry) - (string-join))))) - -(defun cider-browse-spec--pprint (form) - "Given a spec FORM builds a multi line string with a pretty render of that FORM." - (cond ((stringp form) - (if (cider--qualified-keyword-p form) - (with-temp-buffer - (thread-first - form - (insert-text-button 'type 'cider-browse-spec--spec) - (button-put 'spec-name form)) - (buffer-string)) - ;; to make it easier to read replace all clojure.spec ns with s/ - ;; and remove all clojure.core ns - (thread-last - form - (replace-regexp-in-string "^\\(clojure.spec\\|clojure.spec.alpha\\|clojure.alpha.spec\\)/" "s/") - (replace-regexp-in-string "^\\(clojure.core\\)/" "")))) - - ((and (listp form) (stringp (cl-first form))) - (let ((form-tag (cl-first form))) - (cond - ;; prettier fns #() - ((string-equal form-tag "clojure.core/fn") - (if (equal (cl-second form) '("%")) - (format "#%s" (cl-reduce #'concat (mapcar #'cider-browse-spec--pprint (cl-rest (cl-rest form))))) - (format "(fn [%%] %s)" (cl-reduce #'concat (mapcar #'cider-browse-spec--pprint (cl-rest (cl-rest form))))))) - ;; prettier (s/and ) - ((cider--spec-fn-p form-tag "and") - (format "(s/and\n%s)" (string-join (thread-last - (cl-rest form) - (mapcar #'cider-browse-spec--pprint) - (mapcar (lambda (x) (format "%s" x)))) - "\n"))) - ;; prettier (s/or ) - ((cider--spec-fn-p form-tag "or") - (let ((name-spec-pair (seq-partition (cl-rest form) 2))) - (format "(s/or\n%s)" (string-join - (thread-last - name-spec-pair - (mapcar (lambda (s) (format "%s %s" (cl-first s) (cider-browse-spec--pprint (cl-second s)))))) - "\n")))) - ;; prettier (s/merge ) - ((cider--spec-fn-p form-tag "merge") - (format "(s/merge\n%s)" (string-join (thread-last - (cl-rest form) - (mapcar #'cider-browse-spec--pprint) - (mapcar (lambda (x) (format "%s" x)))) - "\n"))) - ;; prettier (s/keys ) - ((cider--spec-fn-p form-tag "keys") - (let ((keys-args (seq-partition (cl-rest form) 2))) - (format "(s/keys%s)" (thread-last - keys-args - (mapcar (lambda (s) - (let ((key-type (cl-first s)) - (specs-vec (cl-second s))) - (concat "\n" key-type - " [" - (string-join (thread-last - specs-vec - (mapcar #'cider-browse-spec--pprint) - (mapcar (lambda (x) (format "%s" x)))) - "\n") - "]")))) - (cl-reduce #'concat))))) - ;; prettier (s/multi-spec) - ((cider--spec-fn-p form-tag "multi-spec") - (let ((multi-method (cl-second form)) - (retag (cl-third form)) - (sub-specs (cl-rest (cl-rest (cl-rest form))))) - (format "(s/multi-spec %s %s\n%s)" - multi-method - retag - (string-join - (thread-last - sub-specs - (mapcar (lambda (s) - (concat "\n\n" (cl-first s) " " (cider-browse-spec--pprint (cl-second s)))))) - "\n")))) - ;; prettier (s/cat ) - ((cider--spec-fn-p form-tag "cat") - (let ((name-spec-pairs (seq-partition (cl-rest form) 2))) - (format "(s/cat %s)" - (thread-last - name-spec-pairs - (mapcar (lambda (s) - (concat "\n" (cl-first s) " " (cider-browse-spec--pprint (cl-second s))))) - (cl-reduce #'concat))))) - ;; prettier (s/alt ) - ((cider--spec-fn-p form-tag "alt") - (let ((name-spec-pairs (seq-partition (cl-rest form) 2))) - (format "(s/alt %s)" - (thread-last - name-spec-pairs - (mapcar (lambda (s) - (concat "\n" (cl-first s) " " (cider-browse-spec--pprint (cl-second s))))) - (cl-reduce #'concat))))) - ;; prettier (s/fspec ) - ((cider--spec-fn-p form-tag "fspec") - (thread-last - (seq-partition (cl-rest form) 2) - (cl-remove-if (lambda (s) (and (stringp (cl-second s)) - (string-empty-p (cl-second s))))) - (mapcar (lambda (s) - (format "\n%-11s: %s" (pcase (cl-first s) - (":args" "arguments") - (":ret" "returns") - (":fn" "invariants")) - (cider-browse-spec--pprint (cl-second s))))) - (cl-reduce #'concat) - (format "%s"))) - ;; prettier (s/schema ) - ((cider--spec-fn-p form-tag "schema") - (cider-browse-spec--render-schema form)) - ;; prettier (s/select ) - ((cider--spec-fn-p form-tag "select") - (cider-browse-spec--render-select form)) - ;; prettier (s/union ) - ((cider--spec-fn-p form-tag "union") - (cider-browse-spec--render-union form)) - ;; every other with no special management - (t (format "(%s %s)" - (cider-browse-spec--pprint form-tag) - (string-join (mapcar #'cider-browse-spec--pprint (cl-rest form)) " ")))))) - ((nrepl-dict-p form) - (cider-browse-spec--render-map form)) - (t (format "%s" form)))) - -(defun cider-browse-spec--pprint-indented (spec-form) - "Indent (pretty-print) and font-lock SPEC-FORM. -Return the result as a string." - (with-temp-buffer - (clojure-mode) - (insert (cider-browse-spec--pprint spec-form)) - (indent-region (point-min) (point-max)) - (font-lock-ensure) - (buffer-string))) - -(defun cider-browse-spec--draw-spec-buffer (buffer spec spec-form) - "Reset contents of BUFFER and draws everything needed to browse the SPEC-FORM. -Display SPEC as a title and uses `cider-browse-spec--pprint' to display -a more user friendly representation of SPEC-FORM." - (with-current-buffer buffer - (let ((inhibit-read-only t)) - (cider--help-setup-xref (list #'cider-browse-spec spec) nil buffer) - (goto-char (point-max)) - (insert (cider-font-lock-as-clojure spec) "\n\n") - (insert (cider-browse-spec--pprint-indented spec-form)) - (cider--make-back-forward-xrefs) - (current-buffer)))) - -(defun cider-browse-spec--browse (spec) - "Browse SPEC." - (cider-ensure-connected) - (cider-ensure-op-supported "spec-form") - ;; Expand auto-resolved keywords - (when-let* ((val (and (string-match-p "^::.+" spec) - (nrepl-dict-get (cider-sync-tooling-eval spec (cider-current-ns)) "value")))) - (setq spec val)) - (with-current-buffer (cider-popup-buffer cider-browse-spec-buffer 'select #'cider-browse-spec-view-mode 'ancillary) - (setq-local cider-browse-spec--current-spec spec) - (cider-browse-spec--draw-spec-buffer (current-buffer) - spec - (cider-sync-request:spec-form spec)) - (goto-char (point-min)) - (current-buffer))) - -(defun cider-browse-spec--browse-at (&optional pos) - "View the definition of a spec. - -Optional argument POS is the position of a spec, defaulting to point. POS -may also be a button, so this function can be used a the button's `action' -property." - (interactive) - (let ((pos (or pos (point)))) - (when-let* ((spec (button-get pos 'spec-name))) - (cider-browse-spec--browse spec)))) - -;; Interactive Functions - -(defun cider-browse-spec--print-curr-spec-example () - "Generate and print an example of the current spec." - (interactive) - (cider-ensure-connected) - (cider-ensure-op-supported "spec-example") - (if-let* ((spec cider-browse-spec--current-spec)) - (if-let* ((example (cider-sync-request:spec-example spec))) - (with-current-buffer (cider-popup-buffer cider-browse-spec-example-buffer 'select #'cider-browse-spec-example-mode 'ancillary) - (setq-local cider-browse-spec--current-spec spec) - (let ((inhibit-read-only t)) - (insert "Example of " (cider-font-lock-as-clojure spec)) - (insert "\n\n") - (insert (cider-font-lock-as-clojure example)) - (goto-char (point-min)))) - (error (format "No example for spec %s" spec))) - (error "No current spec"))) - -(defun cider-browse-spec--example-revert-buffer-function (&rest _) - "`revert-buffer' function for `cider-browse-spec-example-mode'. - -Generates a new example for the current spec." - (cider-browse-spec--print-curr-spec-example)) - -;;;###autoload -(defun cider-browse-spec (spec) - "Browse SPEC definition." - (interactive (list (completing-read "Browse spec: " - (cider-sync-request:spec-list) - nil nil - (cider-symbol-at-point)))) - (cider-browse-spec--browse spec)) - -(defun cider-browse-spec-regex (regex) - "Open the list of specs that matches REGEX in a popup buffer. -Displays all specs when REGEX is nil." - (cider-ensure-connected) - (cider-ensure-op-supported "spec-list") - (let ((filter-regex (or regex ""))) - (with-current-buffer (cider-popup-buffer cider-browse-spec-buffer 'select nil 'ancillary) - (let ((specs (cider-sync-request:spec-list filter-regex))) - (cider-browse-spec--draw-list-buffer (current-buffer) - (if (string-empty-p filter-regex) - "All specs in registry" - (format "All specs matching regex `%s' in registry" filter-regex)) - specs))))) - -;;;###autoload -(defun cider-browse-spec-all (&optional arg) - "Open list of specs in a popup buffer. - -With a prefix argument ARG, prompts for a regexp to filter specs. -No filter applied if the regexp is the empty string." - (interactive "P") - (cider-browse-spec-regex (if arg (read-string "Filter regex: ") ""))) - -(provide 'cider-browse-spec) - -;;; cider-browse-spec.el ends here diff --git a/elpa/cider-1.12.0/cider-cheatsheet.el b/elpa/cider-1.12.0/cider-cheatsheet.el @@ -1,577 +0,0 @@ -;;; cider-cheatsheet.el --- Quick reference for Clojure -*- lexical-binding: t -*- - -;; Copyright © 2019-2023 Kris Jenkins, Bozhidar Batsov and CIDER contributors -;; -;; Author: Kris Jenkins <krisajenkins@gmail.com> - -;; This program is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see <http://www.gnu.org/licenses/>. - -;; This file is not part of GNU Emacs. - -;;; Commentary: - -;; A quick reference system for Clojure. Fast, searchable & available offline. - -;; Mostly taken from Kris Jenkins' `clojure-cheatsheet' -;; See: https://github.com/clojure-emacs/clojure-cheatsheet - -;;; Code: - -(require 'cider-doc) -(require 'seq) - -(defconst cider-cheatsheet-hierarchy - '(("Primitives" - ("Numbers" - ("Arithmetic" - (clojure.core + - * / quot rem mod dec inc max min)) - ("Compare" - (clojure.core = == not= < > <= >= compare)) - ("Bitwise" - (clojure.core bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor unsigned-bit-shift-right)) - ("Cast" - (clojure.core byte short long int float double bigdec bigint biginteger num rationalize)) - ("Test" - (clojure.core nil? some? identical? zero? pos? neg? even? odd?)) - ("Random" - (clojure.core rand rand-int)) - ("BigDecimal" - (clojure.core with-precision)) - ("Ratios" - (clojure.core numerator denominator ratio?)) - ("Arbitrary Precision Arithmetic" - (clojure.core +\' -\' *\' inc\' dec\')) - ("Unchecked" - (clojure.core *unchecked-math* - unchecked-add - unchecked-add-int - unchecked-byte - unchecked-char - unchecked-dec - unchecked-dec-int - unchecked-divide-int - unchecked-double - unchecked-float - unchecked-inc - unchecked-inc-int - unchecked-int - unchecked-long - unchecked-multiply - unchecked-multiply-int - unchecked-negate - unchecked-negate-int - unchecked-remainder-int - unchecked-short - unchecked-subtract - unchecked-subtract-int))) - - ("Strings" - ("Create" - (clojure.core str format)) - ("Use" - (clojure.core count get subs compare) - (clojure.string join escape split split-lines replace replace-first reverse re-quote-replacement index-of last-index-of starts-with? ends-with? includes?)) - ("Regex" - (clojure.core re-find re-seq re-matches re-pattern re-matcher re-groups) - (clojure.string replace replace-first re-quote-replacement)) - ("Letters" - (clojure.string capitalize lower-case upper-case)) - ("Trim" - (clojure.string trim trim-newline triml trimr)) - ("Test" - (clojure.core char char? string?) - (clojure.string blank?))) - - ("Other" - ("Characters" - (clojure.core char char-name-string char-escape-string)) - ("Keywords" - (clojure.core keyword keyword? find-keyword)) - ("Symbols" - (clojure.core symbol symbol? gensym)) - ("Data Readers" - (clojure.core *data-readers* default-data-readers *default-data-reader-fn*)))) - - ("Collections" - ("Generic Ops" - (clojure.core count bounded-count empty not-empty into conj)) - ("Tree Walking" - (clojure.walk walk prewalk prewalk-demo prewalk-replace postwalk postwalk-demo postwalk-replace keywordize-keys stringify-keys)) - ("Content tests" - (clojure.core distinct? empty? every? not-every? some not-any?)) - ("Capabilities" - (clojure.core sequential? associative? sorted? counted? reversible?)) - ("Type tests" - (clojure.core type class coll? list? vector? set? map? seq? - number? integer? float? decimal? class? rational? ratio? - chunked-seq? reduced? special-symbol? record?)) - ("Lists" - ("Create" - (clojure.core list list*)) - ("Examine" - (clojure.core first nth peek)) - ("Change" - (clojure.core cons conj rest pop))) - - ("Vectors" - ("Create" - (clojure.core vec vector vector-of)) - ("Examine" - (clojure.core get peek)) - - ("Change" - (clojure.core assoc pop subvec replace conj rseq)) - ("Ops" - (clojure.core mapv filterv reduce-kv))) - - ("Sets" - ("Create" - (clojure.core set hash-set sorted-set sorted-set-by)) - ("Examine" - (clojure.core get contains?)) - ("Change" - (clojure.core conj disj)) - ("Relational Algebra" - (clojure.set join select project union difference intersection)) - ("Get map" - (clojure.set index rename-keys rename map-invert)) - ("Test" - (clojure.set subset? superset?)) - ("Sorted Sets" - (clojure.core rseq subseq rsubseq))) - - ("Maps" - ("Create" - (clojure.core hash-map array-map zipmap sorted-map sorted-map-by bean frequencies group-by)) - ("Examine" - (clojure.core get get-in contains? find keys vals map-entry?)) - ("Change" - (clojure.core assoc assoc-in dissoc merge merge-with select-keys update update-in)) - ("Entry" - (clojure.core key val)) - ("Sorted Maps" - (clojure.core rseq subseq rsubseq))) - - ("Hashes" - (clojure.core hash hash-ordered-coll hash-unordered-coll mix-collection-hash)) - - ("Volatiles" - (clojure.core volatile! volatile? vreset! vswap!))) - - ("Functions" - ("Create" - (clojure.core fn defn defn- definline identity constantly comp complement partial juxt memfn memoize fnil every-pred some-fn trampoline)) - ("Call" - (clojure.core -> ->> some-> some->> as-> cond-> cond->>)) - ("Test" - (clojure.core fn? ifn?))) - - ("Transducers" - ("Create" - (clojure.core cat dedupe distinct drop drop-while filter halt-when interpose keep keep-indexed map map-indexed mapcat partition-all partition-by random-sample remove replace take take-nth take-while)) - ("Call" - (clojure.core ->Eduction eduction into sequence transduce completing run!)) - ("Early Termination" - (clojure.core deref reduced reduced? ensure-reduced unreduced))) - - ("Spec" - ("Operations" - (clojure.spec.alpha valid? conform unform explain explain-data explain-str explain-out form describe assert check-asserts check-asserts?)) - ("Generator Ops" - (clojure.spec.alpha gen exercise exercise-fn)) - ("Defn & Registry" - (clojure.spec.alpha def fdef registry get-spec spec? spec with-gen)) - ("Logical" - (clojure.spec.alpha and or)) - ("Collection" - (clojure.spec.alpha coll-of map-of every every-kv keys merge)) - ("Regex " - (clojure.spec.alpha cat alt * + \? & keys*)) - ("Range" - (clojure.spec.alpha int-in inst-in double-in int-in-range? inst-in-range?)) - ("Custom Explain" - (clojure.spec.alpha explain-printer *explain-out*)) - ("Other" - (clojure.spec.alpha nilable multi-spec fspec conformer)) - - ("Predicates with test.check generators" - ("Numbers" - (clojure.core number? rational? integer? ratio? decimal? float? zero? double? int? nat-int? neg-int? pos-int?)) - ("Symbols & Keywords" - (clojure.core keyword? symbol? ident? qualified-ident? qualified-keyword? qualified-symbol? simple-ident? simple-keyword? simple-symbol?)) - ("Scalars" - (clojure.core string? true? false? nil? some? boolean? bytes? inst? uri? uuid?)) - ("Collections" - (clojure.core list? map? set? vector? associative? coll? sequential? seq? empty? indexed? seqable?)) - ("Other" - (clojure.core any?)))) - - ("Other" - ("XML" - (clojure.core xml-seq) - (clojure.xml parse)) - ("REPL" - (clojure.core *1 *2 *3 *e *print-dup* *print-length* *print-level* *print-meta* *print-readably*)) - ("EDN" - (clojure.edn read read-string)) - ("Compiling Code & Class Generation" - (clojure.core *compile-files* *compile-path* *file* *warn-on-reflection* compile gen-class gen-interface loaded-libs test)) - ("Misc" - (clojure.core eval force name *clojure-version* clojure-version *command-line-args*)) - ("Pretty Printing" - (clojure.pprint pprint print-table pp *print-right-margin*)) - ("Browser / Shell" - (clojure.java.browse browse-url) - (clojure.java.shell sh with-sh-dir with-sh-env))) - - ("Vars & Global Environment" - ("Def Variants" - (:special def) - (clojure.core defn defn- definline defmacro defmethod defmulti defonce defrecord)) - ("Interned Vars" - (:special var) - (clojure.core declare intern binding find-var)) - ("Var Objects" - (clojure.core with-local-vars var-get var-set alter-var-root var?)) - ("Var Validators" - (clojure.core set-validator! get-validator))) - - ("Reader Conditionals" - (clojure.core reader-conditional reader-conditional? tagged-literal tagged-literal?)) - - ("Abstractions" - ("Protocols" - (clojure.core defprotocol extend extend-type extend-protocol reify extends? satisfies? extenders)) - ("Records & Types" - (clojure.core defrecord deftype)) - ("Multimethods" - ("Define" - (clojure.core defmulti defmethod)) - ("Dispatch" - (clojure.core get-method methods)) - ("Remove" - (clojure.core remove-method remove-all-methods)) - ("Prefer" - (clojure.core prefer-method prefers)) - ("Relation" - (clojure.core derive isa? parents ancestors descendants make-hierarchy)))) - - ("Macros" - ("Create" - (clojure.core defmacro definline)) - ("Debug" - (clojure.core macroexpand-1 macroexpand) - (clojure.walk macroexpand-all)) - ("Branch" - (clojure.core and or when when-not when-let when-first if-not if-let cond condp case)) - ("Loop" - (clojure.core for doseq dotimes while)) - ("Arrange" - (clojure.core .. doto ->)) - ("Scope" - (clojure.core binding locking time) - (clojure.core with-in-str with-local-vars with-open with-out-str with-precision with-redefs with-redefs-fn)) - ("Lazy" - (clojure.core lazy-cat lazy-seq delay delay?)) - ("Doc" - (clojure.core assert comment) - (clojure.repl doc dir dir-fn source-fn))) - - ("Java Interop" - ("General" - (:special new set!) - (clojure.core .. doto bean comparator enumeration-seq import iterator-seq memfn definterface supers bases)) - ("Cast" - (clojure.core boolean byte short char int long float double bigdec bigint num cast biginteger)) - ("Exceptions" - (:special throw try catch finally) - (clojure.core ex-info ex-data Throwable->map StackTraceElement->vec) - (clojure.repl pst)) - ("Arrays" - ("Create" - (clojure.core boolean-array byte-array double-array char-array float-array int-array long-array make-array object-array short-array to-array)) - ("Manipulate" - (clojure.core aclone aget aset alength amap areduce aset-int aset-long aset-short aset-boolean aset-byte aset-char aset-double aset-float)) - ("Cast" - (clojure.core booleans bytes chars doubles floats ints longs shorts))) - ("Proxy" - ("Create" - (clojure.core proxy get-proxy-class construct-proxy init-proxy)) - ("Misc" - (clojure.core proxy-mappings proxy-super update-proxy)))) - - ("Namespaces" - ("Current" - (clojure.core *ns*)) - ("Create Switch" - (clojure.core ns in-ns create-ns)) - ("Add" - (clojure.core alias import intern refer refer-clojure)) - ("Find" - (clojure.core all-ns find-ns)) - ("Examine" - (clojure.core ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers)) - ("From symbol" - (clojure.core resolve namespace ns-resolve the-ns)) - ("Remove" - (clojure.core ns-unalias ns-unmap remove-ns))) - ("Loading" - ("Load libs" - (clojure.core require use import refer)) - ("List Loaded" - (clojure.core loaded-libs)) - ("Load Misc" - (clojure.core load load-file load-reader load-string))) - - ("Concurrency" - ("Atoms" - (clojure.core atom swap! swap-vals! reset! reset-vals! compare-and-set!)) - ("Futures" - (clojure.core future future-call future-cancel future-cancelled? future-done? future?)) - ("Threads" - (clojure.core bound-fn bound-fn* get-thread-bindings pop-thread-bindings push-thread-bindings)) - - ("Misc" - (clojure.core locking pcalls pvalues pmap seque promise deliver)) - - ("Refs & Transactions" - ("Create" - (clojure.core ref)) - ("Examine" - (clojure.core deref)) - ("Transaction" - (clojure.core sync dosync io!)) - ("In Transaction" - (clojure.core ensure ref-set alter commute)) - ("Validators" - (clojure.core get-validator set-validator!)) - ("History" - (clojure.core ref-history-count ref-max-history ref-min-history))) - - ("Agents & Asynchronous Actions" - ("Create" - (clojure.core agent)) - ("Examine" - (clojure.core agent-error)) - ("Change State" - (clojure.core send send-off restart-agent send-via set-agent-send-executor! set-agent-send-off-executor!)) - ("Block Waiting" - (clojure.core await await-for)) - ("Ref Validators" - (clojure.core get-validator set-validator!)) - ("Watchers" - (clojure.core add-watch remove-watch)) - ("Thread Handling" - (clojure.core shutdown-agents)) - ("Error" - (clojure.core error-handler set-error-handler! error-mode set-error-mode!)) - ("Misc" - (clojure.core *agent* release-pending-sends)))) - - ("Sequences" - ("Creating a Lazy Seq" - ("From Collection" - (clojure.core seq sequence keys vals rseq subseq rsubseq)) - ("From Producer Fn" - (clojure.core lazy-seq repeatedly iterate)) - ("From Constant" - (clojure.core repeat range)) - ("From Other" - (clojure.core file-seq line-seq resultset-seq re-seq tree-seq xml-seq iterator-seq enumeration-seq)) - ("From Seq" - (clojure.core keep keep-indexed))) - - ("Seq in, Seq out" - ("Get shorter" - (clojure.core distinct dedupe filter remove for)) - ("Get longer" - (clojure.core cons conj concat lazy-cat mapcat cycle interleave interpose))) - ("Tail-items" - (clojure.core rest nthrest fnext nnext drop drop-while take-last for)) - ("Head-items" - (clojure.core take take-nth take-while butlast drop-last for)) - ("Change" - (clojure.core conj concat distinct flatten group-by partition partition-all partition-by split-at split-with filter remove replace shuffle random-sample)) - ("Rearrange" - (clojure.core reverse sort sort-by compare)) - ("Process items" - (clojure.core map pmap map-indexed mapcat for replace seque)) - - ("Using a Seq" - ("Extract item" - (clojure.core first second last rest next ffirst nfirst fnext nnext nth nthnext rand-nth when-first max-key min-key)) - ("Construct coll" - (clojure.core zipmap into reduce reductions set vec into-array to-array-2d)) - ("Pass to fn" - (clojure.core apply)) - ("Search" - (clojure.core some filter)) - ("Force evaluation" - (clojure.core doseq dorun doall)) - ("Check for forced" - (clojure.core realized?)))) - - ("Zippers" - ("Create" - (clojure.zip zipper seq-zip vector-zip xml-zip)) - ("Get loc" - (clojure.zip up down left right leftmost rightmost)) - ("Get seq" - (clojure.zip lefts rights path children)) - ("Change" - (clojure.zip make-node replace edit insert-child insert-left insert-right append-child remove)) - ("Move" - (clojure.zip next prev)) - ("XML" - (clojure.data.zip.xml attr attr= seq-test tag= text text= xml-> xml1->)) - ("Misc" - (clojure.zip root node branch? end?))) - - ("Documentation" - ("REPL" - (clojure.repl doc find-doc apropos source pst) - (clojure.java.javadoc javadoc))) - - ("Transients" - ("Create" - (clojure.core transient persistent!)) - ("Change" - (clojure.core conj! pop! assoc! dissoc! disj!))) - ("Misc" - ("Compare" - (clojure.core = == identical? not= not compare) - (clojure.data diff)) - ("Test" - (clojure.core true? false? nil? instance?))) - - ("IO" - ("To/from ..." - (clojure.core spit slurp)) - ("To *out*" - (clojure.core pr prn print printf println newline) - (clojure.pprint print-table)) - ("To writer" - (clojure.pprint pprint cl-format)) - ("To string" - (clojure.core format with-out-str pr-str prn-str print-str println-str)) - ("From *in*" - (clojure.core read-line read)) - ("From reader" - (clojure.core line-seq read)) - ("From string" - (clojure.core read-string with-in-str)) - ("Open" - (clojure.core with-open) - (clojure.java.io reader writer input-stream output-stream)) - ("Interop" - (clojure.java.io make-writer make-reader make-output-stream make-input-stream)) - ("Misc" - (clojure.core flush file-seq *in* *out* *err*) - (clojure.java.io file copy delete-file resource as-file as-url as-relative-path make-parents))) - - ("Metadata" - (clojure.core meta with-meta alter-meta! reset-meta! vary-meta)) - - ("Special Forms" - (:special def if do quote var recur throw try monitor-enter monitor-exit) - (clojure.core fn loop) - ("Binding / Destructuring" - (clojure.core let fn letfn defn defmacro loop for doseq if-let if-some when-let when-some))) - - ("Async" - ("Main" - (clojure.core.async go go-loop <! <!! >! >!! chan put! take take! close! timeout offer! poll! promise-chan)) - ("Choice" - (clojure.core.async alt! alt!! alts! alts!! do-alts)) - ("Buffering" - (clojure.core.async buffer dropping-buffer sliding-buffer unblocking-buffer?)) - ("Pipelines" - (clojure.core.async pipeline pipeline-async pipeline-blocking)) - ("Threading" - (clojure.core.async thread thread-call)) - ("Mixing" - (clojure.core.async admix solo-mode mix unmix unmix-all toggle merge pipe unique)) - ("Multiples" - (clojure.core.async mult tap untap untap-all)) - ("Publish/Subscribe" - (clojure.core.async pub sub unsub unsub-all)) - ("Higher Order" - (clojure.core.async filter< filter> map map< map> mapcat< mapcat> partition partition-by reduce remove< remove> split)) - ("Pre-Populate" - (clojure.core.async into onto-chan to-chan))) - ("Unit Tests" - ("Defining" - (clojure.test deftest deftest- testing is are)) - ("Running" - (clojure.test run-tests run-all-tests test-vars)) - ("Fixtures" - (clojure.test use-fixtures join-fixtures compose-fixtures)))) - "A data structure for Clojure cheatsheet information. - -It's a tree, where the head of each list determines the context of the rest -of the list. The head may be: - - - A string, in which case it's a (sub)heading for the rest of the items. - - - A symbol, in which case it's the Clojure namespace of the symbols that - follow it. - - - The keyword :special, in which case it's a Clojure special form - - - Any other keyword, in which case it's a typed item that will be passed - through. - -Note that some Clojure symbols appear in more than once. This is entirely -intentional. For instance, `map` belongs in the sections on collections -and transducers.") - -(defun cider-cheatsheet--expand-vars (list) - "Expand the symbols in LIST to fully-qualified var names. - -This list is supposed to have the following format: - - (my-ns var1 var2 var3)" - (let ((ns (car list)) - (vars (cdr list))) - (if (eq ns :special) - (mapcar #'symbol-name vars) - (mapcar (lambda (var) (format "%s/%s" ns var)) vars)))) - -(defun cider-cheatsheet--select-var (var-list) - "Expand the symbols in VAR-LIST to fully-qualified var names. - -The list can hold one or more lists inside - one per each namespace." - (let ((namespaced-vars (seq-mapcat #'cider-cheatsheet--expand-vars - (seq-remove (lambda (list) - (eq (car list) :url)) - var-list)))) - (cider-doc-lookup (completing-read "Select var: " namespaced-vars)))) - -;;;###autoload -(defun cider-cheatsheet () - "Navigate `cider-cheatsheet-hierarchy' with `completing-read'. - -When you make it to a Clojure var its doc buffer gets displayed." - (interactive) - (let ((cheatsheet-data cider-cheatsheet-hierarchy)) - (while (stringp (caar cheatsheet-data)) - (let* ((sections (mapcar #'car cheatsheet-data)) - (sel-section (completing-read "Select cheatsheet section: " sections)) - (section-data (seq-find (lambda (elem) (equal (car elem) sel-section)) cheatsheet-data))) - (setq cheatsheet-data (cdr section-data)))) - (cider-cheatsheet--select-var cheatsheet-data))) - -(provide 'cider-cheatsheet) - -;;; cider-cheatsheet.el ends here diff --git a/elpa/cider-1.12.0/cider-classpath.el b/elpa/cider-1.12.0/cider-classpath.el @@ -1,109 +0,0 @@ -;;; cider-classpath.el --- Basic Java classpath browser -*- lexical-binding: t; -*- - -;; Copyright © 2014-2023 Bozhidar Batsov and CIDER contributors - -;; This program is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see <http://www.gnu.org/licenses/>. - -;; This file is not part of GNU Emacs. - -;;; Commentary: - -;; Basic Java classpath browser for CIDER. - -;;; Code: - -(require 'cider-client) -(require 'cider-popup) -(require 'subr-x) - -(defvar cider-classpath-buffer "*cider-classpath*") - -(defvar cider-classpath-mode-map - (let ((map (make-sparse-keymap))) - (set-keymap-parent map cider-popup-buffer-mode-map) - (define-key map (kbd "RET") #'cider-classpath-operate-on-point) - (define-key map "n" #'next-line) - (define-key map "p" #'previous-line) - map)) - -(defvar cider-classpath-mouse-map - (let ((map (make-sparse-keymap))) - (define-key map [mouse-1] #'cider-classpath-handle-mouse) - map)) - -(define-derived-mode cider-classpath-mode special-mode "classpath" - "Major mode for browsing the entries in Java's classpath. - -\\{cider-classpath-mode-map}" - (setq-local electric-indent-chars nil) - (setq-local sesman-system 'CIDER) - (when cider-special-mode-truncate-lines - (setq-local truncate-lines t))) - -(defun cider-classpath-list (buffer items) - "Populate BUFFER with ITEMS." - (with-current-buffer buffer - (cider-classpath-mode) - (let ((inhibit-read-only t)) - (erase-buffer) - (dolist (item items) - (insert item "\n")) - (goto-char (point-min))))) - -(defun cider-classpath-properties (text) - "Decorate TEXT with a clickable keymap and function face." - (let ((face (cond - ((not (file-exists-p text)) 'font-lock-warning-face) - ((file-directory-p text) 'dired-directory) - (t 'default)))) - (propertize text - 'font-lock-face face - 'mouse-face 'highlight - 'keymap cider-classpath-mouse-map))) - -(defun cider-classpath-operate-on-point () - "Expand browser according to thing at current point." - (interactive) - (let* ((bol (line-beginning-position)) - (eol (line-end-position)) - (line (buffer-substring-no-properties bol eol))) - (find-file-other-window line))) - -(defun cider-classpath-handle-mouse (_event) - "Handle mouse click EVENT." - (interactive "e") - (cider-classpath-operate-on-point)) - -;;;###autoload -(defun cider-classpath () - "List all classpath entries." - (interactive) - (cider-ensure-connected) - (with-current-buffer (cider-popup-buffer cider-classpath-buffer 'select nil 'ancillary) - (cider-classpath-list (current-buffer) - (mapcar (lambda (name) - (cider-classpath-properties name)) - (cider-classpath-entries))))) - -;;;###autoload -(defun cider-open-classpath-entry () - "Open a classpath entry." - (interactive) - (cider-ensure-connected) - (when-let* ((entry (completing-read "Classpath entries: " (cider-classpath-entries)))) - (find-file-other-window entry))) - -(provide 'cider-classpath) - -;;; cider-classpath.el ends here diff --git a/elpa/cider-1.12.0/cider-client.el b/elpa/cider-1.12.0/cider-client.el @@ -1,904 +0,0 @@ -;;; cider-client.el --- A layer of abstraction above low-level nREPL client code. -*- lexical-binding: t -*- - -;; Copyright © 2013-2023 Bozhidar Batsov -;; -;; Author: Bozhidar Batsov <bozhidar@batsov.dev> - -;; This program is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see <http://www.gnu.org/licenses/>. - -;; This file is not part of GNU Emacs. - -;;; Commentary: - -;; A layer of abstraction above the low-level nREPL client code. - -;;; Code: - -(require 'map) -(require 'seq) -(require 'subr-x) -(require 'parseedn) - -(require 'clojure-mode) -(require 'spinner) - -(require 'cider-connection) -(require 'cider-completion-context) -(require 'cider-common) -(require 'cider-util) -(require 'nrepl-client) - - -;;; Eval spinner -(defcustom cider-eval-spinner-type 'progress-bar - "Appearance of the evaluation spinner. - -Value is a symbol. The possible values are the symbols in the -`spinner-types' variable." - :type 'symbol - :group 'cider - :package-version '(cider . "0.10.0")) - -(defcustom cider-show-eval-spinner t - "When true, show the evaluation spinner in the mode line." - :type 'boolean - :group 'cider - :package-version '(cider . "0.10.0")) - -(defcustom cider-eval-spinner-delay 1 - "Amount of time, in seconds, after which the evaluation spinner will be shown." - :type 'integer - :group 'cider - :package-version '(cider . "0.10.0")) - -(defcustom cider-enhanced-cljs-completion-p t - "This setting enables dynamic cljs completions. -That is, expressions at point are evaluated and the properties of the -resulting value are used to compute completions." - :type 'boolean - :group 'cider - :package-version '(cider . "0.23.0")) - -(defcustom cider-before-eval-hook nil - "List of functions to call before eval request is sent to nrepl." - :type 'hook - :group 'cider - :package-version '(cider . "1.2.0")) - -(defcustom cider-after-eval-done-hook nil - "List of functions to call after eval was responded by nrepl with done status." - :type 'hook - :group 'cider - :package-version '(cider . "1.2.0")) - -(defun cider-spinner-start (buffer) - "Start the evaluation spinner in BUFFER. -Do nothing if `cider-show-eval-spinner' is nil." - (when cider-show-eval-spinner - (with-current-buffer buffer - (spinner-start cider-eval-spinner-type nil - cider-eval-spinner-delay)))) - -(defun cider-eval-spinner (eval-buffer response) - "Handle RESPONSE stopping the spinner. -EVAL-BUFFER is the buffer where the spinner was started." - ;; buffer still exists and - ;; we've got status "done" from nrepl - ;; stop the spinner - (when (and (buffer-live-p eval-buffer) - (let ((status (nrepl-dict-get response "status"))) - (or (member "done" status) - (member "eval-error" status) - (member "error" status)))) - (with-current-buffer eval-buffer - (when spinner-current (spinner-stop))))) - - -;;; Evaluation helpers -(defun cider-ns-form-p (form) - "Check if FORM is an ns form." - (string-match-p "^[[:space:]]*\(ns\\([[:space:]]*$\\|[[:space:]]+\\)" form)) - -(defun cider-ns-from-form (ns-form) - "Get ns substring from NS-FORM." - (when (string-match "^[ \t\n]*\(ns[ \t\n]+\\([^][ \t\n(){}]+\\)" ns-form) - (match-string-no-properties 1 ns-form))) - -(defvar-local cider-buffer-ns nil - "Current Clojure namespace of some buffer. -Useful for special buffers (e.g. REPL, doc buffers) that have to keep track -of a namespace. This should never be set in Clojure buffers, as there the -namespace should be extracted from the buffer's ns form.") - -(defun cider-current-ns (&optional no-default no-repl-check) - "Return the current ns. -The ns is extracted from the ns form for Clojure buffers and from -`cider-buffer-ns' for all other buffers. If it's missing, use the current -REPL's ns, otherwise fall back to \"user\". -When NO-DEFAULT is non-nil, it will return nil instead of \"user\". -When NO-REPL-CHECK is non-nil, `cider-current-repl' will not be queried, -improving performance (at the possible cost of accuracy)." - (or cider-buffer-ns - (cider-get-ns-name) - (unless no-repl-check - (when-let* ((repl (cider-current-repl))) - (buffer-local-value 'cider-buffer-ns repl))) - (if no-default nil "user"))) - -(defun cider-path-to-ns (relpath) - "Transform RELPATH to Clojure namespace. -Remove extension and substitute \"/\" with \".\", \"_\" with \"-\"." - (thread-last - relpath - (file-name-sans-extension) - (replace-regexp-in-string "/" ".") - (replace-regexp-in-string "_" "-"))) - -(defun cider-expected-ns (&optional path) - "Return the namespace string matching PATH, or nil if not found. -If PATH is nil, use the path to the file backing the current buffer. The -command falls back to `clojure-expected-ns' in the absence of an active -nREPL connection." - (if (cider-connected-p) - (let* ((path (file-truename (or path buffer-file-name))) - (relpath (thread-last - (cider-classpath-entries) - (seq-filter #'file-directory-p) - (seq-map (lambda (dir) - (when (file-in-directory-p path dir) - (file-relative-name path dir)))) - (seq-filter #'identity) - (seq-sort (lambda (a b) - (< (length a) (length b)))) - (car)))) - (if relpath - (cider-path-to-ns relpath) - (clojure-expected-ns path))) - (clojure-expected-ns path))) - -(defun cider-nrepl-op-supported-p (op &optional connection skip-ensure) - "Check whether the CONNECTION supports the nREPL middleware OP. -Skip check if repl is active if SKIP-ENSURE is non nil." - (nrepl-op-supported-p op (or connection (cider-current-repl nil (if skip-ensure - nil - 'ensure))))) - -(defun cider-ensure-op-supported (op) - "Check for support of middleware op OP. -Signal an error if it is not supported." - (unless (cider-nrepl-op-supported-p op) - (user-error "`%s' requires the nREPL op \"%s\" (provided by cider-nrepl)" this-command op))) - -(defun cider-nrepl-send-request (request callback &optional connection tooling) - "Send REQUEST and register response handler CALLBACK. -REQUEST is a pair list of the form (\"op\" \"operation\" \"par1-name\" - \"par1\" ... ). -If CONNECTION is provided dispatch to that connection instead of -the current connection. Return the id of the sent message. -If TOOLING is truthy then the tooling session is used." - (nrepl-send-request request callback (or connection (cider-current-repl 'any 'ensure)) tooling)) - -(defun cider-nrepl-send-sync-request (request &optional connection abort-on-input) - "Send REQUEST to the nREPL server synchronously using CONNECTION. -Hold till final \"done\" message has arrived and join all response messages -of the same \"op\" that came along and return the accumulated response. -If ABORT-ON-INPUT is non-nil, the function will return nil -at the first sign of user input, so as not to hang the -interface." - (nrepl-send-sync-request request - (or connection (cider-current-repl 'any 'ensure)) - abort-on-input)) - -(defun cider-nrepl-send-unhandled-request (request &optional connection) - "Send REQUEST to the nREPL CONNECTION and ignore any responses. -Immediately mark the REQUEST as done. Return the id of the sent message." - (let* ((conn (or connection (cider-current-repl 'any 'ensure))) - (id (nrepl-send-request request #'ignore conn))) - (with-current-buffer conn - (nrepl--mark-id-completed id)) - id)) - -(defun cider-nrepl-request:eval (input callback &optional ns line column additional-params connection) - "Send the request INPUT and register the CALLBACK as the response handler. -If NS is non-nil, include it in the request. LINE and COLUMN, if non-nil, -define the position of INPUT in its buffer. ADDITIONAL-PARAMS is a plist -to be appended to the request message. CONNECTION is the connection -buffer, defaults to (cider-current-repl)." - (let ((connection (or connection (cider-current-repl nil 'ensure))) - (eval-buffer (current-buffer))) - (run-hooks 'cider-before-eval-hook) - (nrepl-request:eval input - (lambda (response) - (when cider-show-eval-spinner - (cider-eval-spinner connection response)) - (when (and (buffer-live-p eval-buffer) - (member "done" (nrepl-dict-get response "status"))) - (with-current-buffer eval-buffer - (run-hooks 'cider-after-eval-done-hook))) - (funcall callback response)) - connection - ns line column additional-params) - (cider-spinner-start connection))) - -(defun cider-nrepl-sync-request:eval (input &optional connection ns) - "Send the INPUT to the nREPL CONNECTION synchronously. -If NS is non-nil, include it in the eval request." - (nrepl-sync-request:eval input (or connection (cider-current-repl nil 'ensure)) ns)) - -(defcustom cider-format-code-options nil - "A map of options that will be passed to `cljfmt' to format code. -Assuming this is the Clojure map you want to use as `cljfmt' options: - - {:indents {org.me/foo [[:inner 0]]} - :alias-map {\"me\" \"org.me\"}} - -you need to encode it as the following plist: - - '((\"indents\" ((\"org.me/foo\" ((\"inner\" 0))))) (\"alias-map\" ((\"me\" \"org.me\"))))" - :type 'list - :group 'cider - :package-version '(cider . "1.1.0")) - -(defun cider--nrepl-format-code-request-map (&optional format-options) - "Map to merge into requests that require code formatting. -If non-nil, FORMAT-OPTIONS specifies the options cljfmt will use to format -the code. See `cider-format-code-options` for details." - (when format-options - (let* ((indents-dict (when (assoc "indents" format-options) - (thread-last - (cadr (assoc "indents" format-options)) - (map-pairs) - (seq-mapcat #'identity) - (apply #'nrepl-dict)))) - (alias-map-dict (when (assoc "alias-map" format-options) - (thread-last - (cadr (assoc "alias-map" format-options)) - (map-pairs) - (seq-mapcat #'identity) - (apply #'nrepl-dict))))) - (thread-last - (map-merge 'list - (when indents-dict - `(("indents" ,indents-dict))) - (when alias-map-dict - `(("alias-map" ,alias-map-dict)))) - (map-pairs) - (seq-mapcat #'identity) - (apply #'nrepl-dict))))) - -(defcustom cider-print-fn 'pprint - "Sets the function to use for printing. - -nil – to defer to nREPL to choose the printing function. This will use -the bound value of \\=`nrepl.middleware.print/*print-fn*\\=`, which -defaults to the equivalent of \\=`clojure.core/pr\\=`. - -`pr' – to use the equivalent of \\=`clojure.core/pr\\=`. - -`pprint' – to use \\=`clojure.pprint/pprint\\=` (this is the default). - -`fipp' – to use the Fast Idiomatic Pretty Printer, approximately 5-10x -faster than \\=`clojure.core/pprint\\=`. - -`puget' – to use Puget, which provides canonical serialization of data on -top of fipp, but at a slight performance cost. - -`zprint' – to use zprint, a fast and flexible alternative to the libraries -mentioned above. - -Alternatively can be the namespace-qualified name of a Clojure var whose -function takes three arguments: the object to print, the -\\=`java.io.PrintWriter\\=` to print on, and a (possibly nil) map of -options. If the function cannot be resolved, will behave as if set to -nil." - :type '(choice (const nil) - (const pr) - (const pprint) - (const fipp) - (const puget) - (const zprint) - string) - :group 'cider - :package-version '(cider . "0.21.0")) - -(defcustom cider-print-options nil - "A map of options that will be passed to `cider-print-fn'. -Here's an example for `pprint': - - '((\"length\" 50) (\"right-margin\" 70))" - :type 'list - :group 'cider - :package-version '(cider . "0.21.0")) - -(make-obsolete-variable 'cider-pprint-fn 'cider-print-fn "0.21") -(make-obsolete-variable 'cider-pprint-options 'cider-print-options "0.21") - -(defcustom cider-print-quota (* 1024 1024) - "A hard limit on the number of bytes to return from any printing operation. -Set to nil for no limit." - :type 'integer - :group 'cider - :package-version '(cider . "0.21.0")) - -(defcustom cider-print-buffer-size (* 4 1024) - "The size in bytes of each value/output chunk when using print streaming. -Smaller values mean smaller data chunks and faster feedback, but they also mean -smaller results that can be font-locked as Clojure in the REPL buffers, as only -a single chunk result can be font-locked. - -The default value in nREPL is 1024." - :type 'integer - :group 'cider - :package-version '(cider . "0.25.0")) - -(defun cider--print-fn () - "Return the value to send in the nrepl.middleware.print/print slot." - (pcase cider-print-fn - (`pr "cider.nrepl.pprint/pr") - (`pprint "cider.nrepl.pprint/pprint") - (`fipp "cider.nrepl.pprint/fipp-pprint") - (`puget "cider.nrepl.pprint/puget-pprint") - (`zprint "cider.nrepl.pprint/zprint-pprint") - (_ cider-print-fn))) - -(defvar cider--print-options-mapping - '((right-margin - ((fipp . width) (puget . width) (zprint . width))) - (length - ((fipp . print-length) (puget . print-length) (zprint . max-length))) - (level - ((fipp . print-level) (puget . print-level) (zprint . max-depth)))) - "A mapping of print option for the various supported print engines.") - -(defun cider--print-option (name printer) - "Convert the generic NAME to its PRINTER specific variant. -E.g. pprint's right-margin would become width for fipp. -The function is useful when you want to generate dynamically -print options. - -NAME can be a string or a symbol. PRINTER has to be a symbol. -The result will be a string." - (let* ((name (cider-maybe-intern name)) - (result (cdr (assoc printer (cadr (assoc name cider--print-options-mapping)))))) - (symbol-name (or result name)))) - -(defun cider--nrepl-print-request-map (&optional right-margin) - "Map to merge into requests that require pretty-printing. -RIGHT-MARGIN specifies the maximum column-width of the printed result, and -is included in the request if non-nil." - (let* ((width-option (cider--print-option "right-margin" cider-print-fn)) - (print-options (thread-last - (map-merge 'hash-table - `((,width-option ,right-margin)) - cider-print-options) - (map-pairs) - (seq-mapcat #'identity) - (apply #'nrepl-dict)))) - (map-merge 'list - `(("nrepl.middleware.print/stream?" "1")) - (when cider-print-fn - `(("nrepl.middleware.print/print" ,(cider--print-fn)))) - (when cider-print-quota - `(("nrepl.middleware.print/quota" ,cider-print-quota))) - (when cider-print-buffer-size - `(("nrepl.middleware.print/buffer-size" ,cider-print-buffer-size))) - (unless (nrepl-dict-empty-p print-options) - `(("nrepl.middleware.print/options" ,print-options)))))) - -(defun cider--nrepl-pr-request-map () - "Map to merge into requests that do not require pretty printing." - (let ((print-options (thread-last - cider-print-options - (map-pairs) - (seq-mapcat #'identity) - (apply #'nrepl-dict)))) - (map-merge 'list - `(("nrepl.middleware.print/print" "cider.nrepl.pprint/pr") - ("nrepl.middleware.print/stream?" nil)) - (unless (nrepl-dict-empty-p print-options) - `(("nrepl.middleware.print/options" ,print-options))) - (when cider-print-quota - `(("nrepl.middleware.print/quota" ,cider-print-quota)))))) - -(defun cider--nrepl-content-type-map () - "Map to be merged into an eval request to make it use content-types." - '(("content-type" "true"))) - -(defun cider-tooling-eval (input callback &optional ns connection) - "Send the request INPUT to CONNECTION and register the CALLBACK. -NS specifies the namespace in which to evaluate the request. Requests -evaluated in the tooling nREPL session don't affect the thread-local -bindings of the primary eval nREPL session (e.g. this is not going to -clobber *1/2/3)." - ;; namespace forms are always evaluated in the "user" namespace - (nrepl-request:eval input - callback - (or connection (cider-current-repl nil 'ensure)) - ns nil nil nil 'tooling)) - -(defun cider-sync-tooling-eval (input &optional ns connection) - "Send the request INPUT to CONNECTION and evaluate in synchronously. -NS specifies the namespace in which to evaluate the request. Requests -evaluated in the tooling nREPL session don't affect the thread-local -bindings of the primary eval nREPL session (e.g. this is not going to -clobber *1/2/3)." - ;; namespace forms are always evaluated in the "user" namespace - (nrepl-sync-request:eval input - (or connection (cider-current-repl nil 'ensure)) - ns - 'tooling)) - -(defun cider-library-present-p (lib-ns) - "Check whether LIB-NS is present. -If a certain well-known ns in a library is present we assume that library -itself is present." - (nrepl-dict-get (cider-sync-tooling-eval (format "(require '%s)" lib-ns)) "value")) - - -;;; Interrupt evaluation - -(defun cider-interrupt-handler (buffer) - "Create an interrupt response handler for BUFFER." - (nrepl-make-response-handler buffer nil nil nil nil)) - -(defun cider-interrupt () - "Interrupt any pending evaluations." - (interactive) - ;; FIXME: does this work correctly in cljc files? - (with-current-buffer (cider-current-repl nil 'ensure) - (let ((pending-request-ids (cider-util--hash-keys nrepl-pending-requests))) - (dolist (request-id pending-request-ids) - (nrepl-request:interrupt - request-id - (cider-interrupt-handler (current-buffer)) - (cider-current-repl)))))) - -(defun cider-nrepl-eval-session () - "Return the eval nREPL session id of the current connection." - (with-current-buffer (cider-current-repl) - nrepl-session)) - -(defun cider-nrepl-tooling-session () - "Return the tooling nREPL session id of the current connection." - (with-current-buffer (cider-current-repl) - nrepl-tooling-session)) - -(declare-function ido-exit-minibuffer "ido" t) - -;; Not used anywhere, except in documentation as a suggestion for users. -(defmacro cider--with-temporary-ido-keys (UP DOWN &rest body) - "Temporarily define UP, DOWN keys for ido and execute BODY. - -This makes the UX for auto-completion more streamlined, -since one often wants to go to the next candidate (DOWN key) -without having to specify a Java class for the current candidate -\(because the current candidate may be irrelevant to the user)." - `(if (bound-and-true-p ido-common-completion-map) - (let ((original-up-binding (lookup-key ido-common-completion-map (kbd ,UP))) - (original-down-binding (lookup-key ido-common-completion-map (kbd ,DOWN)))) - (define-key ido-common-completion-map (kbd ,UP) (lambda () - (interactive) - (ido-exit-minibuffer))) - (define-key ido-common-completion-map (kbd ,DOWN) (lambda () - (interactive) - (ido-exit-minibuffer))) - (unwind-protect - (progn ,@body) - (define-key ido-common-completion-map (kbd ,UP) original-up-binding) - (define-key ido-common-completion-map (kbd ,DOWN) original-down-binding))) - ,@body)) - -(defun cider-class-choice-completing-read (prompt candidates) - "A completing read that can be customized with the `advice' mechanism, -forwarding PROMPT and CANDIDATES as-is. - -See also: `cider--with-temporary-ido-keys'." - (completing-read prompt candidates)) - -(defun cider--var-choice (var-info) - "Prompt to choose from among multiple VAR-INFO candidates, if required. -This is needed only when the symbol queried is an unqualified host platform -method, and multiple classes have a so-named member. If VAR-INFO does not -contain a `candidates' key, it is returned as is." - (let ((candidates (nrepl-dict-get var-info "candidates"))) - (if candidates - (let* ((classes (nrepl-dict-keys candidates)) - (choice (cider-class-choice-completing-read "Member in class: " classes)) - (info (nrepl-dict-get candidates choice))) - info) - var-info))) - -;; FIXME: Now that nREPL supports a lookup op natively, we should -;; remove this eval-based hack at some point. -(defconst cider-info-form " -(do - (require 'clojure.java.io) - (require 'clojure.walk) - - (if-let [var (resolve '%s)] - (let [info (meta var)] - (-> info - (update :ns str) - (update :name str) - (update :file (comp str clojure.java.io/resource)) - (cond-> (:macro info) (update :macro str)) - (cond-> (:special-form info) (update :special-form str)) - (cond-> (:protocol info) (update :protocol str)) - (cond-> (:arglists info) (update :arglists str)) - (assoc :arglists-str (str (:arglists info))) - (clojure.walk/stringify-keys))))) -") - -(defun cider-fallback-eval:info (var) - "Obtain VAR metadata via a regular eval. -Used only when the info nREPL middleware is not available." - (let* ((response (cider-sync-tooling-eval (format cider-info-form var))) - (var-info (nrepl-dict-from-hash (parseedn-read-str (nrepl-dict-get response "value"))))) - var-info)) - -(defun cider-var-info (var &optional all) - "Return VAR's info as an alist with list cdrs. -When multiple matching vars are returned you'll be prompted to select one, -unless ALL is truthy." - (when (and var (not (string= var ""))) - (let ((var-info (cond - ((cider-nrepl-op-supported-p "info") (cider-sync-request:info var nil nil (cider-completion-get-context t))) - ((cider-nrepl-op-supported-p "lookup") (cider-sync-request:lookup var)) - (t (cider-fallback-eval:info var))))) - (if all var-info (cider--var-choice var-info))))) - -(defun cider-member-info (class member) - "Return the CLASS MEMBER's info as an alist with list cdrs." - (when (and class member) - (cider-sync-request:info nil class member (cider-completion-get-context t)))) - - -;;; Requests - -(declare-function cider-load-file-handler "cider-eval") -(defun cider-request:load-file (file-contents file-path file-name &optional connection callback) - "Perform the nREPL \"load-file\" op. -FILE-CONTENTS, FILE-PATH and FILE-NAME are details of the file to be -loaded. If CONNECTION is nil, use `cider-current-repl'. If CALLBACK -is nil, use `cider-load-file-handler'." - (cider-nrepl-send-request `("op" "load-file" - "file" ,file-contents - "file-path" ,file-path - "file-name" ,file-name) - (or callback - (cider-load-file-handler (current-buffer))) - connection)) - - -;;; Sync Requests - -(defcustom cider-filtered-namespaces-regexps - '("^cider.nrepl" "^refactor-nrepl" "^nrepl") - "List of regexps used to filter out some vars/symbols/namespaces. -When nil, nothing is filtered out. Otherwise, all namespaces matching any -regexp from this list are dropped out of the \"ns-list\" op. Also, -\"apropos\" won't include vars from such namespaces. This list is passed -on to the nREPL middleware without any pre-processing. So the regexps have -to be in Clojure format (with twice the number of backslashes) and not -Emacs Lisp." - :type '(repeat string) - :safe #'listp - :group 'cider - :package-version '(cider . "0.13.0")) - -(defun cider-sync-request:apropos (query &optional search-ns docs-p privates-p case-sensitive-p) - "Send \"apropos\" request for regexp QUERY. - -Optional arguments include SEARCH-NS, DOCS-P, PRIVATES-P, CASE-SENSITIVE-P." - (let* ((query (replace-regexp-in-string "[ \t]+" ".+" query)) - (response (cider-nrepl-send-sync-request - `("op" "apropos" - "ns" ,(cider-current-ns) - "query" ,query - ,@(when search-ns `("search-ns" ,search-ns)) - ,@(when docs-p '("docs?" "t")) - ,@(when privates-p '("privates?" "t")) - ,@(when case-sensitive-p '("case-sensitive?" "t")) - "exclude-regexps" ,cider-filtered-namespaces-regexps)))) - (if (member "apropos-regexp-error" (nrepl-dict-get response "status")) - (user-error "Invalid regexp: %s" (nrepl-dict-get response "error-msg")) - (nrepl-dict-get response "apropos-matches")))) - -(defun cider-sync-request:classpath () - "Return a list of classpath entries." - (cider-ensure-op-supported "classpath") - (thread-first - '("op" "classpath") - (cider-nrepl-send-sync-request) - (nrepl-dict-get "classpath"))) - -(defun cider--get-abs-path (path project) - "Resolve PATH to an absolute path relative to PROJECT. -Do nothing if PATH is already absolute." - (if (not (file-name-absolute-p path)) - (expand-file-name path project) - path)) - -(defun cider-fallback-eval:classpath () - "Return a list of classpath entries using eval. - -Sometimes the classpath contains entries like src/main and we need to -resolve those to absolute paths." - (when (cider-runtime-clojure-p) - (let ((classpath (thread-first - "(seq (.split (System/getProperty \"java.class.path\") \":\"))" - (cider-sync-tooling-eval) - (nrepl-dict-get "value") - read)) - (project (clojure-project-dir))) - (mapcar (lambda (path) (cider--get-abs-path path project)) classpath)))) - -(defun cider-classpath-entries () - "Return a list of classpath entries." - (seq-map #'expand-file-name ; normalize filenames for e.g. Windows - (if (cider-nrepl-op-supported-p "classpath") - (cider-sync-request:classpath) - (cider-fallback-eval:classpath)))) - -(defun cider-sync-request:completion (prefix) - "Return a list of completions for PREFIX using nREPL's \"completion\" op." - (when-let* ((dict (thread-first `("op" "completions" - "ns" ,(cider-current-ns) - "prefix" ,prefix) - (cider-nrepl-send-sync-request (cider-current-repl) - 'abort-on-input)))) - (nrepl-dict-get dict "completions"))) - -(defun cider-sync-request:complete (prefix context) - "Return a list of completions for PREFIX using nREPL's \"complete\" op. -CONTEXT represents a completion context for compliment." - (when-let* ((dict (thread-first `("op" "complete" - "ns" ,(cider-current-ns) - "prefix" ,prefix - "context" ,context - ,@(when cider-enhanced-cljs-completion-p '("enhanced-cljs-completion?" "t"))) - (cider-nrepl-send-sync-request (cider-current-repl) - 'abort-on-input)))) - (nrepl-dict-get dict "completions"))) - -(defun cider-sync-request:complete-flush-caches () - "Send \"complete-flush-caches\" op to flush Compliment's caches." - (cider-nrepl-send-sync-request (list "op" "complete-flush-caches" - "session" (cider-nrepl-eval-session)) - nil - 'abort-on-input)) - -(defun cider-sync-request:info (symbol &optional class member context) - "Send \"info\" op with parameters SYMBOL or CLASS and MEMBER, honor CONTEXT." - (let ((var-info (thread-first `("op" "info" - "ns" ,(cider-current-ns) - ,@(when symbol `("sym" ,symbol)) - ,@(when class `("class" ,class)) - ,@(when member `("member" ,member)) - ,@(when context `("context" ,context))) - (cider-nrepl-send-sync-request (cider-current-repl))))) - (if (member "no-info" (nrepl-dict-get var-info "status")) - nil - var-info))) - -(defun cider-sync-request:lookup (symbol &optional lookup-fn) - "Send \"lookup\" op request with parameters SYMBOL and LOOKUP-FN." - (let ((var-info (thread-first `("op" "lookup" - "ns" ,(cider-current-ns) - ,@(when symbol `("sym" ,symbol)) - ,@(when lookup-fn `("lookup-fn" ,lookup-fn))) - (cider-nrepl-send-sync-request (cider-current-repl))))) - (if (member "lookup-error" (nrepl-dict-get var-info "status")) - nil - (nrepl-dict-get var-info "info")))) - -(defun cider-sync-request:eldoc (symbol &optional class member context) - "Send \"eldoc\" op with parameters SYMBOL or CLASS and MEMBER, honor CONTEXT." - (when-let* ((eldoc (thread-first `("op" "eldoc" - "ns" ,(cider-current-ns) - ,@(when symbol `("sym" ,symbol)) - ,@(when class `("class" ,class)) - ,@(when member `("member" ,member)) - ,@(when context `("context" ,context))) - (cider-nrepl-send-sync-request (cider-current-repl) - 'abort-on-input)))) - (if (member "no-eldoc" (nrepl-dict-get eldoc "status")) - nil - eldoc))) - -(defun cider-sync-request:eldoc-datomic-query (symbol) - "Send \"eldoc-datomic-query\" op with parameter SYMBOL." - (when-let* ((eldoc (thread-first `("op" "eldoc-datomic-query" - "ns" ,(cider-current-ns) - ,@(when symbol `("sym" ,symbol))) - (cider-nrepl-send-sync-request nil 'abort-on-input)))) - (if (member "no-eldoc" (nrepl-dict-get eldoc "status")) - nil - eldoc))) - -(defun cider-sync-request:spec-list (&optional filter-regex) - "Get a list of the available specs in the registry. -Optional argument FILTER-REGEX filters specs. By default, all specs are -returned." - (setq filter-regex (or filter-regex "")) - (thread-first `("op" "spec-list" - "filter-regex" ,filter-regex - "ns" ,(cider-current-ns)) - (cider-nrepl-send-sync-request) - (nrepl-dict-get "spec-list"))) - -(defun cider-sync-request:spec-form (spec) - "Get SPEC's form from registry." - (thread-first `("op" "spec-form" - "spec-name" ,spec - "ns" ,(cider-current-ns)) - (cider-nrepl-send-sync-request) - (nrepl-dict-get "spec-form"))) - -(defun cider-sync-request:spec-example (spec) - "Get an example for SPEC." - (thread-first `("op" "spec-example" - "spec-name" ,spec) - (cider-nrepl-send-sync-request) - (nrepl-dict-get "spec-example"))) - -(defun cider-sync-request:ns-list () - "Get a list of the available namespaces." - (thread-first `("op" "ns-list" - "exclude-regexps" ,cider-filtered-namespaces-regexps) - (cider-nrepl-send-sync-request) - (nrepl-dict-get "ns-list"))) - -(defun cider-sync-request:ns-vars (ns) - "Get a list of the vars in NS." - (thread-first `("op" "ns-vars" - "ns" ,ns) - (cider-nrepl-send-sync-request) - (nrepl-dict-get "ns-vars"))) - -(defun cider-sync-request:ns-path (ns &optional favor-url) - "Get the path to the file containing NS, FAVOR-URL if specified. - -FAVOR-URL ensures a Java URL is returned. - -* This always is the case if the underlying runtime is JVM Clojure. -* For ClojureScript, the default is a resource name. - * This often cannot be open by `cider-find-file' - (unless there was already a buffer opening that file) - -Generally, you always want to FAVOR-URL. -The option is kept for backwards compatibility. - -Note that even when favoring a url, the url itself might be nil, -in which case we'll fall back to the resource name." - (unless ns - (error "No ns provided")) - (let ((response (cider-nrepl-send-sync-request `("op" "ns-path" - "ns" ,ns)))) - (nrepl-dbind-response response (path url) - (if (and favor-url url) - url - path)))) - -(defun cider-sync-request:ns-vars-with-meta (ns) - "Get a map of the vars in NS to its metadata information." - (thread-first `("op" "ns-vars-with-meta" - "ns" ,ns) - (cider-nrepl-send-sync-request) - (nrepl-dict-get "ns-vars-with-meta"))) - -(defun cider-sync-request:private-ns-vars-with-meta (ns) - "Get a map of the vars in NS to its metadata information." - (thread-first `("op" "ns-vars-with-meta" - "ns" ,ns - "var-query" ,(nrepl-dict "private?" "t" - "include-meta-key" '("private"))) - (cider-nrepl-send-sync-request) - (nrepl-dict-get "ns-vars-with-meta"))) - -(defun cider-sync-request:ns-load-all () - "Load all project namespaces." - (thread-first '("op" "ns-load-all") - (cider-nrepl-send-sync-request) - (nrepl-dict-get "loaded-ns"))) - -(defun cider-sync-request:resource (name) - "Perform nREPL \"resource\" op with resource name NAME." - (thread-first `("op" "resource" - "name" ,name) - (cider-nrepl-send-sync-request) - (nrepl-dict-get "resource-path"))) - -(defun cider-sync-request:resources-list () - "Return a list of all resources on the classpath. -The result entries are relative to the classpath." - (when-let* ((resources (thread-first '("op" "resources-list") - (cider-nrepl-send-sync-request) - (nrepl-dict-get "resources-list")))) - (seq-map (lambda (resource) (nrepl-dict-get resource "relpath")) resources))) - -(defun cider-sync-request:fn-refs (ns sym) - "Return a list of functions that reference the function identified by NS and SYM." - (cider-ensure-op-supported "fn-refs") - (thread-first `("op" "fn-refs" - "ns" ,ns - "sym" ,sym) - (cider-nrepl-send-sync-request) - (nrepl-dict-get "fn-refs"))) - -(defun cider-sync-request:fn-deps (ns sym) - "Return a list of function deps for the function identified by NS and SYM." - (cider-ensure-op-supported "fn-deps") - (thread-first `("op" "fn-deps" - "ns" ,ns - "sym" ,sym) - (cider-nrepl-send-sync-request) - (nrepl-dict-get "fn-deps"))) - -(defun cider-sync-request:format-code (code &optional format-options) - "Perform nREPL \"format-code\" op with CODE. -FORMAT-OPTIONS is an optional configuration map for cljfmt." - (let* ((request `("op" "format-code" - "options" ,(cider--nrepl-format-code-request-map format-options) - "code" ,code)) - (response (cider-nrepl-send-sync-request request)) - (err (nrepl-dict-get response "err"))) - (when err - ;; err will be a stacktrace with a first line that looks like: - ;; "clojure.lang.ExceptionInfo: Unmatched delimiter ]" - (error (car (split-string err "\n")))) - (nrepl-dict-get response "formatted-code"))) - -(defun cider-sync-request:format-edn (edn right-margin) - "Perform \"format-edn\" op with EDN and RIGHT-MARGIN." - (let* ((request (thread-last - (map-merge 'list - `(("op" "format-edn") - ("edn" ,edn)) - (cider--nrepl-print-request-map right-margin)) - (seq-mapcat #'identity))) - (response (cider-nrepl-send-sync-request request)) - (err (nrepl-dict-get response "err"))) - (when err - ;; err will be a stacktrace with a first line that looks like: - ;; "clojure.lang.ExceptionInfo: Unmatched delimiter ]" - (error (car (split-string err "\n")))) - (nrepl-dict-get response "formatted-edn"))) - -;;; Dealing with input -;; TODO: Replace this with some nil handler. -(defun cider-stdin-handler (&optional _buffer) - "Make a stdin response handler for _BUFFER." - (nrepl-make-response-handler (current-buffer) - (lambda (_buffer _value)) - (lambda (_buffer _out)) - (lambda (_buffer _err)) - nil)) - -(defun cider-need-input (buffer) - "Handle an need-input request from BUFFER." - (with-current-buffer buffer - (let ((map (make-sparse-keymap))) - (set-keymap-parent map minibuffer-local-map) - (define-key map (kbd "C-c C-c") #'abort-recursive-edit) - (let ((stdin (condition-case nil - (concat (read-from-minibuffer "Stdin: " nil map) "\n") - (quit nil)))) - (nrepl-request:stdin stdin - (cider-stdin-handler buffer) - (cider-current-repl)))))) - -(provide 'cider-client) - -;;; cider-client.el ends here diff --git a/elpa/cider-1.12.0/cider-clojuredocs.el b/elpa/cider-1.12.0/cider-clojuredocs.el @@ -1,171 +0,0 @@ -;;; cider-clojuredocs.el --- ClojureDocs integration -*- lexical-binding: t -*- - -;; Copyright © 2014-2023 Bozhidar Batsov and CIDER contributors -;; -;; Author: Bozhidar Batsov <bozhidar@batsov.dev> - -;; This program is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see <http://www.gnu.org/licenses/>. - -;; This file is not part of GNU Emacs. - -;;; Commentary: - -;; A few commands for ClojureDocs documentation lookup. - -;;; Code: - -(require 'cider-client) -(require 'cider-common) -(require 'subr-x) -(require 'cider-popup) - -(require 'nrepl-dict) - -(require 'url-vars) - -(defconst cider-clojuredocs-url "https://clojuredocs.org/") - -(defconst cider-clojuredocs-buffer "*cider-clojuredocs*") - -(defun cider-sync-request:clojuredocs-lookup (ns sym) - "Perform nREPL \"resource\" op with NS and SYM." - (thread-first `("op" "clojuredocs-lookup" - "ns" ,ns - "sym" ,sym) - (cider-nrepl-send-sync-request) - (nrepl-dict-get "clojuredocs"))) - -(defun cider-sync-request:clojuredocs-refresh () - "Refresh the ClojureDocs cache." - (thread-first '("op" "clojuredocs-refresh-cache") - (cider-nrepl-send-sync-request) - (nrepl-dict-get "status"))) - -(defun cider-clojuredocs-replace-special (name) - "Convert the dashes in NAME to a ClojureDocs friendly format. -We need to handle \"?\", \".\", \"..\" and \"/\"." - (thread-last - name - (replace-regexp-in-string "\\?" "_q") - (replace-regexp-in-string "\\(\\.+\\)" "_\\1") - (replace-regexp-in-string "/" "fs"))) - -(defun cider-clojuredocs-url (name ns) - "Generate a ClojureDocs url from NAME and NS." - (let ((base-url cider-clojuredocs-url)) - (when (and name ns) - (concat base-url ns "/" (cider-clojuredocs-replace-special name))))) - -(defun cider-clojuredocs-web-lookup (sym) - "Open the ClojureDocs documentation for SYM in a web browser." - (if-let* ((var-info (cider-var-info sym))) - (let ((name (nrepl-dict-get var-info "name")) - (ns (nrepl-dict-get var-info "ns"))) - (browse-url (cider-clojuredocs-url name ns))) - (error "Symbol %s not resolved" sym))) - -;;;###autoload -(defun cider-clojuredocs-web (&optional arg) - "Open ClojureDocs documentation in the default web browser. - -Prompts for the symbol to use, or uses the symbol at point, depending on -the value of `cider-prompt-for-symbol'. With prefix arg ARG, does the -opposite of what that option dictates." - (interactive "P") - (funcall (cider-prompt-for-symbol-function arg) - "ClojureDocs doc for" - #'cider-clojuredocs-web-lookup)) - -;;;###autoload -(defun cider-clojuredocs-refresh-cache () - "Refresh the ClojureDocs cache." - (interactive) - (let ((result (cider-sync-request:clojuredocs-refresh))) - (if (member "ok" result) - (message "ClojureDocs cache refreshed successfully") - (message "An error occurred while trying to refresh the ClojureDocs cache")))) - -(defun cider-create-clojuredocs-buffer (content) - "Create a new ClojureDocs buffer with CONTENT." - (with-current-buffer (cider-popup-buffer cider-clojuredocs-buffer t) - (read-only-mode -1) - (set-syntax-table clojure-mode-syntax-table) - (local-set-key (kbd "C-c C-d C-c") 'cider-clojuredocs) - (insert content) - (cider-popup-buffer-mode 1) - (view-mode 1) - (goto-char (point-min)) - (current-buffer))) - -(defun cider-clojuredocs--content (dict) - "Generate a nice string from DICT." - (with-temp-buffer - (insert "= " (nrepl-dict-get dict "ns") "/" (nrepl-dict-get dict "name") "\n\n") - (let ((arglists (nrepl-dict-get dict "arglists"))) - (dolist (arglist arglists) - (insert (format " [%s]\n" arglist))) - (insert "\n") - (insert (nrepl-dict-get dict "doc")) - (insert "\n")) - (insert "\n== See Also\n\n") - (if-let ((see-alsos (nrepl-dict-get dict "see-alsos"))) - (dolist (see-also see-alsos) - (insert-text-button (format "* %s\n" see-also) - 'sym see-also - 'action (lambda (btn) - (cider-clojuredocs-lookup (button-get btn 'sym))) - 'help-echo (format "Press Enter or middle click to jump to %s" see-also))) - (insert "Not available\n")) - (insert "\n== Examples\n\n") - (if-let ((examples (nrepl-dict-get dict "examples"))) - (dolist (example examples) - (insert (cider-font-lock-as-clojure example)) - (insert "\n-------------------------------------------------\n")) - (insert "Not available\n")) - (insert "\n== Notes\n\n") - (if-let ((notes (nrepl-dict-get dict "notes"))) - (dolist (note notes) - (insert note) - (insert "\n-------------------------------------------------\n")) - (insert "Not available\n")) - (buffer-string))) - -(defun cider-clojuredocs-lookup (sym) - "Look up the ClojureDocs documentation for SYM." - (let ((docs (cider-sync-request:clojuredocs-lookup (cider-current-ns) sym))) - (pop-to-buffer (cider-create-clojuredocs-buffer (cider-clojuredocs--content docs))) - ;; highlight the symbol in question in the docs buffer - (highlight-regexp - (regexp-quote - (or (cadr (split-string sym "/")) - sym)) - 'bold))) - -;;;###autoload -(defun cider-clojuredocs (&optional arg) - "Open ClojureDocs documentation in a popup buffer. - -Prompts for the symbol to use, or uses the symbol at point, depending on -the value of `cider-prompt-for-symbol'. With prefix arg ARG, does the -opposite of what that option dictates." - (interactive "P") - (when (derived-mode-p 'clojurescript-mode) - (user-error "`cider-clojuredocs' doesn't support ClojureScript")) - (funcall (cider-prompt-for-symbol-function arg) - "ClojureDocs doc for" - #'cider-clojuredocs-lookup)) - -(provide 'cider-clojuredocs) - -;;; cider-clojuredocs.el ends here diff --git a/elpa/cider-1.12.0/cider-common.el b/elpa/cider-1.12.0/cider-common.el @@ -1,467 +0,0 @@ -;;; cider-common.el --- Common use functions -*- lexical-binding: t; -*- - -;; Copyright © 2015-2023 Artur Malabarba - -;; Author: Artur Malabarba <bruce.connor.am@gmail.com> - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see <http://www.gnu.org/licenses/>. - -;;; Commentary: - -;; Common functions that are useful in both Clojure buffers and REPL -;; buffers. - -;;; Code: - -(require 'subr-x) -(require 'nrepl-dict) -(require 'cider-util) -(require 'xref) -(require 'tramp) - -(defcustom cider-prompt-for-symbol nil - "Controls when to prompt for symbol when a command requires one. - -When non-nil, always prompt, and use the symbol at point as the default -value at the prompt. - -When nil, attempt to use the symbol at point for the command, and only -prompt if that throws an error." - :type '(choice (const :tag "always" t) - (const :tag "dwim" nil)) - :group 'cider - :package-version '(cider . "0.9.0")) - -(defcustom cider-special-mode-truncate-lines t - "If non-nil, contents of CIDER's special buffers will be line-truncated. -Should be set before loading CIDER." - :type 'boolean - :group 'cider - :package-version '(cider . "0.15.0")) - -(defun cider--should-prompt-for-symbol (&optional invert) - "Return the value of the variable `cider-prompt-for-symbol'. -Optionally invert the value, if INVERT is truthy." - (if invert (not cider-prompt-for-symbol) cider-prompt-for-symbol)) - -(defun cider-prompt-for-symbol-function (&optional invert) - "Prompt for symbol if funcall `cider--should-prompt-for-symbol' is truthy. -Otherwise attempt to use the symbol at point for the command, and only -prompt if that throws an error. - -INVERT inverts the semantics of the function `cider--should-prompt-for-symbol'." - (if (cider--should-prompt-for-symbol invert) - #'cider-read-symbol-name - #'cider-try-symbol-at-point)) - -(defun cider--kw-to-symbol (kw) - "Convert the keyword KW to a symbol." - (when kw - (replace-regexp-in-string "\\`:+" "" kw))) - -;;; Minibuffer -(defvar cider-minibuffer-history '() - "History list of expressions read from the minibuffer.") - -(defvar cider-minibuffer-map - (let ((map (make-sparse-keymap))) - (set-keymap-parent map minibuffer-local-map) - (define-key map (kbd "TAB") #'complete-symbol) - (define-key map (kbd "M-TAB") #'complete-symbol) - map) - "Minibuffer keymap used for reading Clojure expressions.") - -(declare-function cider-complete-at-point "cider-completion") -(declare-function cider-eldoc "cider-eldoc") -(defun cider-read-from-minibuffer (prompt &optional value skip-colon) - "Read a string from the minibuffer, prompting with PROMPT. -If VALUE is non-nil, it is inserted into the minibuffer as initial-input. -PROMPT need not end with \": \". If it doesn't, VALUE is displayed on the -prompt as a default value (used if the user doesn't type anything) and is -not used as initial input (input is left empty). -If SKIP-COLON is non-nil, no \": \" is forced at the end of the prompt." - (minibuffer-with-setup-hook - (lambda () - (set-syntax-table clojure-mode-syntax-table) - (add-hook 'completion-at-point-functions - #'cider-complete-at-point nil t) - (setq-local eldoc-documentation-function #'cider-eldoc) - (run-hooks 'eval-expression-minibuffer-setup-hook)) - (let* ((has-colon (string-match ": \\'" prompt)) - (input (read-from-minibuffer (cond - (has-colon prompt) - (skip-colon prompt) - (value (format "%s (default %s): " prompt value)) - (t (format "%s: " prompt))) - (when has-colon value) ; initial-input - cider-minibuffer-map nil - 'cider-minibuffer-history - (unless has-colon value)))) ; default-value - (if (and (equal input "") value (not has-colon)) - value - input)))) - -(defun cider-read-symbol-name (prompt callback) - "Read a symbol name using PROMPT with a default of the one at point. -Use CALLBACK as the completing read var callback." - (funcall callback (cider-read-from-minibuffer - prompt - ;; if the thing at point is a keyword we treat it as symbol - (cider--kw-to-symbol (cider-symbol-at-point 'look-back))))) - -(defun cider-try-symbol-at-point (prompt callback) - "Call CALLBACK with symbol at point. -On failure, read a symbol name using PROMPT and call CALLBACK with that." - (condition-case nil (funcall callback (cider--kw-to-symbol (cider-symbol-at-point 'look-back))) - ('error (funcall callback (cider-read-from-minibuffer prompt))))) - -(declare-function cider-mode "cider-mode") - -(defcustom cider-jump-to-pop-to-buffer-actions - '((display-buffer-reuse-window display-buffer-same-window)) - "Determines what window `cider-jump-to` uses. -The value is passed as the `action` argument to `pop-to-buffer`. - -The default value means: - -- If the target file is already visible in a window, reuse it (switch to it). -- Otherwise, open the target buffer in the current window. - -For further details, see https://docs.cider.mx/cider/config/basic_config.html#control-what-window-to-use-when-jumping-to-a-definition" - :type 'sexp - :group 'cider - :package-version '(cider . "0.24.0")) - -(defun cider-jump-to (buffer &optional pos other-window) - "Push current point onto marker ring, and jump to BUFFER and POS. -POS can be either a number, a cons, or a symbol. -If a number, it is the character position (the point). -If a cons, it specifies the position as (LINE . COLUMN). COLUMN can be nil. -If a symbol, `cider-jump-to' searches for something that looks like the -symbol's definition in the file. -If OTHER-WINDOW is non-nil don't reuse current window." - (with-no-warnings - (xref-push-marker-stack)) - (if other-window - (pop-to-buffer buffer 'display-buffer-pop-up-window) - (pop-to-buffer buffer cider-jump-to-pop-to-buffer-actions)) - (with-current-buffer buffer - (widen) - (goto-char (point-min)) - (cider-mode +1) - (let ((status - (cond - ;; Line-column specification. - ((consp pos) - (forward-line (1- (or (car pos) 1))) - (if (cdr pos) - (move-to-column (cdr pos)) - (back-to-indentation))) - ;; Point specification. - ((numberp pos) - (goto-char pos)) - ;; Symbol or string. - (pos - ;; Try to find (def full-name ...). - (if (or (save-excursion - (search-forward-regexp (format "(def.*\\s-\\(%s\\)" (regexp-quote pos)) - nil 'noerror)) - (let ((name (replace-regexp-in-string ".*/" "" pos))) - ;; Try to find (def name ...). - (or (save-excursion - (search-forward-regexp (format "(def.*\\s-\\(%s\\)" (regexp-quote name)) - nil 'noerror)) - ;; Last resort, just find the first occurrence of `name'. - (save-excursion - (search-forward name nil 'noerror))))) - (goto-char (match-beginning 0)) - (message "Can't find %s in %s" pos (buffer-file-name)) - 'not-found)) - (t 'not-found)))) - (unless (eq status 'not-found) - ;; Make sure the location we jump to is centered within the target window - (recenter))))) - -(defun cider--find-buffer-for-file (file) - "Return a buffer visiting FILE. -If FILE is a temp buffer name, return that buffer." - (if (string-prefix-p "*" file) - file - (and file - (not (cider--tooling-file-p file)) - (cider-find-file file)))) - -(defun cider--jump-to-loc-from-info (info &optional other-window) - "Jump to location give by INFO. -INFO object is returned by `cider-var-info' or `cider-member-info'. -OTHER-WINDOW is passed to `cider-jump-to'." - (let* ((line (nrepl-dict-get info "line")) - (file (nrepl-dict-get info "file")) - (name (nrepl-dict-get info "name")) - ;; the filename might actually be a REPL buffer name - (buffer (cider--find-buffer-for-file file))) - (if buffer - (cider-jump-to buffer (if line (cons line nil) name) other-window) - (error "No source location")))) - -(declare-function url-filename "url-parse" (cl-x) t) - -(defun cider--url-to-file (url) - "Return the filename from the resource URL. -Uses `url-generic-parse-url' to parse the url. The filename is extracted and -then url decoded. If the decoded filename has a Windows device letter followed -by a colon immediately after the leading '/' then the leading '/' is dropped to -create a valid path." - (let ((filename (url-unhex-string (url-filename (url-generic-parse-url url))))) - (if (string-match "^/\\([a-zA-Z]:/.*\\)" filename) - (match-string 1 filename) - filename))) - -(defun cider-make-tramp-prefix (method user host &optional port) - "Constructs a Tramp file prefix from METHOD, USER, HOST, PORT. -It originated from Tramp's `tramp-make-tramp-file-name'. The original be -forced to make full file name with `with-parsed-tramp-file-name', not providing -prefix only option." - (concat tramp-prefix-format - (unless (zerop (length method)) - (concat method tramp-postfix-method-format)) - (unless (zerop (length user)) - (concat user tramp-postfix-user-format)) - (when host - (if (string-match tramp-ipv6-regexp host) - (concat tramp-prefix-ipv6-format host tramp-postfix-ipv6-format) - host)) - (when port - (concat "#" port)) - tramp-postfix-host-format)) - -(defun cider-tramp-prefix (&optional buffer) - "Use the filename for BUFFER to determine a tramp prefix. -Defaults to the current buffer. Return the tramp prefix, or nil -if BUFFER is local." - (let* ((buffer (or buffer (current-buffer))) - (name (or (buffer-file-name buffer) - (with-current-buffer buffer - default-directory)))) - (when (tramp-tramp-file-p name) - (with-parsed-tramp-file-name name v - (with-no-warnings - (cider-make-tramp-prefix v-method v-user v-host v-port)))))) - -(defun cider--client-tramp-filename (name &optional buffer) - "Return the tramp filename for path NAME relative to BUFFER. -If BUFFER has a tramp prefix, it will be added as a prefix to NAME. -If the resulting path is an existing tramp file, it returns the path, -otherwise, nil." - (let* ((buffer (or buffer (current-buffer))) - (name (replace-regexp-in-string "^file:" "" name)) - (name (concat (cider-tramp-prefix buffer) name))) - (if (and (tramp-tramp-file-p name) - (tramp-handle-file-exists-p name)) - name))) - -(defun cider--server-filename (name) - "Return the nREPL server-relative filename for NAME." - (if (tramp-tramp-file-p name) - (with-parsed-tramp-file-name name nil - localname) - name)) - -(defcustom cider-path-translations nil - "Alist of path prefixes to path prefixes. -Useful to intercept the location of a path in a container (or virtual -machine) and translate to the original location. If your project is located -at \"~/projects/foo\" and the src directory of foo is mounted at \"/src\" -in the container, the alist would be `((\"/src\" \"~/projects/foo/src\"))." - :type '(alist :key-type string :value-type string) - :group 'cider - :package-version '(cider . "0.23.0")) - -(defun cider--translate-path (path direction &optional return-all) - "Attempt to translate the PATH in the given DIRECTION, optionally RETURN-ALL. -Looks at `cider-path-translations' for (container . host) alist of path -prefixes and translates PATH from container to host or vice-versa depending on -whether DIRECTION is 'from-nrepl or 'to-nrepl." - (seq-let [from-fn to-fn path-fn] (cond ((eq direction 'from-nrepl) '(car cdr identity)) - ((eq direction 'to-nrepl) '(cdr car expand-file-name))) - (let ((f (lambda (translation) - (let ((path (funcall path-fn path)) - (prefix (file-name-as-directory (expand-file-name (funcall from-fn translation))))) - (when (string-prefix-p prefix path) - (replace-regexp-in-string (format "^%s" (regexp-quote prefix)) - (file-name-as-directory - (expand-file-name (funcall to-fn translation))) - path)))))) - (if return-all - (seq-filter #'identity (mapcar f cider-path-translations)) - (seq-some f cider-path-translations))))) - -(defun cider--all-path-translations () - "Returns `cider-path-translations' if non-empty, else seeks a present value." - (or cider-path-translations - ;; cider-path-translations often is defined as a directory-local variable, - ;; so after jumping to a .jar file, its value can be lost, - ;; so we have to figure out a possible translation: - (thread-last (buffer-list) - (seq-map (lambda (buffer) - (buffer-local-value 'cider-path-translations buffer))) - (seq-filter #'identity) - (seq-uniq) - (apply #'append) - (seq-uniq)))) - -(defun cider--translate-path-from-nrepl (path) - "Attempt to translate the nREPL PATH to a local path." - (cider--translate-path path 'from-nrepl)) - -(defun cider--translate-path-to-nrepl (path) - "Attempt to translate the local PATH to an nREPL path." - (cider--translate-path (expand-file-name path) 'to-nrepl)) - -(defvar cider-from-nrepl-filename-function - (with-no-warnings - (lambda (path) - (let ((path* (if (eq system-type 'cygwin) - (cygwin-convert-file-name-from-windows path) - path))) - (or (cider--translate-path-from-nrepl path*) path*)))) - "Function to translate nREPL namestrings to Emacs filenames.") - -(defcustom cider-prefer-local-resources nil - "Prefer local resources to remote (tramp) ones when both are available." - :type 'boolean - :group 'cider) - -(defun cider--file-path (path) - "Return PATH's local or tramp path using `cider-prefer-local-resources'. -If no local or remote file exists, return nil." - (let* ((local-path (funcall cider-from-nrepl-filename-function path)) - (tramp-path (and local-path (cider--client-tramp-filename local-path)))) - (cond ((equal local-path "") "") - ((and cider-prefer-local-resources (file-exists-p local-path)) - local-path) - ((and tramp-path (file-exists-p tramp-path)) - tramp-path) - ((and local-path (file-exists-p local-path)) - local-path) - (t - (when-let* ((cider-path-translations (cider--all-path-translations))) - (thread-last (cider--translate-path local-path 'from-nrepl :return-all) - (seq-filter #'file-exists-p) - car)))))) - -(declare-function archive-extract "arc-mode") -(declare-function archive-zip-extract "arc-mode") - -(defun cider-find-file (url) - "Return a buffer visiting the file URL if it exists, or nil otherwise. -If URL has a scheme prefix, it must represent a fully-qualified file path -or an entry within a zip/jar archive. If AVFS (archive virtual file -system; see online docs) is mounted the archive entry is opened inside the -AVFS directory, otherwise the entry is archived into a temporary read-only -buffer. If URL doesn't contain a scheme prefix and is an absolute path, it -is treated as such. Finally, if URL is relative, it is expanded within each -of the open Clojure buffers till an existing file ending with URL has been -found." - (require 'arc-mode) - (cond ((string-match "^file:\\(.+\\)" url) - (when-let* ((file (cider--url-to-file (match-string 1 url))) - (path (cider--file-path file))) - (find-file-noselect path))) - ((string-match "^\\(jar\\|zip\\):\\(file:.+\\)!/\\(.+\\)" url) - (when-let* ((entry (match-string 3 url)) - (file (cider--url-to-file (match-string 2 url))) - (path (cider--file-path file)) - (name (format "%s:%s" path entry)) - (avfs (format "%s%s#uzip/%s" - (expand-file-name (or (getenv "AVFSBASE") "~/.avfs/")) - path entry))) - (cond - ;; 1) use avfs - ((file-exists-p avfs) - (find-file-noselect avfs)) - ;; 2) already uncompressed - ((find-buffer-visiting name)) - ;; 3) on remotes use Emacs built-in archiving - ((tramp-tramp-file-p path) - (find-file path) - (goto-char (point-min)) - ;; anchor to eol to prevent eg. clj matching cljs. - (re-search-forward (concat entry "$")) - (let ((archive-buffer (current-buffer))) - (archive-extract) - (kill-buffer archive-buffer)) - (current-buffer)) - ;; 4) Use external zip program to extract a single file - (t - (with-current-buffer (generate-new-buffer - (file-name-nondirectory entry)) - ;; Use appropriate coding system for bytes read from unzip cmd to - ;; display Emacs native newlines regardless of whether the file - ;; uses unix LF or dos CRLF line endings. - ;; It's important to avoid spurious CR characters, which may - ;; appear as `^M', because they can confuse clojure-mode's symbol - ;; detection, e.g. `clojure-find-ns', and break `cider-find-var'. - ;; `clojure-find-ns' uses Emacs' (thing-at-point 'symbol) as - ;; part of identifying a file's namespace, and when a file - ;; isn't decoded properly, namespaces can be reported as - ;; `my.lib^M' which `cider-find-var' won't know what to do with. - (let ((coding-system-for-read 'prefer-utf-8)) - (archive-zip-extract path entry)) - (set-visited-file-name name) - (setq-local default-directory (file-name-directory path)) - (setq-local buffer-read-only t) - (set-buffer-modified-p nil) - (set-auto-mode) - (current-buffer)))))) - (t (if-let* ((path (cider--file-path url))) - (find-file-noselect path) - (unless (file-name-absolute-p url) - (let ((cider-buffers (cider-util--clojure-buffers)) - (url (file-name-nondirectory url))) - (or (cl-loop for bf in cider-buffers - for path = (with-current-buffer bf - (expand-file-name url)) - if (and path (file-exists-p path)) - return (find-file-noselect path)) - (cl-loop for bf in cider-buffers - if (string= (buffer-name bf) url) - return bf)))))))) - -(defun cider--open-other-window-p (arg) - "Test prefix value ARG to see if it indicates displaying results in other window." - (let ((narg (prefix-numeric-value arg))) - (pcase narg - (-1 t) ; - - (16 t) ; empty empty - (_ nil)))) - -(defun cider-abbreviate-ns (namespace) - "Return a string that abbreviates NAMESPACE." - (when namespace - (let* ((names (reverse (split-string namespace "\\."))) - (lastname (car names))) - (concat (mapconcat (lambda (s) (concat (substring s 0 1) ".")) - (reverse (cdr names)) - "") - lastname)))) - -(defun cider-last-ns-segment (namespace) - "Return the last segment of NAMESPACE." - (when namespace - (car (reverse (split-string namespace "\\."))))) - - -(provide 'cider-common) -;;; cider-common.el ends here diff --git a/elpa/cider-1.12.0/cider-completion-context.el b/elpa/cider-1.12.0/cider-completion-context.el @@ -1,122 +0,0 @@ -;;; cider-completion-context.el --- Context parsing -*- lexical-binding: t -*- - -;; Copyright © 2013-2023 Bozhidar Batsov, Artur Malabarba and CIDER contributors -;; -;; Author: Bozhidar Batsov <bozhidar@batsov.dev> -;; Artur Malabarba <bruce.connor.am@gmail.com> - -;; This program is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see <http://www.gnu.org/licenses/>. - -;; This file is not part of GNU Emacs. - -;;; Commentary: - -;; Context-parsing utilities. Extracted from cider-completion.el. - -;;; Code: - -(defcustom cider-completion-use-context t - "When true, uses context at point to improve completion suggestions." - :type 'boolean - :group 'cider - :package-version '(cider . "0.7.0")) - -(defun cider-completion--bounds-of-non-string-symbol-at-point () - "Returns the bounds of the symbol at point, unless it's inside a string." - (let ((sap (symbol-at-point))) - (when (and sap (not (nth 3 (syntax-ppss)))) - (bounds-of-thing-at-point 'symbol)))) - -(defun cider-completion-symbol-start-pos () - "Find the starting position of the symbol at point, unless inside a string." - (car (cider-completion--bounds-of-non-string-symbol-at-point))) - -(defun cider-completion-symbol-end-pos () - "Find the end position of the symbol at point, unless inside a string." - (cdr (cider-completion--bounds-of-non-string-symbol-at-point))) - -(defun cider-completion-get-info-context-at-point () - "Extract a context at point that is suitable for eldoc and info ops. -Note that this context is slightly different than that of -`cider-completion-get-context-at-point': this one does not include -the current symbol at point." - (when (save-excursion - (condition-case _ - (progn - (up-list) - (check-parens) - t) - (scan-error nil) - (user-error nil))) - (save-excursion - (let* ((pref-start (cider-completion-symbol-start-pos)) - (context (cider-defun-at-point)) - (end (cider-completion-symbol-end-pos)) - (_ (beginning-of-defun-raw)) - (expr-start (point)) - (_ (if (derived-mode-p 'cider-repl-mode) - (goto-char (point-max)) - (end-of-defun))) - (expr-end (point))) - (string-remove-suffix "\n" - (concat (when pref-start (substring context 0 (- pref-start expr-start))) - "__prefix__" - (substring context (- (- expr-end end))))))))) - -(defun cider-completion-get-context-at-point () - "Extract the context at point. -If point is not inside the list, returns nil; otherwise return \"top-level\" -form, with symbol at point replaced by __prefix__." - (when (save-excursion - (condition-case _ - (progn - (up-list) - (check-parens) - t) - (scan-error nil) - (user-error nil))) - (save-excursion - (let* ((pref-end (point)) - (pref-start (cider-completion-symbol-start-pos)) - (context (cider-defun-at-point)) - (_ (beginning-of-defun-raw)) - (expr-start (point))) - (concat (when pref-start (substring context 0 (- pref-start expr-start))) - "__prefix__" - (substring context (- pref-end expr-start))))))) - -(defvar cider-completion-last-context nil) - -(defun cider-completion-get-context (&optional info) - "Extract context depending (maybe of INFO type). - -Output depends on `cider-completion-use-context' and the current major mode." - (let ((context (if cider-completion-use-context - ;; We use ignore-errors here since grabbing the context - ;; might fail because of unbalanced parens, or other - ;; technical reasons, yet we don't want to lose all - ;; completions and throw error to user because of that. - (or (ignore-errors - (if info - (cider-completion-get-info-context-at-point) - (cider-completion-get-context-at-point))) - "nil") - "nil"))) - (if (string= cider-completion-last-context context) - ":same" - (setq cider-completion-last-context context) - context))) - -(provide 'cider-completion-context) -;;; cider-completion-context.el ends here diff --git a/elpa/cider-1.12.0/cider-completion.el b/elpa/cider-1.12.0/cider-completion.el @@ -1,293 +0,0 @@ -;;; cider-completion.el --- Smart REPL-powered code completion -*- lexical-binding: t -*- - -;; Copyright © 2013-2023 Bozhidar Batsov, Artur Malabarba and CIDER contributors -;; -;; Author: Bozhidar Batsov <bozhidar@batsov.dev> -;; Artur Malabarba <bruce.connor.am@gmail.com> - -;; This program is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see <http://www.gnu.org/licenses/>. - -;; This file is not part of GNU Emacs. - -;;; Commentary: - -;; Smart REPL-powered code completion and integration with company-mode. - -;;; Code: - -(require 'subr-x) -(require 'thingatpt) - -(require 'cider-client) -(require 'cider-common) -(require 'cider-completion-context) -(require 'cider-doc) -(require 'cider-docstring) -(require 'cider-eldoc) -(require 'nrepl-dict) -(require 'seq) - -(defcustom cider-annotate-completion-candidates t - "When true, annotate completion candidates with some extra information." - :type 'boolean - :group 'cider - :package-version '(cider . "0.8.0")) - -(defcustom cider-annotate-completion-function - #'cider-default-annotate-completion-function - "Controls how the annotations for completion candidates are formatted. -Must be a function that takes two arguments: the abbreviation of the -candidate type according to `cider-completion-annotations-alist' and the -candidate's namespace." - :type 'function - :group 'cider - :package-version '(cider . "0.9.0")) - -(defcustom cider-completion-annotations-alist - '(("class" "c") - ("field" "fi") - ("function" "f") - ("import" "i") - ("keyword" "k") - ("local" "l") - ("macro" "m") - ("method" "me") - ("namespace" "n") - ("protocol" "p") - ("protocol-function" "pf") - ("record" "r") - ("special-form" "s") - ("static-field" "sf") - ("static-method" "sm") - ("type" "t") - ("var" "v")) - "Controls the abbreviations used when annotating completion candidates. - -Must be a list of elements with the form (TYPE . ABBREVIATION), where TYPE -is a possible value of the candidate's type returned from the completion -backend, and ABBREVIATION is a short form of that type." - :type '(alist :key-type string :value-type string) - :group 'cider - :package-version '(cider . "0.9.0")) - -(defconst cider-completion-kind-alist - '(("class" class) - ("field" field) - ("function" function) - ("import" class) - ("keyword" keyword) - ("local" variable) - ("macro" macro) - ("method" method) - ("namespace" module) - ("protocol" enum) - ("protocol-function" enum-member) - ("record" struct) - ("special-form" keyword) - ("static-field" field) - ("static-method" interface) - ("type" parameter) - ("var" variable)) - "Icon mapping for company-mode.") - -(defcustom cider-completion-annotations-include-ns 'unqualified - "Controls passing of namespaces to `cider-annotate-completion-function'. - -When set to 'always, the candidate's namespace will always be passed if it -is available. When set to 'unqualified, the namespace will only be passed -if the candidate is not namespace-qualified." - :type '(choice (const always) - (const unqualified) - (const :tag "never" nil)) - :group 'cider - :package-version '(cider . "0.9.0")) - -(defun cider-completion--parse-candidate-map (candidate-map) - "Get \"candidate\" from CANDIDATE-MAP. -Put type and ns properties on the candidate" - (let ((candidate (nrepl-dict-get candidate-map "candidate")) - (type (nrepl-dict-get candidate-map "type")) - (ns (nrepl-dict-get candidate-map "ns"))) - (put-text-property 0 1 'type type candidate) - (put-text-property 0 1 'ns ns candidate) - candidate)) - -(defun cider-complete (prefix) - "Complete PREFIX with context at point. -Completion relies on nREPL middleware. First -we check if cider-nrepl's complete op is available -and afterward we fallback on nREPL's built-in -completion functionality." - (cond - ;; if we don't have a connection, end early - ((not (cider-connected-p)) nil) - ;; next we try if cider-nrepl's completion is available - ((cider-nrepl-op-supported-p "complete") - (let* ((context (cider-completion-get-context)) - (candidates (cider-sync-request:complete prefix context))) - (mapcar #'cider-completion--parse-candidate-map candidates))) - ;; then we fallback to nREPL's built-in op (available in nREPL 0.8+) - ((cider-nrepl-op-supported-p "completions") - (mapcar #'cider-completion--parse-candidate-map (cider-sync-request:completion prefix))) - (t nil))) - -(defun cider-completion--get-candidate-type (symbol) - "Get candidate type for SYMBOL." - (let ((type (get-text-property 0 'type symbol))) - (or (cadr (assoc type cider-completion-annotations-alist)) - type))) - -(defun cider-completion--get-candidate-ns (symbol) - "Get candidate ns for SYMBOL." - (when (or (eq 'always cider-completion-annotations-include-ns) - (and (eq 'unqualified cider-completion-annotations-include-ns) - (not (cider-namespace-qualified-p symbol)))) - (get-text-property 0 'ns symbol))) - -(defun cider-default-annotate-completion-function (type ns) - "Get completion function based on TYPE and NS." - (concat (when ns (format " (%s)" ns)) - (when type (format " <%s>" type)))) - -(defun cider-company-symbol-kind (symbol) - "Get SYMBOL kind for company-mode." - (let ((type (get-text-property 0 'type symbol))) - (or (cadr (assoc type cider-completion-kind-alist)) - type))) - -(defun cider-annotate-symbol (symbol) - "Return a string suitable for annotating SYMBOL. -If SYMBOL has a text property `type` whose value is recognised, its -abbreviation according to `cider-completion-annotations-alist' will be -used. If `type` is present but not recognised, its value will be used -unaltered. If SYMBOL has a text property `ns`, then its value will be used -according to `cider-completion-annotations-include-ns'. The formatting is -performed by `cider-annotate-completion-function'." - (when cider-annotate-completion-candidates - (let* ((type (cider-completion--get-candidate-type symbol)) - (ns (cider-completion--get-candidate-ns symbol))) - (funcall cider-annotate-completion-function type ns)))) - -(defun cider-complete-at-point () - "Complete the symbol at point." - (when-let* ((bounds (bounds-of-thing-at-point 'symbol))) - (when (and (cider-connected-p) - (not (or (cider-in-string-p) (cider-in-comment-p)))) - (list (car bounds) (cdr bounds) - (lambda (prefix pred action) - ;; When the 'action is 'metadata, this lambda returns metadata about this - ;; capf, when action is (boundaries . suffix), it returns nil. With every - ;; other value of 'action (t, nil, or lambda), 'action is forwarded to - ;; (complete-with-action), together with (cider-complete), prefix and pred. - ;; And that function performs the completion based on those arguments. - ;; - ;; This api is better described in the section - ;; '21.6.7 Programmed Completion' of the elisp manual. - (cond ((eq action 'metadata) `(metadata (category . cider))) ;; defines a completion category named 'cider, used later in our `completion-category-overrides` logic. - ((eq (car-safe action) 'boundaries) nil) - (t (with-current-buffer (current-buffer) - (complete-with-action action - (cider-complete prefix) prefix pred))))) - :annotation-function #'cider-annotate-symbol - :company-kind #'cider-company-symbol-kind - :company-doc-buffer #'cider-create-compact-doc-buffer - :company-location #'cider-company-location - :company-docsig #'cider-company-docsig)))) - -(defun cider-completion-flush-caches () - "Force Compliment to refill its caches. -This command should be used if Compliment fails to pick up new classnames -and methods from dependencies that were loaded dynamically after the REPL -has started." - (interactive) - (cider-sync-request:complete-flush-caches)) - -(defun cider-company-location (var) - "Open VAR's definition in a buffer. -Returns the cons of the buffer itself and the location of VAR's definition -in the buffer." - (when-let* ((info (cider-var-info var)) - (file (nrepl-dict-get info "file")) - (line (nrepl-dict-get info "line")) - (buffer (cider-find-file file))) - (with-current-buffer buffer - (save-excursion - (goto-char (point-min)) - (forward-line (1- line)) - (cons buffer (point)))))) - -(defun cider-company-docsig (thing) - "Return signature for THING." - (when-let ((eldoc-info (cider-eldoc-info thing))) - (let* ((ns (lax-plist-get eldoc-info "ns")) - (symbol (lax-plist-get eldoc-info "symbol")) - (arglists (lax-plist-get eldoc-info "arglists"))) - (format "%s: %s" - (cider-eldoc-format-thing ns symbol thing - (cider-eldoc-thing-type eldoc-info)) - (cider-eldoc-format-arglist arglists 0))))) - -;; Fuzzy completion for company-mode - -(defun cider-company-unfiltered-candidates (string &rest _) - "Return CIDER completion candidates for STRING as is, unfiltered." - (cider-complete string)) - -;; defines a completion style named `cider' (which ideally would have been named `cider-fuzzy'). -;; note that there's already a completion category named `cider' (grep for `(metadata (category . cider))` in this file), -;; which can be confusing given the identical name. -;; The `cider' completion style should be removed because the `flex' style is essentially equivalent. -;; (To be fair, `flex' was introduced in Emacs 27, 3 years in after our commit 04e428b -;; which introduced `cider-company-enable-fuzzy-completion') -(add-to-list 'completion-styles-alist - '(cider - cider-company-unfiltered-candidates - cider-company-unfiltered-candidates - "CIDER backend-driven completion style.")) - -;; Currently CIDER completions only work for `basic`, and not `initials`, `partial-completion`, `orderless`, etc. -;; So we ensure that those other styles aren't used with CIDER, otherwise one would see bad or no completions at all. -;; This `add-to-list` call can be removed once we implement the other completion styles. -;; (When doing that, please refactor `cider-enable-flex-completion' as well) -(add-to-list 'completion-category-overrides '(cider (styles basic))) - -(defun cider-company-enable-fuzzy-completion () - "Enable backend-driven fuzzy completion in the current buffer. - -DEPRECATED: please use `cider-enable-flex-completion' instead." - (setq-local completion-styles '(cider))) - -(make-obsolete 'cider-company-enable-fuzzy-completion 'cider-enable-flex-completion "1.8.0") - -(defun cider-enable-flex-completion () - "Enables `flex' (fuzzy) completion for CIDER in all buffers. - -Only affects the `cider' completion category.`" - (interactive) - (when (< emacs-major-version 27) - (user-error "`cider-enable-flex-completion' requires Emacs 27 or later")) - (let ((found-styles (when-let ((cider (assq 'cider completion-category-overrides))) - (assq 'styles cider))) - (found-cycle (when-let ((cider (assq 'cider completion-category-overrides))) - (assq 'cycle cider)))) - (setq completion-category-overrides (seq-remove (lambda (x) - (equal 'cider (car x))) - completion-category-overrides)) - (unless (member 'flex found-styles) - (setq found-styles (append found-styles '(flex)))) - (add-to-list 'completion-category-overrides (apply #'list 'cider found-styles (when found-cycle - (list found-cycle)))))) - -(provide 'cider-completion) -;;; cider-completion.el ends here diff --git a/elpa/cider-1.12.0/cider-connection.el b/elpa/cider-1.12.0/cider-connection.el @@ -1,1083 +0,0 @@ -;;; cider-connection.el --- Connection and session life-cycle management for CIDER -*- lexical-binding: t -*- -;; -;; Copyright © 2019-2023 Artur Malabarba, Bozhidar Batsov, Vitalie Spinu and CIDER contributors -;; -;; Author: Artur Malabarba <bruce.connor.am@gmail.com> -;; Bozhidar Batsov <bozhidar@batsov.dev> -;; Vitalie Spinu <spinuvit@gmail.com> -;; -;; Keywords: languages, clojure, cider -;; -;; This program is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. -;; -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. -;; -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see <http://www.gnu.org/licenses/>. -;; -;; This file is not part of GNU Emacs. -;; -;; -;;; Commentary: -;; -;; -;;; Code: - -(require 'nrepl-client) -(require 'cl-lib) -(require 'format-spec) -(require 'sesman) -(require 'sesman-browser) -(require 'spinner) -(require 'cider-popup) -(require 'cider-util) - -(defcustom cider-session-name-template "%J:%h:%p" - "Format string to use for session names. -See `cider-format-connection-params' for available format characters." - :type 'string - :group 'cider - :package-version '(cider . "0.18.0")) - -(defcustom cider-redirect-server-output-to-repl t - "Controls whether nREPL server output would be redirected to the REPL. -When non-nil the output would end up in both the nrepl-server buffer (when -available) and the matching REPL buffer." - :type 'boolean - :group 'cider - :safe #'booleanp - :package-version '(cider . "0.17.0")) - -(defcustom cider-auto-mode t - "When non-nil, automatically enable and disable CIDER in all Clojure buffers. - -After an initial connection, `cider-mode' is added to `clojure-mode-hook' and -automatically enabled on all existing Clojure buffers. After the last -connection has been closed, `cider-mode' is disabled in all Clojure buffers, and -has to be manually re-enabled via \\[cider-mode]. - -Useful for switching between alternative minor modes like `inf-clojure-mode'." - :type 'boolean - :group 'cider - :safe #'booleanp - :package-version '(cider . "0.9.0")) - -(defcustom cider-merge-sessions nil - "Controls session combination behaviour. - -Symbol `host' combines all sessions of a project associated with the same host. -Symbol `project' combines all sessions of a project. - -All other values do not combine any sessions." - :type '(choice (const :tag "Combine all sessions with the same host" host) - (const :tag "Combine all sessions from the same project" project) - (other :tag "Do not combine any sessions")) - :group 'cider - :safe #'symbolp - :package-version '(cider . "1.5")) - -(defcustom cider-reuse-dead-repls 'prompt - "How to deal with existing dead REPL buffers when initializing a connection. - -Possible choices are `prompt', `auto', `any', and nil. -- `prompt' means to always ask the user for a decision. -- `auto' means to automatically reuse a dead REPL without prompting the user - if it is the only available option. When there are multiple buffers to - choose from, the user is is prompted for a choice. -- `any' (or any other non-nil value) means to reuse any dead REPL buffer - available, by default the most relevant according to various heuristics, - and never prompt the user. -- nil means to start a new REPL each time, ignoring existing buffers." - :type '(choice (const :tag "Always prompt for what to do with dead REPLs" prompt) - (const :tag "Reuse dead REPL, prompting only for multiple choice" auto) - (const :tag "Reuse any available dead REPL and never prompt" any) - (const :tag "Never reuse dead REPLs" nil)) - :group 'cider - :safe #'symbolp - :package-version '(cider . "1.8")) - -(defconst cider-required-nrepl-version "0.6.0" - "The minimum nREPL version that's known to work properly with CIDER.") - -(defcustom cider-clojurec-eval-destination 'multi - "The REPL type to be chosen in .cljc buffers." - :type '(choice (const :tag "Clojure" clj) - (const :tag "ClojureScript" cljs) - (const :tag "Multi (evaluate in Clojure and ClojureScript simultaneously)" multi)) - :group 'cider - :package-version '(cider . "1.8")) - -;;; Connect - -(defun cider-nrepl-connect (params) - "Start nrepl client and create the REPL. -PARAMS is a plist containing :host, :port, :server and other parameters for -`cider-repl-create'." - (process-buffer - (nrepl-start-client-process - (plist-get params :host) - (plist-get params :port) - (plist-get params :server) - (lambda (_) - (cider-repl-create params)) - (plist-get params :socket-file)))) - -(defun cider-sessions () - "Return a list of all active CIDER sessions." - (sesman-sessions 'CIDER)) - -(defun cider-connected-p () - "Return t if CIDER is currently connected, nil otherwise." - (process-live-p (get-buffer-process (cider-current-repl)))) - -(defun cider-ensure-connected () - "Ensure there is a linked CIDER session." - (sesman-ensure-session 'CIDER)) - -(defun cider--session-server (session) - "Return server buffer for SESSION or nil if there is no server." - (seq-some (lambda (r) - (buffer-local-value 'nrepl-server-buffer r)) - (cdr session))) - -(defun cider--gather-session-params (session) - "Gather all params for a SESSION." - (let (params) - (dolist (repl (cdr session)) - (setq params (cider--gather-connect-params params repl))) - (when-let* ((server (cider--session-server session))) - (setq params (cider--gather-connect-params params server))) - params)) - -(defun cider--gather-connect-params (&optional params proc-buffer) - "Gather all relevant connection parameters into PARAMS plist. -PROC-BUFFER is either server or client buffer, defaults to current buffer." - (let ((proc-buffer (or proc-buffer (current-buffer)))) - (with-current-buffer proc-buffer - (unless nrepl-endpoint - (error "This is not a REPL or SERVER buffer; is there an active REPL?")) - (let ((server-buf (if (nrepl-server-p proc-buffer) - proc-buffer - nrepl-server-buffer))) - (cl-loop for l on nrepl-endpoint by #'cddr - do (setq params (plist-put params (car l) (cadr l)))) - (setq params (thread-first params - (plist-put :project-dir nrepl-project-dir))) - (when (buffer-live-p server-buf) - (setq params (thread-first params - (plist-put :server (get-buffer-process server-buf)) - (plist-put :server-command nrepl-server-command)))) - ;; repl-specific parameters (do not pollute server params!) - (unless (nrepl-server-p proc-buffer) - (setq params (thread-first params - (plist-put :session-name cider-session-name) - (plist-put :repl-type cider-repl-type) - (plist-put :cljs-repl-type cider-cljs-repl-type) - (plist-put :repl-init-function cider-repl-init-function)))) - params)))) - -(defun cider--close-buffer (buffer) - "Close the BUFFER and kill its associated process (if any)." - (when (buffer-live-p buffer) - (when-let* ((proc (get-buffer-process buffer))) - (when (process-live-p proc) - (delete-process proc))) - (kill-buffer buffer))) - -(declare-function cider-repl-emit-interactive-stderr "cider-repl") -(defun cider--close-connection (repl &optional no-kill) - "Close connection associated with REPL. -When NO-KILL is non-nil stop the connection but don't kill the REPL -buffer." - (when (buffer-live-p repl) - (with-current-buffer repl - (when spinner-current (spinner-stop)) - (when nrepl-tunnel-buffer - (cider--close-buffer nrepl-tunnel-buffer)) - (when no-kill - ;; inform sentinel not to kill the server, if any - (thread-first (get-buffer-process repl) - (process-plist) - (plist-put :keep-server t)))) - (let ((proc (get-buffer-process repl))) - (when (and (process-live-p proc) - (or (not nrepl-server-buffer) - ;; Sync request will hang if the server is dead. - (process-live-p (get-buffer-process nrepl-server-buffer)))) - (nrepl-sync-request:close repl) - ;; give a chance to the REPL to respond to the closing of the connection - (sleep-for 0.5) - (delete-process proc))) - (when-let* ((messages-buffer (and nrepl-log-messages - (nrepl-messages-buffer repl)))) - (kill-buffer messages-buffer)) - (unless no-kill - (kill-buffer repl))) - (when repl - (sesman-remove-object 'CIDER nil repl (not no-kill) t))) - -(defun cider-emit-manual-warning (section-id format &rest args) - "Emit a warning to the REPL and link to the online manual. -SECTION-ID is the section to link to. The link is added on the last line. -FORMAT is a format string to compile with ARGS and display on the REPL." - (let ((message (apply #'format format args))) - (cider-repl-emit-interactive-stderr - (concat "WARNING: " message " (" - (cider--manual-button "More information" section-id) - ")\n")))) - -(defvar cider-version) -(defun cider--check-required-nrepl-version () - "Check whether we're using a compatible nREPL version." - (if-let* ((nrepl-version (cider--nrepl-version))) - (when (version< nrepl-version cider-required-nrepl-version) - (cider-emit-manual-warning "troubleshooting.html#warning-saying-you-have-to-use-newer-nrepl" - "CIDER requires nREPL %s (or newer) to work properly" - cider-required-nrepl-version)))) - -(defvar cider-minimum-clojure-version) -(defun cider--check-clojure-version-supported () - "Ensure that we are meeting the minimum supported version of Clojure." - (if-let* ((clojure-version (cider--clojure-version)) - ;; drop all qualifiers from the version string - ;; e.g. 1.10.0-master-SNAPSHOT becomes simply 1.10.0 - (clojure-version (car (split-string clojure-version "-")))) - (when (version< clojure-version cider-minimum-clojure-version) - (cider-emit-manual-warning "basics/installation.html#prerequisites" - "Clojure version (%s) is not supported (minimum %s). CIDER will not work." - clojure-version cider-minimum-clojure-version)))) - -(defun cider--strip-version-patch (v) - "Strips everything but major.minor from the version, returning a version list. -V is the version string to strip the patch from." - (seq-take (version-to-list v) 2)) - -(defun cider--compatible-middleware-version-p (required-ver ver) - "Checks that the available middleware version is compatible with the required. -We look only at the major and minor components. When the major -version is 0, only check that the minor versions match. When the major version -is > 0, first check that the major version matches, then that the minor -version is >= the required minor version. -VER the 'installed' version, -REQUIRED-VER the version required by cider." - (let ((ver* (cider--strip-version-patch ver)) - (required-ver* (cider--strip-version-patch required-ver))) - (cond ((= 0 (car required-ver*)) (= (cadr required-ver*) - (cadr ver*))) - (t (and (= (car required-ver*) - (car ver*)) - (version-list-<= required-ver* ver*)))))) - -(defvar cider-required-middleware-version) -(defun cider--check-middleware-compatibility () - "CIDER frontend/backend compatibility check. -Retrieve the underlying connection's CIDER-nREPL version and checks if the -middleware used is compatible with CIDER. If not, will display a warning -message in the REPL area." - (let* ((version-dict (nrepl-aux-info "cider-version" (cider-current-repl))) - (middleware-version (nrepl-dict-get version-dict "version-string"))) - (cond - ((null middleware-version) - (cider-emit-manual-warning "troubleshooting.html#cider-complains-of-the-cider-nrepl-version" - "CIDER requires cider-nrepl to be fully functional. Some features will not be available without it!")) - ((not (cider--compatible-middleware-version-p cider-required-middleware-version middleware-version)) - (cider-emit-manual-warning "troubleshooting.html#cider-complains-of-the-cider-nrepl-version" - "CIDER %s requires cider-nrepl %s, but you're currently using cider-nrepl %s. The version mismatch might break some functionality!" - cider-version cider-required-middleware-version middleware-version))))) - -(declare-function cider-interactive-eval-handler "cider-eval") -(declare-function cider-nrepl-send-request "cider-client") -;; TODO: Use some null handler here -(defun cider--subscribe-repl-to-server-out () - "Subscribe to the nREPL server's *out*." - (cider-nrepl-send-request '("op" "out-subscribe") - (cider-interactive-eval-handler (current-buffer)))) - -(defvar cider-mode) -(declare-function cider-mode "cider-mode") -(defun cider-enable-on-existing-clojure-buffers () - "Enable CIDER's minor mode on existing Clojure buffers. -See command `cider-mode'." - (interactive) - (add-hook 'clojure-mode-hook #'cider-mode) - (dolist (buffer (cider-util--clojure-buffers)) - (with-current-buffer buffer - (unless cider-mode - (cider-mode +1) - ;; In global-eldoc-mode, a new file-visiting buffer calls - ;; `turn-on-eldoc-mode' which enables eldoc-mode if it's supported in that - ;; buffer as determined by `eldoc--supported-p'. Cider's eldoc support - ;; allows new buffers in cider-mode to enable eldoc-mode. As of 2021-04, - ;; however, clojure-mode itself has no eldoc support, so old clojure - ;; buffers opened before cider started aren't necessarily in eldoc-mode. - ;; Here, we've enabled cider-mode for this old clojure buffer, and now, if - ;; global-eldoc-mode is enabled, try to enable eldoc-mode as if the buffer - ;; had just been created with cider-mode. - (when global-eldoc-mode - (turn-on-eldoc-mode)))))) - -(declare-function cider--debug-mode "cider-debug") -(defun cider-disable-on-existing-clojure-buffers () - "Disable `cider-mode' and related commands on existing Clojure buffers." - (interactive) - (dolist (buffer (cider-util--clojure-buffers)) - (with-current-buffer buffer - (cider--debug-mode -1) - (cider-mode -1)))) - -(defun cider-possibly-disable-on-existing-clojure-buffers () - "Disable `cider-mode' in all Clojure buffers if all CIDER sessions are closed." - (unless (cider-sessions) - (cider-disable-on-existing-clojure-buffers))) - -(defun cider--set-connection-capabilities (&optional conn-buffer) - "Set `cider-connection-capabilities' for CONN-BUFFER during repl init. -See `cider-connection-capabilities'." - (with-current-buffer (or conn-buffer (current-buffer)) - (setf cider-connection-capabilities - (append - (pcase (cider-runtime) - ('clojure '(clojure jvm-compilation-errors)) - ('babashka '(babashka jvm-compilation-errors)) - ('nbb '(cljs)) - (_ '())) - (when - (eq cider-repl-type 'cljs) - '(cljs)))))) - -(declare-function cider--debug-init-connection "cider-debug") -(declare-function cider-repl-init "cider-repl") -(declare-function cider-nrepl-op-supported-p "cider-client") -(declare-function cider-nrepl-request:eval "cider-client") - -(defun cider--connected-handler () - "Handle CIDER initialization after nREPL connection has been established. -This function is appended to `nrepl-connected-hook' in the client process -buffer." - ;; `nrepl-connected-hook' is run in the connection buffer - ;; `cider-enlighten-mode' changes eval to include the debugger, so we inhibit - ;; it here as the debugger isn't necessarily initialized yet - (let ((cider-enlighten-mode nil)) - ;; after initialization, set mode-line and buffer name. - (cider-set-repl-type cider-repl-type) - (cider-repl-init - (current-buffer) - (lambda () - ;; Init logic that's specific to Clojure's nREPL and cider-nrepl - (when (cider-runtime-clojure-p) - (cider--check-required-nrepl-version) - (cider--check-clojure-version-supported) - (cider--check-middleware-compatibility) - - ;; Redirect the nREPL's terminal output to a REPL buffer. - ;; If we don't do this the server's output will end up - ;; in the *nrepl-server* buffer. - (when (and cider-redirect-server-output-to-repl - (cider-nrepl-op-supported-p "out-subscribe")) - (cider--subscribe-repl-to-server-out)) - - ;; Middleware on cider-nrepl's side is deferred until first usage, but - ;; loading middleware concurrently can lead to occasional "require" issues - ;; (likely a Clojure bug). Thus, we load the heavy debug middleware towards - ;; the end, allowing for the faster "server-out" middleware to load - ;; first. - (cider--debug-init-connection)) - - (cider--set-connection-capabilities) - - (when cider-repl-init-function - (funcall cider-repl-init-function)) - - (when cider-auto-mode - (cider-enable-on-existing-clojure-buffers)) - - (run-hooks 'cider-connected-hook))))) - -(defun cider--disconnected-handler () - "Cleanup after nREPL connection has been lost or closed. -This function is appended to `nrepl-disconnected-hook' in the client -process buffer." - ;; `nrepl-connected-hook' is run in the connection buffer - (when cider-auto-mode - (cider-possibly-disable-on-existing-clojure-buffers)) - (run-hooks 'cider-disconnected-hook)) - - -;;; Connection Info - -(defun cider--java-version () - "Retrieve the underlying connection's Java version." - (with-current-buffer (cider-current-repl) - (when nrepl-versions - (thread-first nrepl-versions - (nrepl-dict-get "java") - (nrepl-dict-get "version-string"))))) - -(defun cider--clojure-version () - "Retrieve the underlying connection's Clojure version." - (with-current-buffer (cider-current-repl) - (when nrepl-versions - (thread-first nrepl-versions - (nrepl-dict-get "clojure") - (nrepl-dict-get "version-string"))))) - -(defun cider--nrepl-version () - "Retrieve the underlying connection's nREPL version." - (with-current-buffer (cider-current-repl) - (when nrepl-versions - (thread-first nrepl-versions - (nrepl-dict-get "nrepl") - (nrepl-dict-get "version-string"))))) - -(defun cider--babashka-version () - "Retrieve the underlying connection's Babashka version." - (with-current-buffer (cider-current-repl) - (when nrepl-versions - (nrepl-dict-get nrepl-versions "babashka")))) - -(defun cider--babashka-nrepl-version () - "Retrieve the underlying connection's babashka.nrepl version." - (with-current-buffer (cider-current-repl) - (when nrepl-versions - (nrepl-dict-get nrepl-versions "babashka.nrepl")))) - -(defun cider--nbb-nrepl-version () - "Retrieve the underlying connection's nbb version. - -Note that this is currently not a real version number. -But helps us know if this is a nbb repl, or not." - (with-current-buffer (cider-current-repl) - (when nrepl-versions - (nrepl-dict-get nrepl-versions "nbb-nrepl")))) - -(defun cider-runtime () - "Return the runtime of the nREPl server." - (cond - ((cider--clojure-version) 'clojure) - ((cider--babashka-version) 'babashka) - ((cider--nbb-nrepl-version) 'nbb) - (t 'generic))) - -(defun cider-runtime-clojure-p () - "Check if the current runtime is Clojure." - (eq (cider-runtime) 'clojure)) - -(defun cider--connection-info (connection-buffer &optional genericp) - "Return info about CONNECTION-BUFFER. -Info contains project name, current REPL namespace, host:port endpoint and -runtime details. When GENERICP is non-nil, don't provide specific info -about this buffer (like variable `cider-repl-type')." - (with-current-buffer connection-buffer - (cond - ((cider--clojure-version) - (format "%s%s@%s:%s (Java %s, Clojure %s, nREPL %s)" - (if genericp "" (upcase (concat (symbol-name cider-repl-type) " "))) - (or (cider--project-name nrepl-project-dir) "<no project>") - (plist-get nrepl-endpoint :host) - (plist-get nrepl-endpoint :port) - (cider--java-version) - (cider--clojure-version) - (cider--nrepl-version))) - ((cider--babashka-version) - (format "%s%s@%s:%s (Babashka %s, babashka.nrepl %s)" - (if genericp "" (upcase (concat (symbol-name cider-repl-type) " "))) - (or (cider--project-name nrepl-project-dir) "<no project>") - (plist-get nrepl-endpoint :host) - (plist-get nrepl-endpoint :port) - (cider--babashka-version) - (cider--babashka-nrepl-version))) - (t - (format "%s%s@%s:%s" - (if genericp "" (upcase (concat (symbol-name cider-repl-type) " "))) - (or (cider--project-name nrepl-project-dir) "<no project>") - (plist-get nrepl-endpoint :host) - (plist-get nrepl-endpoint :port)))))) - -(defvar-local cider-connection-capabilities '() - "A list of some of the capabilities of this connection buffer. -In other words - what assumptions we make about the runtime. -This is more general than -`cider-nrepl-op-supported-p' and `cider-library-present-p'. -But does not need to replace them.") - -(defun cider-connection-has-capability-p (capability &optional conn-buf) - "Return non nil when the cider connection has CAPABILITY for CONN-BUF. -By default it assumes the connection buffer is current." - (with-current-buffer (or conn-buf (current-buffer)) - (member capability cider-connection-capabilities))) - - -;;; Connection Management Commands - -(defun cider-quit (&optional repl) - "Quit the CIDER connection associated with REPL. -REPL defaults to the current REPL." - (interactive) - (let ((repl (or repl - (sesman-browser-get 'object) - (cider-current-repl nil 'ensure)))) - (cider--close-connection repl)) - ;; if there are no more sessions we can kill all ancillary buffers - (unless (cider-sessions) - (cider-close-ancillary-buffers)) - ;; need this to refresh sesman browser - (run-hooks 'sesman-post-command-hook)) - -(defun cider-restart (&optional repl) - "Restart CIDER connection associated with REPL. -REPL defaults to the current REPL. Don't restart the server or other -connections within the same session. Use `sesman-restart' to restart the -entire session." - (interactive) - (let* ((repl (or repl - (sesman-browser-get 'object) - (cider-current-repl nil 'ensure))) - (params (thread-first () - (cider--gather-connect-params repl) - (plist-put :session-name (sesman-session-name-for-object 'CIDER repl)) - (plist-put :repl-buffer repl)))) - (cider--close-connection repl 'no-kill) - (cider-nrepl-connect params) - ;; need this to refresh sesman browser - (run-hooks 'sesman-post-command-hook))) - -(defun cider-close-ancillary-buffers () - "Close buffers that are shared across connections." - (interactive) - (dolist (buf-name cider-ancillary-buffers) - (when (get-buffer buf-name) - (kill-buffer buf-name)))) - -(defun cider-describe-connection (&optional repl) - "Display information about the connection associated with REPL. -REPL defaults to the current REPL." - (interactive) - (let ((repl (or repl - (sesman-browser-get 'object) - (cider-current-repl nil 'ensure)))) - (message "%s" (cider--connection-info repl)))) - -(defconst cider-nrepl-session-buffer "*cider-nrepl-session*") - -(declare-function cider-nrepl-eval-session "cider-client") -(declare-function cider-nrepl-tooling-session "cider-client") -(defun cider-describe-nrepl-session () - "Describe an nREPL session." - (interactive) - (cider-ensure-connected) - (let* ((repl (cider-current-repl nil 'ensure)) - (selected-session (completing-read "Describe nREPL session: " (nrepl-sessions repl)))) - (when (and selected-session (not (equal selected-session ""))) - (let* ((session-info (nrepl-sync-request:describe repl)) - (ops (nrepl-dict-keys (nrepl-dict-get session-info "ops"))) - (session-id (nrepl-dict-get session-info "session")) - (session-type (cond - ((equal session-id (cider-nrepl-eval-session)) "Active eval") - ((equal session-id (cider-nrepl-tooling-session)) "Active tooling") - (t "Unknown")))) - (with-current-buffer (cider-popup-buffer cider-nrepl-session-buffer 'select nil 'ancillary) - (read-only-mode -1) - (insert (format "Session: %s\n" session-id) - (format "Type: %s session\n" session-type) - (format "Supported ops:\n")) - (mapc (lambda (op) (insert (format " * %s\n" op))) ops))) - (display-buffer cider-nrepl-session-buffer)))) - -(defun cider-list-nrepl-middleware () - "List the loaded nREPL middleware." - (interactive) - (cider-ensure-connected) - (let* ((repl (cider-current-repl nil 'ensure)) - (middleware (nrepl-middleware repl))) - (with-current-buffer (cider-popup-buffer "*cider-nrepl-middleware*" 'select nil 'ancillary) - (read-only-mode -1) - (insert (format "Currently loaded middleware:\n")) - (mapc (lambda (mw) (insert (format " * %s\n" mw))) middleware)) - (display-buffer "*cider-nrepl-middleware*"))) - - -;;; Sesman's Session-Wise Management UI - -(cl-defmethod sesman-project ((_system (eql CIDER))) - "Find project directory." - (clojure-project-dir (cider-current-dir))) - -(cl-defmethod sesman-more-relevant-p ((_system (eql CIDER)) session1 session2) - "Figure out if SESSION1 or SESSION2 is more relevant." - (sesman-more-recent-p (cdr session1) (cdr session2))) - -(declare-function cider-classpath-entries "cider-client") - -(defvar cider-sesman-browser-map - (let ((map (make-sparse-keymap))) - (define-key map (kbd "j q") #'cider-quit) - (define-key map (kbd "j k") #'cider-quit) - (define-key map (kbd "j r") #'cider-restart) - (define-key map (kbd "j d") #'cider-describe-connection) - (define-key map (kbd "j i") #'cider-describe-connection) - (define-key map (kbd "C-c C-q") #'cider-quit) - (define-key map (kbd "C-c C-q") #'cider-quit) - (define-key map (kbd "C-c C-r") #'cider-restart) - (define-key map (kbd "C-c M-r") #'cider-restart) - (define-key map (kbd "C-c C-d") #'cider-describe-connection) - (define-key map (kbd "C-c M-d") #'cider-describe-connection) - (define-key map (kbd "C-c C-i") #'cider-describe-connection) - map) - "Map active on REPL objects in sesman browser.") - -(cl-defmethod sesman-session-info ((_system (eql CIDER)) session) - "Obtain info for a CIDER SESSION." - (list :objects (cdr session) - :map cider-sesman-browser-map)) - -(declare-function cider "cider") -(cl-defmethod sesman-start-session ((_system (eql CIDER))) - "Start a connection of any type interactively. -Fallback on `cider' command." - (call-interactively #'cider)) - -(cl-defmethod sesman-quit-session ((_system (eql CIDER)) session) - "Quit a CIDER SESSION." - (mapc #'cider--close-connection (cdr session)) - ;; if there are no more session we can kill all ancillary buffers - (unless (cider-sessions) - (cider-close-ancillary-buffers))) - -(cl-defmethod sesman-restart-session ((_system (eql CIDER)) session) - "Restart a CIDER SESSION." - (let* ((ses-name (car session)) - (repls (cdr session)) - (srv-buf (cider--session-server session))) - (if srv-buf - ;; session with a server - (let ((s-params (cider--gather-connect-params nil srv-buf))) - ;; 1) kill all connections, but keep the buffers - (mapc (lambda (conn) - (cider--close-connection conn 'no-kill)) - repls) - ;; 2) kill the server - (nrepl-kill-server-buffer srv-buf) - ;; 3) start server - (nrepl-start-server-process - (plist-get s-params :project-dir) - (plist-get s-params :server-command) - (lambda (server-buf) - ;; 4) restart the repls reusing the buffer - (dolist (r repls) - (cider-nrepl-connect - (thread-first () - (cider--gather-connect-params r) - ;; server params (:port, :project-dir etc) have precedence - (cider--gather-connect-params server-buf) - (plist-put :session-name ses-name) - (plist-put :repl-buffer r)))) - (sesman-browser-revert-all 'CIDER) - (message "Restarted CIDER %s session" ses-name)))) - ;; server-less session - (dolist (r repls) - (cider--close-connection r 'no-kill) - (cider-nrepl-connect - (thread-first () - (cider--gather-connect-params r) - (plist-put :session-name ses-name) - (plist-put :repl-buffer r))))))) - -(defun cider--ensure-spec-is-not-invokable (spec) - "Ensures SPEC cannot be invoked as a function. - -Invokeable specs are an Emacs 29 feature -that we don't intend to use in this context." - (let ((spec-char (car spec)) - (spec-value (cdr spec))) - `(,spec-char - . - ,(if (symbolp spec-value) - (prin1-to-string spec-value) - spec-value)))) - -(defun cider-format-connection-params (template params) - "Format PARAMS with TEMPLATE string. -The following formats can be used in TEMPLATE string: - - %h - host - %H - remote host, empty for local hosts - %p - port - %j - short project name, or directory name if no project - %J - long project name including parent dir name - %r - REPL type (clj or cljs) - %S - type of the ClojureScript runtime (Browser, Node, Figwheel etc.) - %s - session name as defined by `cider-session-name-template'. - -In case some values are empty, extra separators (: and -) are automatically -removed." - (let* ((dir (directory-file-name - (abbreviate-file-name - (or (plist-get params :project-dir) - (clojure-project-dir (cider-current-dir)) - default-directory)))) - (short-proj (file-name-nondirectory (directory-file-name dir))) - (parent-dir (ignore-errors - (thread-first dir - file-name-directory - directory-file-name file-name-nondirectory - file-name-as-directory))) - (long-proj (format "%s%s" (or parent-dir "") short-proj)) - ;; use `dir` if it is shorter than `long-proj` or `short-proj` - (short-proj (if (>= (length short-proj) (length dir)) - dir - short-proj)) - (long-proj (if (>= (length long-proj) (length dir)) - dir - long-proj)) - (port (or (plist-get params :port) "")) - (host (or (plist-get params :host) "localhost")) - (remote-host (if (member host '("localhost" "127.0.0.1")) - "" - host)) - (repl-type (or (plist-get params :repl-type) "unknown")) - (cljs-repl-type (or (and (eq repl-type 'cljs) - (plist-get params :cljs-repl-type)) - "")) - (specs `((?h . ,host) - (?H . ,remote-host) - (?p . ,port) - (?j . ,short-proj) - (?J . ,long-proj) - (?r . ,repl-type) - (?S . ,cljs-repl-type))) - (ses-name (or (plist-get params :session-name) - (format-spec cider-session-name-template specs))) - (specs (append `((?s . ,ses-name)) specs)) - (specs (mapcar #'cider--ensure-spec-is-not-invokable specs))) - (thread-last (format-spec template specs) - ;; remove extraneous separators - (replace-regexp-in-string "\\([:-]\\)[:-]+" "\\1") - (replace-regexp-in-string "\\(^[:-]\\)\\|\\([:-]$\\)" "") - (replace-regexp-in-string "[:-]\\([])*]\\)" "\\1")))) - -(defun cider-make-session-name (params) - "Create new session name given plist of connection PARAMS. -Session name can be customized with `cider-session-name-template'." - (let* ((root-name (cider-format-connection-params cider-session-name-template params)) - (other-names (mapcar #'car (sesman-sessions 'CIDER))) - (name root-name) - (i 2)) - (while (member name other-names) - (setq name (concat root-name "#" (number-to-string i)) - i (+ i 1))) - name)) - - -;;; REPL Buffer Init - -(defvar-local cider-cljs-repl-type nil - "The type of the ClojureScript runtime ('browser, 'node, 'figwheel, etc.).") - -(defvar-local cider-repl-type nil - "The type of this REPL buffer, usually either clj or cljs.") - -(defvar-local cider-repl-cljs-upgrade-pending nil - "Is the cljs repl currently pending?") - -(defun cider-repl-type (repl-buffer) - "Get REPL-BUFFER's type." - (buffer-local-value 'cider-repl-type repl-buffer)) - -(defun cider-cljs-pending-p (repl-buffer) - "Returns non nil when REPL-BUFFER is currently a pending cljs repl." - (buffer-local-value 'cider-repl-cljs-upgrade-pending repl-buffer)) - -(defun cider-repl-type-for-buffer (&optional buffer) - "Return the matching connection type (clj or cljs) for BUFFER. -BUFFER defaults to the `current-buffer'. In cljc buffers return -multi. This function infers connection type based on the major mode. -For the REPL type use the function `cider-repl-type'." - (with-current-buffer (or buffer (current-buffer)) - (cond - ((derived-mode-p 'clojurescript-mode) 'cljs) - ((derived-mode-p 'clojurec-mode) cider-clojurec-eval-destination) - ((derived-mode-p 'clojure-mode) 'clj) - (cider-repl-type)))) - -(defun cider-set-repl-type (&optional type) - "Set REPL TYPE to clj or cljs. -Assume that the current buffer is a REPL." - (interactive) - (let ((type (cider-maybe-intern (or type (completing-read - (format "Set REPL type (currently `%s') to: " - cider-repl-type) - '(clj cljs)))))) - (when (or (not (equal cider-repl-type type)) - (null mode-name)) - (setq cider-repl-type type) - (setq mode-name (format "REPL[%s]" type)) - (let ((params (cider--gather-connect-params))) - ;; We need to set current name to something else temporarily to avoid - ;; false name duplication in `nrepl-repl-buffer-name`. - (rename-buffer (generate-new-buffer-name "*dummy-cider-repl-buffer*")) - (rename-buffer (nrepl-repl-buffer-name params)) - (when (and nrepl-log-messages nrepl-messages-buffer) - (with-current-buffer nrepl-messages-buffer - (rename-buffer (nrepl-messages-buffer-name params)))))))) - -(defun cider--choose-reusable-repl-buffer (params) - "Find connection-less REPL buffer and ask the user for confirmation. -Return nil if no such buffers exists or the user has chosen not to reuse -the buffer. If multiple dead REPLs exist, ask the user to choose one. -PARAMS is a plist as received by `cider-repl-create'." - (when-let* ((repls (seq-filter (lambda (b) - (with-current-buffer b - (and (derived-mode-p 'cider-repl-mode) - (not (process-live-p (get-buffer-process b)))))) - (buffer-list)))) - (let* ((proj-dir (plist-get params :project-dir)) - (host (plist-get params :host)) - (port (plist-get params :port)) - (type (plist-get params :repl-type)) - (scored-repls - (mapcar (lambda (b) - (let ((bparams (ignore-errors (cider--gather-connect-params nil b)))) - (when (eq type (plist-get bparams :repl-type)) - (cons b (+ - (if (equal proj-dir (plist-get bparams :project-dir)) 8 0) - (if (equal host (plist-get bparams :host)) 4 0) - (if (equal port (plist-get bparams :port)) 2 0)))))) - repls)) - (sorted-repls (mapcar #'car (seq-sort-by #'cdr #'> (delq nil scored-repls))))) - (cond ((null sorted-repls) nil) - ((and (= 1 (length sorted-repls)) - (eq cider-reuse-dead-repls 'prompt)) - (if (y-or-n-p (format "A dead REPL %s exists. Reuse buffer? " (car sorted-repls))) - (car sorted-repls) - (and (y-or-n-p "Kill dead REPL buffer?") - (kill-buffer (car sorted-repls)) - nil))) - ((and (< 1 (length sorted-repls)) - (memq cider-reuse-dead-repls '(prompt auto))) - (if (y-or-n-p "Dead REPL buffers exist. Select one to reuse? ") - (get-buffer (completing-read "REPL buffer to reuse: " (mapcar #'buffer-name sorted-repls) - nil t nil nil (car sorted-repls))) - (and (y-or-n-p "Kill all dead REPL buffers?") - (mapc #'kill-buffer sorted-repls) - nil))) - (cider-reuse-dead-repls ;; fallthrough for 'auto / 'any / other non-nil values - (car sorted-repls)))))) - -(declare-function cider-default-err-handler "cider-eval") -(declare-function cider-repl-mode "cider-repl") -(declare-function cider-repl--state-handler "cider-repl") -(declare-function cider-repl-reset-markers "cider-repl") -(defvar-local cider-session-name nil) -(defvar-local cider-repl-init-function nil) -(defvar-local cider-launch-params nil) -(defun cider-repl-create (params) - "Create new repl buffer. -PARAMS is a plist which contains :repl-type, :host, :port, :project-dir, -:repl-init-function and :session-name. When non-nil, :repl-init-function -must be a function with no arguments which is called after repl creation -function with the repl buffer set as current." - ;; Connection might not have been set as yet. Please don't send requests in - ;; this function, but use cider--connected-handler instead. - (let ((buffer (or (plist-get params :repl-buffer) - (and cider-reuse-dead-repls - (cider--choose-reusable-repl-buffer params)) - (get-buffer-create (generate-new-buffer-name "*cider-uninitialized-repl*")))) - (ses-name (or (plist-get params :session-name) - (cider-make-session-name params)))) - (with-current-buffer buffer - (setq-local sesman-system 'CIDER) - (setq-local default-directory (or (plist-get params :project-dir) default-directory)) - ;; creates a new session if session with ses-name doesn't already exist - (sesman-add-object 'CIDER ses-name buffer 'allow-new) - (unless (derived-mode-p 'cider-repl-mode) - (cider-repl-mode)) - (setq nrepl-err-handler #'cider-default-err-handler - ;; used as a new-repl marker in cider-set-repl-type - mode-name nil - cider-session-name ses-name - nrepl-project-dir (plist-get params :project-dir) - ;; Cljs repls are pending until they are upgraded. See cider-repl--state-handler - cider-repl-type (plist-get params :repl-type) - cider-repl-cljs-upgrade-pending (plist-get params :cider-repl-cljs-upgrade-pending) - ;; ran at the end of cider--connected-handler - cider-repl-init-function (plist-get params :repl-init-function) - cider-launch-params params) - (when-let ((type (plist-get params :cljs-repl-type))) - (setq cider-cljs-repl-type type)) - (cider-repl-reset-markers) - (add-hook 'nrepl-response-handler-functions #'cider-repl--state-handler nil 'local) - (add-hook 'nrepl-connected-hook #'cider--connected-handler nil 'local) - (add-hook 'nrepl-disconnected-hook #'cider--disconnected-handler nil 'local) - (current-buffer)))) - - -;;; Current/other REPLs - -(defun cider--no-repls-user-error (type) - "Throw \"No REPL\" user error customized for TYPE." - (let ((type (cond - ((or (eq type 'multi) (eq type 'any)) - "clj or cljs") - ((listp type) - (mapconcat #'identity type " or ")) - (type)))) - (user-error "No %s REPLs in current session \"%s\"" - type (car (sesman-current-session 'CIDER))))) - -(defun cider-current-repl (&optional type ensure) - "Get the most recent REPL of TYPE from the current session. -TYPE is either clj, cljs, multi or any. -When nil, infer the type from the current buffer. -If ENSURE is non-nil, throw an error if either there is -no linked session or there is no REPL of TYPE within the current session." - (let ((type (cider-maybe-intern type))) - (if (and (derived-mode-p 'cider-repl-mode) - (or (null type) - (eq 'any type) - (eq cider-repl-type type))) - ;; shortcut when in REPL buffer - (current-buffer) - (let* ((type (or type (cider-repl-type-for-buffer))) - (repls (cider-repls type ensure)) - (repl (if (<= (length repls) 1) - (car repls) - ;; pick the most recent one - (seq-find (lambda (b) - (member b repls)) - (buffer-list))))) - (if (and ensure (null repl)) - (cider--no-repls-user-error type) - repl))))) - -(defun cider--match-repl-type (type buffer) - "Return non-nil if TYPE matches BUFFER's REPL type." - (let ((buffer-repl-type (cider-repl-type buffer))) - (cond ((null buffer-repl-type) nil) - ((or (null type) (eq type 'multi) (eq type 'any)) t) - ((listp type) (member buffer-repl-type type)) - (t - (or (string= type buffer-repl-type) - (let ((capabilities - (buffer-local-value 'cider-connection-capabilities buffer))) - (cond ((listp type) - (cl-some (lambda (it) (member it capabilities)) type)) - (t (member type capabilities))))))))) - -(defun cider--get-host-from-session (session) - "Returns the host associated with SESSION." - (plist-get (cider--gather-session-params session) - :host)) - -(defun cider--make-sessions-list-with-hosts (sessions) - "Makes a list of SESSIONS and their hosts. -Returns a list of the form ((session1 host1) (session2 host2) ...)." - (mapcar (lambda (session) - (list session (cider--get-host-from-session session))) - sessions)) - -(defun cider--get-sessions-with-same-host (session sessions) - "Returns a list of SESSIONS with the same host as SESSION." - (mapcar #'car - (seq-filter (lambda (x) - (string-equal (cadr x) - (cider--get-host-from-session session))) - (cider--make-sessions-list-with-hosts sessions)))) - -(defun cider--extract-connections (sessions) - "Returns a flattened list of all session buffers in SESSIONS." - (cl-reduce (lambda (x y) - (append x (cdr y))) - sessions - :initial-value '())) - -(defun cider-repls (&optional type ensure) - "Return cider REPLs of TYPE from the current session. -If TYPE is nil or multi, return all REPLs. If TYPE is a list of types, -return only REPLs of type contained in the list. If ENSURE is non-nil, -throw an error if no linked session exists." - (let ((type (cond - ((listp type) - (mapcar #'cider-maybe-intern type)) - ((cider-maybe-intern type)))) - (repls (pcase cider-merge-sessions - ('host - (if ensure - (or (cider--extract-connections (cider--get-sessions-with-same-host - (sesman-current-session 'CIDER) - (sesman-current-sessions 'CIDER))) - (user-error "No linked %s sessions" 'CIDER)) - (cider--extract-connections (cider--get-sessions-with-same-host - (sesman-current-session 'CIDER) - (sesman-current-sessions 'CIDER))))) - ('project - (if ensure - (or (cider--extract-connections (sesman-current-sessions 'CIDER)) - (user-error "No linked %s sessions" 'CIDER)) - (cider--extract-connections (sesman-current-sessions 'CIDER)))) - (_ (cdr (if ensure - (sesman-ensure-session 'CIDER) - (sesman-current-session 'CIDER))))))) - (or (seq-filter (lambda (b) - (unless - (cider-cljs-pending-p b) - (cider--match-repl-type type b))) - repls) - (when ensure - (cider--no-repls-user-error type))))) - -(defun cider-map-repls (which function) - "Call FUNCTION once for each appropriate REPL as indicated by WHICH. -The function is called with one argument, the REPL buffer. The appropriate -connections are found by inspecting the current buffer. WHICH is one of -the following keywords: - :auto - Act on the connections whose type matches the current buffer. In - `cljc' files, mapping happens over both types of REPLs. - :clj (:cljs) - Map over clj (cljs)) REPLs only. - :clj-strict (:cljs-strict) - Map over clj (cljs) REPLs but signal a - `user-error' in `clojurescript-mode' (`clojure-mode'). Use this for - commands only supported in Clojure (ClojureScript). -Error is signaled if no REPL buffers of specified type exist in current -session." - (declare (indent 1)) - (let ((cur-type (cider-repl-type-for-buffer))) - (cl-case which - (:clj-strict (when (eq cur-type 'cljs) - (user-error "Clojure-only operation requested in a ClojureScript buffer"))) - (:cljs-strict (when (eq cur-type 'clj) - (user-error "ClojureScript-only operation requested in a Clojure buffer")))) - (let* ((type (cl-case which - ((:clj :clj-strict) 'clj) - ((:cljs :cljs-strict) 'cljs) - (:auto (if (eq cur-type 'multi) - '(clj cljs) - cur-type)))) - (ensure (cl-case which - (:auto nil) - (t 'ensure))) - (repls (cider-repls type ensure))) - (mapcar function repls)))) - -;; REPLs double as connections in CIDER, so it's useful to be able to refer to -;; them as connections in certain contexts. -(defalias 'cider-current-connection #'cider-current-repl) -(defalias 'cider-connections #'cider-repls) -(defalias 'cider-map-connections #'cider-map-repls) -(defalias 'cider-connection-type-for-buffer #'cider-repl-type-for-buffer) - -;; Deprecated after #2324 (introduction of sesman) - -(define-obsolete-function-alias 'cider-current-repl-buffer #'cider-current-repl "0.18") -(define-obsolete-function-alias 'cider-repl-buffers #'cider-repls "0.18") -(define-obsolete-function-alias 'cider-current-session #'cider-nrepl-eval-session "0.18") -(define-obsolete-function-alias 'cider-current-tooling-session #'cider-nrepl-tooling-session "0.18") -(define-obsolete-function-alias 'nrepl-connection-buffer-name #'nrepl-repl-buffer-name "0.18") - -(provide 'cider-connection) - -;;; cider-connection.el ends here diff --git a/elpa/cider-1.12.0/cider-debug.el b/elpa/cider-1.12.0/cider-debug.el @@ -1,796 +0,0 @@ -;;; cider-debug.el --- CIDER interaction with the cider.debug nREPL middleware -*- lexical-binding: t; -*- - -;; Copyright © 2015-2023 Bozhidar Batsov, Artur Malabarba and CIDER contributors - -;; Author: Artur Malabarba <bruce.connor.am@gmail.com> - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see <http://www.gnu.org/licenses/>. - -;;; Commentary: - -;; Instrument code with `cider-debug-defun-at-point', and when the code is -;; executed cider-debug will kick in. See this function's doc for more -;; information. - -;;; Code: - -(require 'map) -(require 'seq) -(require 'subr-x) - -(require 'spinner) - -(require 'cider-browse-ns) -(require 'cider-client) -(require 'cider-eval) -(require 'cider-inspector) -(require 'cider-util) -(require 'cider-common) -(require 'nrepl-client) ; `nrepl--mark-id-completed' -(require 'nrepl-dict) - - -;;; Customization -(defgroup cider-debug nil - "Presentation and behavior of the cider debugger." - :prefix "cider-debug-" - :group 'cider - :package-version '(cider . "0.10.0")) - -(defface cider-debug-code-overlay-face - '((((class color) (background light)) :background "grey80") - (((class color) (background dark)) :background "grey30")) - "Face used to mark code being debugged." - :package-version '(cider . "0.9.1")) - -(defface cider-debug-prompt-face - '((t :underline t :inherit font-lock-builtin-face)) - "Face used to highlight keys in the debug prompt." - :package-version '(cider . "0.10.0")) - -(defface cider-enlightened-face - '((((class color) (background light)) :inherit cider-result-overlay-face - :box (:color "darkorange" :line-width -1)) - (((class color) (background dark)) :inherit cider-result-overlay-face - ;; "#dd0" is a dimmer yellow. - :box (:color "#990" :line-width -1))) - "Face used to mark enlightened sexps and their return values." - :package-version '(cider . "0.11.0")) - -(defface cider-enlightened-local-face - '((((class color) (background light)) :weight bold :foreground "darkorange") - (((class color) (background dark)) :weight bold :foreground "yellow")) - "Face used to mark enlightened locals (not their values)." - :package-version '(cider . "0.11.0")) - -(defcustom cider-debug-prompt 'overlay - "If and where to show the keys while debugging. -If `minibuffer', show it in the minibuffer along with the return value. -If `overlay', show it in an overlay above the current function. -If t, do both. -If nil, don't list available keys at all." - :type '(choice (const :tag "Show in minibuffer" minibuffer) - (const :tag "Show above function" overlay) - (const :tag "Show in both places" t) - (const :tag "Don't list keys" nil)) - :package-version '(cider . "0.10.0")) - -(defcustom cider-debug-use-overlays t - "Whether to highlight debugging information with overlays. -Takes the same possible values as `cider-use-overlays', but only applies to -values displayed during debugging sessions. -To control the overlay that lists possible keys above the current function, -configure `cider-debug-prompt' instead." - :type '(choice (const :tag "End of line" t) - (const :tag "Bottom of screen" nil) - (const :tag "Both" both)) - :package-version '(cider . "0.9.1")) - -(make-obsolete 'cider-debug-print-length 'cider-debug-print-options "0.20") -(make-obsolete 'cider-debug-print-level 'cider-debug-print-options "0.20") -(make-obsolete-variable 'cider-debug-print-options 'cider-print-options "0.21") - - -;;; Implementation -(declare-function cider-browse-ns--combined-vars-with-meta "cider-browse-ns") - -(defun cider-browse-instrumented-defs () - "List all instrumented definitions." - (interactive) - (if-let* ((all (thread-first (cider-nrepl-send-sync-request '("op" "debug-instrumented-defs")) - (nrepl-dict-get "list")))) - (with-current-buffer (cider-popup-buffer cider-browse-ns-buffer t) - (let ((inhibit-read-only t)) - (dolist (list all) - (let* ((ns (car list)) - (ns-vars-with-meta (cider-browse-ns--combined-vars-with-meta ns)) - (instrumented-meta (nrepl-dict-filter (lambda (k _) - (member k list)) - ns-vars-with-meta))) - (cider-browse-ns--list (current-buffer) ns - instrumented-meta - ns))))) - (message "No currently instrumented definitions"))) - -(defun cider--debug-response-handler (response) - "Handles RESPONSE from the cider.debug middleware." - (nrepl-dbind-response response (status id causes) - (when (member "enlighten" status) - (cider--handle-enlighten response)) - (when (or (member "eval-error" status) - (member "stack" status)) - ;; TODO: Make the error buffer a bit friendlier when we're just printing - ;; the stack. - (cider--render-stacktrace-causes causes)) - (when (member "need-debug-input" status) - (cider--handle-debug response)) - (when (member "done" status) - (nrepl--mark-id-completed id)))) - -(defun cider--debug-init-connection () - "Initialize a connection with the cider.debug middleware." - (cider-nrepl-send-request - (thread-last - (map-merge 'list - '(("op" "init-debugger")) - (cider--nrepl-print-request-map fill-column)) - (seq-mapcat #'identity)) - #'cider--debug-response-handler)) - - -;;; Debugging overlays -(defconst cider--fringe-arrow-string - #("." 0 1 (display (left-fringe right-triangle))) - "Used as an overlay's before-string prop to place a fringe arrow.") - -(defun cider--debug-display-result-overlay (value) - "Place an overlay at point displaying VALUE." - (when cider-debug-use-overlays - ;; This is cosmetic, let's ensure it doesn't break the session no matter what. - (ignore-errors - ;; Result - (cider--make-result-overlay (cider-font-lock-as-clojure value) - :where (point-marker) - :type 'debug-result - 'before-string cider--fringe-arrow-string) - ;; Code - (cider--make-overlay (save-excursion (clojure-backward-logical-sexp 1) (point)) - (point) 'debug-code - 'face 'cider-debug-code-overlay-face - ;; Higher priority than `show-paren'. - 'priority 2000)))) - - -;;; Minor mode -(defvar-local cider--debug-mode-response nil - "Response that triggered current debug session. -Set by `cider--turn-on-debug-mode'.") - -(defcustom cider-debug-display-locals nil - "If non-nil, local variables are displayed while debugging. -Can be toggled at any time with `\\[cider-debug-toggle-locals]'." - :type 'boolean - :package-version '(cider . "0.10.0")) - -(defcustom cider-debug-prompt-commands - '((?c "continue" "continue") - (?C "continue-all" nil) - (?n "next" "next") - (?i "in" "in") - (?o "out" "out") - (?O "force-out" nil) - (?h "here" "here") - (?e "eval" "eval") - (?p "inspect" "inspect") - (?P "inspect-prompt" nil) - (?l "locals" "locals") - (?j "inject" "inject") - (?s "stacktrace" "stacktrace") - (?t "trace" "trace") - (?q "quit" "quit")) - "A list of debugger command specs. - -Specs are in the format (KEY COMMAND-NAME DISPLAY-NAME?) where KEY is a -character which is mapped to the command COMMAND-NAME is a valid debug -command to be passed to the cider-nrepl middleware DISPLAY-NAME is the -string displayed in the debugger overlay - -If DISPLAY-NAME is nil, that command is hidden from the overlay but still -callable. The rest of the commands are displayed in the same order as this -list." - :type '(alist :key-type character - :value-type (list - (string :tag "command name") - (choice (string :tag "display name") nil))) - :package-version '(cider . "0.24.0")) - -(defun cider--debug-format-locals-list (locals) - "Return a string description of list LOCALS. -Each element of LOCALS should be a list of at least two elements." - (if locals - (let ((left-col-width - ;; To right-indent the variable names. - (apply #'max (mapcar (lambda (l) (string-width (car l))) locals)))) - ;; A format string to build a format string. :-P - (mapconcat (lambda (l) (format (format " %%%ds: %%s\n" left-col-width) - (propertize (car l) 'face 'font-lock-variable-name-face) - (cider-font-lock-as-clojure (cadr l)))) - locals "")) - "")) - -(defun cider--debug-propertize-prompt-commands () - "In-place format the command display names for the `cider-debug-prompt' overlay." - (mapc (lambda (spec) - (cl-destructuring-bind (char _cmd disp-name) spec - (when-let* ((pos (cl-position char disp-name))) - (put-text-property pos (1+ pos) 'face 'cider-debug-prompt-face disp-name)))) - cider-debug-prompt-commands)) - -(defun cider--debug-prompt (commands) - "Return prompt to display for COMMANDS." - ;; Force `default' face, otherwise the overlay "inherits" the face of the text - ;; after it. - (format (propertize "%s\n" 'face 'default) - (cl-reduce - (lambda (prompt spec) - (cl-destructuring-bind (_char cmd disp) spec - (if (and disp (cl-find cmd commands :test 'string=)) - (concat prompt " " disp) - prompt))) - cider-debug-prompt-commands - :initial-value ""))) - -(defvar-local cider--debug-prompt-overlay nil) - -(defun cider--debug-mode-redisplay () - "Display the input prompt to the user." - (nrepl-dbind-response cider--debug-mode-response (debug-value input-type locals) - ;; input-type is an unsorted collection of command names, - ;; as sent by `cider.nrepl.middleware.debug/read-debug-input` - (when (or (eq cider-debug-prompt t) - (eq cider-debug-prompt 'overlay)) - (if (overlayp cider--debug-prompt-overlay) - (overlay-put cider--debug-prompt-overlay - 'before-string (cider--debug-prompt input-type)) - (setq cider--debug-prompt-overlay - (cider--make-overlay - (max (car (cider-defun-at-point 'bounds)) - (window-start)) - nil 'debug-prompt - 'before-string (cider--debug-prompt input-type))))) - (let* ((value (concat " " cider-eval-result-prefix - (cider-font-lock-as-clojure - (or debug-value "#unknown#")))) - (to-display - (concat (when cider-debug-display-locals - (cider--debug-format-locals-list locals)) - (when (or (eq cider-debug-prompt t) - (eq cider-debug-prompt 'minibuffer)) - (cider--debug-prompt input-type)) - (when (or (not cider-debug-use-overlays) - (eq cider-debug-use-overlays 'both)) - value)))) - (if (> (string-width to-display) 0) - (message "%s" to-display) - ;; If there's nothing to display in the minibuffer. Just send the value - ;; to the Messages buffer. - (message "%s" value) - (message nil))))) - -(defun cider-debug-toggle-locals () - "Toggle display of local variables." - (interactive) - (setq cider-debug-display-locals (not cider-debug-display-locals)) - (cider--debug-mode-redisplay)) - -(defun cider--debug-lexical-eval (key form &optional callback _point) - "Eval FORM in the lexical context of debug session given by KEY. -Do nothing if CALLBACK is provided. -Designed to be used as `cider-interactive-eval-override' and called instead -of `cider-interactive-eval' in debug sessions." - ;; The debugger uses its own callback, so if the caller is passing a callback - ;; we return nil and let `cider-interactive-eval' do its thing. - (unless callback - (cider-debug-mode-send-reply (format "{:response :eval, :code %s}" form) - key) - t)) - -(defvar cider--debug-mode-tool-bar-map - (let ((tool-bar-map (make-sparse-keymap))) - (tool-bar-add-item "right-arrow" #'cider-debug-mode-send-reply :next :label "Next step") - (tool-bar-add-item "next-node" #'cider-debug-mode-send-reply :continue :label "Continue") - (tool-bar-add-item "jump-to" #'cider-debug-mode-send-reply :out :label "Out of sexp") - (tool-bar-add-item "exit" #'cider-debug-mode-send-reply :quit :label "Quit") - tool-bar-map)) - -(defvar cider--debug-mode-map - (let ((map (make-sparse-keymap))) - ;; Bind the `:here` command to both h and H, because it behaves differently - ;; if invoked with an uppercase letter. - (define-key map "h" #'cider-debug-move-here) - (define-key map "H" #'cider-debug-move-here) - (define-key map "L" #'cider-debug-toggle-locals) - map) - "The active keymap during a debugging session.") - -(define-minor-mode cider--debug-mode - "Mode active during debug sessions. -In order to work properly, this mode must be activated by -`cider--turn-on-debug-mode'." - :init-value nil :lighter " DEBUG" :keymap '() - (if cider--debug-mode - (if cider--debug-mode-response - (nrepl-dbind-response cider--debug-mode-response (input-type) - ;; A debug session is an ongoing eval, but it's annoying to have the - ;; spinner spinning while you debug. - (when spinner-current (spinner-stop)) - (setq-local tool-bar-map cider--debug-mode-tool-bar-map) - (add-hook 'kill-buffer-hook #'cider--debug-quit nil 'local) - (add-hook 'before-revert-hook #'cider--debug-quit nil 'local) - (unless (consp input-type) - (error "Activated debug-mode on a message not asking for commands: %s" cider--debug-mode-response)) - ;; Integrate with eval commands. - (setq cider-interactive-eval-override - (apply-partially #'cider--debug-lexical-eval - (nrepl-dict-get cider--debug-mode-response "key"))) - ;; Map over the key->command alist and set the keymap - (mapc - (lambda (p) - (let ((char (car p))) - (unless (= char ?h) ; `here' needs a special command. - (define-key cider--debug-mode-map (string char) #'cider-debug-mode-send-reply)) - (when (= char ?o) - (define-key cider--debug-mode-map (string (upcase ?o)) #'cider-debug-mode-send-reply)))) - cider-debug-prompt-commands) - (cider--debug-propertize-prompt-commands) - ;; Show the prompt. - (cider--debug-mode-redisplay) - ;; If a sync request is ongoing, the user can't act normally to - ;; provide input, so we enter `recursive-edit'. - (when nrepl-ongoing-sync-request - (recursive-edit))) - (cider--debug-mode -1) - (if (called-interactively-p 'any) - (user-error (substitute-command-keys "Don't call this mode manually, use `\\[universal-argument] \\[cider-eval-defun-at-point]' instead")) - (error "Attempt to activate `cider--debug-mode' without setting `cider--debug-mode-response' first"))) - (setq cider-interactive-eval-override nil) - (setq cider--debug-mode-response nil) - ;; We wait a moment before clearing overlays and the read-onlyness, so that - ;; cider-nrepl has a chance to send the next message, and so that the user - ;; doesn't accidentally hit `n' between two messages (thus editing the code). - (when-let* ((proc (unless nrepl-ongoing-sync-request - (get-buffer-process (cider-current-repl))))) - (accept-process-output proc 1)) - (unless cider--debug-mode - (setq buffer-read-only nil) - (cider--debug-remove-overlays (current-buffer))) - (when nrepl-ongoing-sync-request - (ignore-errors (exit-recursive-edit))))) - -(defun cider--debug-remove-overlays (&optional buffer) - "Remove CIDER debug overlays from BUFFER if variable `cider--debug-mode' is nil." - (when (or (not buffer) (buffer-live-p buffer)) - (with-current-buffer (or buffer (current-buffer)) - (unless cider--debug-mode - (kill-local-variable 'tool-bar-map) - (remove-overlays nil nil 'category 'debug-result) - (remove-overlays nil nil 'category 'debug-code) - (setq cider--debug-prompt-overlay nil) - (remove-overlays nil nil 'category 'debug-prompt))))) - -(defun cider--debug-set-prompt (value) - "Set `cider-debug-prompt' to VALUE, then redisplay." - (setq cider-debug-prompt value) - (cider--debug-mode-redisplay)) - -(easy-menu-define cider-debug-mode-menu cider--debug-mode-map - "Menu for CIDER debug mode." - `("CIDER Debugger" - ["Next step" (cider-debug-mode-send-reply ":next") :keys "n"] - ["Continue" (cider-debug-mode-send-reply ":continue") :keys "c"] - ["Continue non-stop" (cider-debug-mode-send-reply ":continue-all") :keys "C"] - ["Move out of sexp" (cider-debug-mode-send-reply ":out") :keys "o"] - ["Forced move out of sexp" (cider-debug-mode-send-reply ":out" nil true) :keys "O"] - ["Move to current position" (cider-debug-mode-send-reply ":here") :keys "h"] - ["Quit" (cider-debug-mode-send-reply ":quit") :keys "q"] - "--" - ["Evaluate in current scope" (cider-debug-mode-send-reply ":eval") :keys "e"] - ["Inject value" (cider-debug-mode-send-reply ":inject") :keys "i"] - ["Inspect current value" (cider-debug-mode-send-reply ":inspect") :keys "p"] - ["Inspect expression" (cider-debug-mode-send-reply ":inspect-prompt") :keys "P"] - ["Inspect local variables" (cider-debug-mode-send-reply ":locals") :keys "l"] - "--" - ("Configure keys prompt" - ["Don't show keys" (cider--debug-set-prompt nil) :style toggle :selected (eq cider-debug-prompt nil)] - ["Show in minibuffer" (cider--debug-set-prompt 'minibuffer) :style toggle :selected (eq cider-debug-prompt 'minibuffer)] - ["Show above function" (cider--debug-set-prompt 'overlay) :style toggle :selected (eq cider-debug-prompt 'overlay)] - ["Show in both places" (cider--debug-set-prompt t) :style toggle :selected (eq cider-debug-prompt t)] - "--" - ["List locals" cider-debug-toggle-locals :style toggle :selected cider-debug-display-locals]) - ["Customize" (customize-group 'cider-debug)])) - -(defun cider--uppercase-command-p () - "Return non-nil if the last command was uppercase letter." - (ignore-errors - (let ((case-fold-search nil)) - (string-match "[[:upper:]]" (string last-command-event))))) - -(defun cider-debug-mode-send-reply (command &optional key force) - "Reply to the message that started current bufer's debugging session. -COMMAND is sent as the input option. KEY can be provided to reply to a -specific message. If FORCE is non-nil, send a \"force?\" argument in the -message." - (interactive (list - (if (symbolp last-command-event) - (symbol-name last-command-event) - (ignore-errors - (concat ":" (cadr (assoc last-command-event cider-debug-prompt-commands))))) - nil - (cider--uppercase-command-p))) - (when (and (string-prefix-p ":" command) force) - (setq command (format "{:response %s :force? true}" command))) - (cider-nrepl-send-unhandled-request - `("op" "debug-input" - "input" ,(or command ":quit") - "key" ,(or key (nrepl-dict-get cider--debug-mode-response "key")))) - (ignore-errors (cider--debug-mode -1))) - -(defun cider--debug-quit () - "Send a :quit reply to the debugger. Used in hooks." - (when cider--debug-mode - (cider-debug-mode-send-reply ":quit") - (message "Quitting debug session"))) - - -;;; Movement logic -(defconst cider--debug-buffer-format "*cider-debug %s*") - -(defun cider--debug-trim-code (code) - "Remove whitespace and reader macros from the start of the CODE. -Return trimmed CODE." - (replace-regexp-in-string "\\`#[a-z]+[\n\r[:blank:]]*" "" code)) - -(declare-function cider-set-buffer-ns "cider-mode") -(defun cider--initialize-debug-buffer (code ns id &optional reason) - "Create a new debugging buffer with CODE and namespace NS. -ID is the id of the message that instrumented CODE. -REASON is a keyword describing why this buffer was necessary." - (let ((buffer-name (format cider--debug-buffer-format id))) - (if-let* ((buffer (get-buffer buffer-name))) - (cider-popup-buffer-display buffer 'select) - (with-current-buffer (cider-popup-buffer buffer-name 'select - #'clojure-mode 'ancillary) - (cider-set-buffer-ns ns) - (setq buffer-undo-list nil) - (let ((inhibit-read-only t) - (buffer-undo-list t)) - (erase-buffer) - (insert (format "%s" (cider--debug-trim-code code))) - (when code - (insert "\n\n\n;; We had to create this temporary buffer because we couldn't find the original definition. That probably happened because " - reason - ".") - (fill-paragraph)) - (font-lock-ensure) - (set-buffer-modified-p nil)))) - (switch-to-buffer buffer-name) - (goto-char (point-min)))) - -(defun cider--debug-goto-keyval (key) - "Find KEY in current sexp or return nil." - (when-let* ((limit (ignore-errors (save-excursion (up-list) (point))))) - (search-forward-regexp (concat "\\_<" (regexp-quote key) "\\_>") - limit 'noerror))) - -(defun cider--debug-skip-ignored-forms () - "Skip past all forms ignored with #_ reader macro." - ;; Logic taken from `clojure--search-comment-macro-internal' - (while (looking-at (concat "[ ,\r\t\n]*" clojure--comment-macro-regexp)) - (let ((md (match-data)) - (start (match-beginning 1))) - (goto-char start) - ;; Count how many #_ we got and step by that many sexps - (clojure-forward-logical-sexp - (count-matches (rx "#_") (elt md 0) (elt md 1)))))) - -(defun cider--debug-move-point (coordinates) - "Place point on after the sexp specified by COORDINATES. -COORDINATES is a list of integers that specify how to navigate into the -sexp that is after point when this function is called. - -As an example, a COORDINATES list of '(1 0 2) means: - - enter next sexp then `forward-sexp' once, - - enter next sexp, - - enter next sexp then `forward-sexp' twice. - -In the following snippet, this takes us to the (* x 2) sexp (point is left -at the end of the given sexp). - - (letfn [(twice [x] - (* x 2))] - (twice 15)) - -In addition to numbers, a coordinate can be a string. This string names the -key of a map, and it means \"go to the value associated with this key\"." - (condition-case-unless-debug nil - ;; Navigate through sexps inside the sexp. - (let ((in-syntax-quote nil)) - (while coordinates - (while (clojure--looking-at-non-logical-sexp) - (forward-sexp)) - ;; An `@x` is read as (deref x), so we pop coordinates once to account - ;; for the extra depth, and move past the @ char. - (if (eq ?@ (char-after)) - (progn (forward-char 1) - (pop coordinates)) - (down-list) - ;; Are we entering a syntax-quote? - (when (looking-back "`\\(#{\\|[{[(]\\)" (line-beginning-position)) - ;; If we are, this affects all nested structures until the next `~', - ;; so we set this variable for all following steps in the loop. - (setq in-syntax-quote t)) - (when in-syntax-quote - ;; A `(. .) is read as (seq (concat (list .) (list .))). This pops - ;; the `seq', since the real coordinates are inside the `concat'. - (pop coordinates) - ;; Non-list seqs like `[] and `{} are read with - ;; an extra (apply vector ...), so pop it too. - (unless (eq ?\( (char-before)) - (pop coordinates))) - ;; #(...) is read as (fn* ([] ...)), so we patch that here. - (when (looking-back "#(" (line-beginning-position)) - (pop coordinates)) - (if coordinates - (let ((next (pop coordinates))) - (when in-syntax-quote - ;; We're inside the `concat' form, but we need to discard the - ;; actual `concat' symbol from the coordinate. - (setq next (1- next))) - ;; String coordinates are map keys. - (if (stringp next) - (cider--debug-goto-keyval next) - (clojure-forward-logical-sexp next) - (when in-syntax-quote - (clojure-forward-logical-sexp 1) - (forward-sexp -1) - ;; Here a syntax-quote is ending. - (let ((match (when (looking-at "~@?") - (match-string 0)))) - (when match - (setq in-syntax-quote nil)) - ;; A `~@' is read as the object itself, so we don't pop - ;; anything. - (unless (equal "~@" match) - ;; Anything else (including a `~') is read as a `list' - ;; form inside the `concat', so we need to pop the list - ;; from the coordinates. - (pop coordinates)))))) - ;; If that extra pop was the last coordinate, this represents the - ;; entire #(...), so we should move back out. - (backward-up-list))) - ;; Finally skip past all #_ forms - (cider--debug-skip-ignored-forms)) - ;; Place point at the end of instrumented sexp. - (clojure-forward-logical-sexp 1)) - ;; Avoid throwing actual errors, since this happens on every breakpoint. - (error (message "Can't find instrumented sexp, did you edit the source?")))) - -(defun cider--debug-position-for-code (code) - "Return non-nil if point is roughly before CODE. -This might move point one line above." - (or (looking-at-p (regexp-quote code)) - (let ((trimmed (regexp-quote (cider--debug-trim-code code)))) - (or (looking-at-p trimmed) - ;; If this is a fake #dbg injected by `C-u - ;; C-M-x', then the sexp we want is actually on - ;; the line above. - (progn (forward-line -1) - (looking-at-p trimmed)))))) - -(defun cider--debug-find-source-position (response &optional create-if-needed) - "Return a marker of the position after the sexp specified in RESPONSE. -This marker might be in a different buffer! If the sexp can't be -found (file that contains the code is no longer visited or has been -edited), return nil. However, if CREATE-IF-NEEDED is non-nil, a new buffer -is created in this situation and the return value is never nil. - -Follow the \"line\" and \"column\" entries in RESPONSE, and check whether -the code at point matches the \"code\" entry in RESPONSE. If it doesn't, -assume that the code in this file has been edited, and create a temp buffer -holding the original code. -Either way, navigate inside the code by following the \"coor\" entry which -is a coordinate measure in sexps." - (nrepl-dbind-response response (code file line column ns original-id coor) - (when (or code (and file line column)) - ;; This is for restoring current-buffer. - (save-excursion - (let ((out)) - ;; We prefer in-source debugging. - (when-let* ((buf (and file line column - (ignore-errors - (cider--find-buffer-for-file file))))) - ;; The logic here makes it hard to use `with-current-buffer'. - (with-current-buffer buf - ;; This is for restoring point inside buf. - (save-excursion - ;; Get to the proper line & column in the file - (forward-line (- line (line-number-at-pos))) - ;; Column numbers in the response start from 1. - ;; Convert to Emacs system which starts from 0 - ;; Inverse of `cider-column-number-at-pos'. - (move-to-column (max 0 (1- column))) - ;; Check if it worked - (when (cider--debug-position-for-code code) - ;; Find the desired sexp. - (cider--debug-move-point coor) - (setq out (point-marker)))))) - ;; But we can create a temp buffer if that fails. - (or out - (when create-if-needed - (cider--initialize-debug-buffer - code ns original-id - (if (and line column) - "you edited the code" - "your nREPL version is older than 0.2.11")) - (save-excursion - (cider--debug-move-point coor) - (point-marker))))))))) - -(defun cider--handle-debug (response) - "Handle debugging notification. -RESPONSE is a message received from the nrepl describing the input -needed. It is expected to contain at least \"key\", \"input-type\", and -\"prompt\", and possibly other entries depending on the input-type." - (nrepl-dbind-response response (debug-value key input-type prompt inspect) - (condition-case-unless-debug e - (progn - (pcase input-type - ("expression" (cider-debug-mode-send-reply - (condition-case nil - (cider-read-from-minibuffer - (or prompt "Expression: ")) - (quit "nil")) - key)) - ((pred sequencep) - (let* ((marker (cider--debug-find-source-position response 'create-if-needed))) - (pop-to-buffer (marker-buffer marker)) - (goto-char marker)) - ;; The overlay code relies on window boundaries, but point could have been - ;; moved outside the window by some other code. Redisplay here to ensure the - ;; visible window includes point. - (redisplay) - ;; Remove overlays AFTER redisplaying! Otherwise there's a visible - ;; flicker even if we immediately recreate the overlays. - (cider--debug-remove-overlays) - (when cider-debug-use-overlays - (cider--debug-display-result-overlay debug-value)) - (setq cider--debug-mode-response response) - (cider--debug-mode 1))) - (when inspect - (setq cider-inspector--current-repl (cider-current-repl)) - (cider-inspector--render-value inspect))) - ;; If something goes wrong, we send a "quit" or the session hangs. - (error (cider-debug-mode-send-reply ":quit" key) - (message "Error encountered while handling the debug message: %S" e))))) - -(defun cider--handle-enlighten (response) - "Handle an enlighten notification. -RESPONSE is a message received from the nrepl describing the value and -coordinates of a sexp. Create an overlay after the specified sexp -displaying its value." - (when-let* ((marker (cider--debug-find-source-position response))) - (with-current-buffer (marker-buffer marker) - (save-excursion - (goto-char marker) - (clojure-backward-logical-sexp 1) - (nrepl-dbind-response response (debug-value erase-previous) - (when erase-previous - (remove-overlays (point) marker 'category 'enlighten)) - (when debug-value - (if (memq (char-before marker) '(?\) ?\] ?})) - ;; Enlightening a sexp looks like a regular return value, except - ;; for a different border. - (cider--make-result-overlay (cider-font-lock-as-clojure debug-value) - :where (cons marker marker) - :type 'enlighten - :prepend-face 'cider-enlightened-face) - ;; Enlightening a symbol uses a more abbreviated format. The - ;; result face is the same as a regular result, but we also color - ;; the symbol with `cider-enlightened-local-face'. - (cider--make-result-overlay (cider-font-lock-as-clojure debug-value) - :format "%s" - :where (cons (point) marker) - :type 'enlighten - 'face 'cider-enlightened-local-face)))))))) - - -;;; Move here command -;; This is the inverse of `cider--debug-move-point'. However, that algorithm is -;; complicated, and trying to code its inverse would probably be insane. -;; Instead, we find the coordinate by trial and error. -(defun cider--debug-find-coordinates-for-point (target &optional list-so-far) - "Return the coordinates list for reaching TARGET. -Assumes that the next thing after point is a logical Clojure sexp and that -TARGET is inside it. The returned list is suitable for use in -`cider--debug-move-point'. LIST-SO-FAR is for internal use." - (when (looking-at (rx (or "(" "[" "#{" "{"))) - (let ((starting-point (point))) - (unwind-protect - (let ((x 0)) - ;; Keep incrementing the last coordinate until we've moved - ;; past TARGET. - (while (condition-case nil - (progn (goto-char starting-point) - (cider--debug-move-point (append list-so-far (list x))) - (< (point) target)) - ;; Not a valid coordinate. Move back a step and stop here. - (scan-error (setq x (1- x)) - nil)) - (setq x (1+ x))) - (setq list-so-far (append list-so-far (list x))) - ;; We have moved past TARGET, now determine whether we should - ;; stop, or if target is deeper inside the previous sexp. - (if (or (= target (point)) - (progn (forward-sexp -1) - (<= target (point)))) - list-so-far - (goto-char starting-point) - (cider--debug-find-coordinates-for-point target list-so-far))) - ;; `unwind-protect' clause. - (goto-char starting-point))))) - -(defun cider-debug-move-here (&optional force) - "Skip any breakpoints up to point. -The boolean value of FORCE will be sent in the reply." - (interactive (list (cider--uppercase-command-p))) - (unless cider--debug-mode - (user-error "`cider-debug-move-here' only makes sense during a debug session")) - (let ((here (point))) - (nrepl-dbind-response cider--debug-mode-response (line column) - (if (and line column (buffer-file-name)) - (progn ;; Get to the proper line & column in the file - (forward-line (1- (- line (line-number-at-pos)))) - (move-to-column column)) - (beginning-of-defun-raw)) - ;; Is HERE inside the sexp being debugged? - (when (or (< here (point)) - (save-excursion - (forward-sexp 1) - (> here (point)))) - (user-error "Point is outside the sexp being debugged")) - ;; Move forward until start of sexp. - (comment-normalize-vars t) - (comment-forward (point-max)) - ;; Find the coordinate and send it. - (cider-debug-mode-send-reply - (format "{:response :here, :coord %s :force? %s}" - (cider--debug-find-coordinates-for-point here) - (if force "true" "false")))))) - - -;;; User commands -;;;###autoload -(defun cider-debug-defun-at-point () - "Instrument the \"top-level\" expression at point. -If it is a defn, dispatch the instrumented definition. Otherwise, -immediately evaluate the instrumented expression. - -While debugged code is being evaluated, the user is taken through the -source code and displayed the value of various expressions. At each step, -a number of keys will be prompted to the user." - (interactive) - (cider-eval-defun-at-point 'debug-it)) - -(provide 'cider-debug) -;;; cider-debug.el ends here diff --git a/elpa/cider-1.12.0/cider-doc.el b/elpa/cider-1.12.0/cider-doc.el @@ -1,582 +0,0 @@ -;;; cider-doc.el --- CIDER documentation functionality -*- lexical-binding: t -*- - -;; Copyright © 2014-2023 Bozhidar Batsov, Jeff Valk and CIDER contributors - -;; Author: Jeff Valk <jv@jeffvalk.com> - -;; This program is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see <http://www.gnu.org/licenses/>. - -;; This file is not part of GNU Emacs. - -;;; Commentary: - -;; Mode for formatting and presenting documentation - -;;; Code: - -(require 'cider-common) -(require 'cider-docstring) -(require 'subr-x) -(require 'cider-util) -(require 'cider-popup) -(require 'cider-client) -(require 'cider-clojuredocs) -(require 'nrepl-dict) -(require 'button) -(require 'easymenu) -(require 'cider-browse-spec) - -;; we defer loading those, as org-table is a big library -(declare-function org-table-map-tables "org-table") -(declare-function org-table-align "org-table") -(declare-function org-table-begin "org-table") -(declare-function org-table-end "org-table") - - -;;; Variables - -(defgroup cider-doc nil - "Documentation for CIDER." - :prefix "cider-doc-" - :group 'cider) - -(defcustom cider-doc-auto-select-buffer t - "Controls whether to auto-select the doc popup buffer." - :type 'boolean - :group 'cider-doc - :package-version '(cider . "0.15.0")) - -(declare-function cider-apropos "cider-apropos") -(declare-function cider-apropos-select "cider-apropos") -(declare-function cider-apropos-documentation "cider-apropos") -(declare-function cider-apropos-documentation-select "cider-apropos") - -(defvar cider-doc-map - (let (cider-doc-map) - (define-prefix-command 'cider-doc-map) - (define-key cider-doc-map (kbd "a") #'cider-apropos) - (define-key cider-doc-map (kbd "C-a") #'cider-apropos) - (define-key cider-doc-map (kbd "s") #'cider-apropos-select) - (define-key cider-doc-map (kbd "C-s") #'cider-apropos-select) - (define-key cider-doc-map (kbd "f") #'cider-apropos-documentation) - (define-key cider-doc-map (kbd "C-f") #'cider-apropos-documentation) - (define-key cider-doc-map (kbd "e") #'cider-apropos-documentation-select) - (define-key cider-doc-map (kbd "C-e") #'cider-apropos-documentation-select) - (define-key cider-doc-map (kbd "d") #'cider-doc) - (define-key cider-doc-map (kbd "C-d") #'cider-doc) - (define-key cider-doc-map (kbd "c") #'cider-clojuredocs) - (define-key cider-doc-map (kbd "C-c") #'cider-clojuredocs) - (define-key cider-doc-map (kbd "w") #'cider-clojuredocs-web) - (define-key cider-doc-map (kbd "C-w") #'cider-clojuredocs-web) - (define-key cider-doc-map (kbd "j") #'cider-javadoc) - (define-key cider-doc-map (kbd "C-j") #'cider-javadoc) - cider-doc-map) - "CIDER documentation keymap.") - -(defconst cider-doc-menu - '("Documentation" - ["CiderDoc" cider-doc] - ["JavaDoc in browser" cider-javadoc] - "--" - ["Clojuredocs" cider-clojuredocs] - ["Clojuredocs in browser" cider-clojuredocs-web] - ["Refresh ClojureDocs cache" cider-clojuredocs-refresh-cache] - "--" - ["Search symbols" cider-apropos] - ["Search symbols & select" cider-apropos-select] - ["Search documentation" cider-apropos-documentation] - ["Search documentation & select" cider-apropos-documentation-select] - "--" - ["Configure Doc buffer" (customize-group 'cider-docview-mode)]) - "CIDER documentation submenu.") - - -;;; cider-docview-mode - -(defgroup cider-docview-mode nil - "Formatting/fontifying documentation viewer." - :prefix "cider-docview-" - :group 'cider) - -(defcustom cider-docview-fill-column fill-column - "Fill column for docstrings in doc buffer." - :type 'list - :group 'cider-docview-mode - :package-version '(cider . "0.7.0")) - - -;; Faces - -(defface cider-docview-emphasis-face - '((t (:inherit default :underline t))) - "Face for emphasized text." - :group 'cider-docview-mode - :package-version '(cider . "0.7.0")) - -(defface cider-docview-strong-face - '((t (:inherit default :underline t :weight bold))) - "Face for strongly emphasized text." - :group 'cider-docview-mode - :package-version '(cider . "0.7.0")) - -(defface cider-docview-literal-face - '((t (:inherit font-lock-string-face))) - "Face for literal text." - :group 'cider-docview-mode - :package-version '(cider . "0.7.0")) - -(defface cider-docview-table-border-face - '((t (:inherit shadow))) - "Face for table borders." - :group 'cider-docview-mode - :package-version '(cider . "0.7.0")) - - -;; Colors & Theme Support - -(defvar cider-docview-code-background-color - (cider-scale-background-color) - "Background color for code blocks.") - -(advice-add 'enable-theme :after #'cider--docview-adapt-to-theme) -(advice-add 'disable-theme :after #'cider--docview-adapt-to-theme) -(defun cider--docview-adapt-to-theme (&rest _) - "When theme is changed, update `cider-docview-code-background-color'." - (setq cider-docview-code-background-color (cider-scale-background-color))) - -;; Mode & key bindings - -(defvar cider-docview-mode-map - (let ((map (make-sparse-keymap))) - (define-key map "q" #'cider-popup-buffer-quit-function) - (define-key map "g" #'cider-docview-clojuredocs) - (define-key map "G" #'cider-docview-clojuredocs-web) - (define-key map "j" #'cider-docview-javadoc) - (define-key map "s" #'cider-docview-source) - (define-key map (kbd "<backtab>") #'backward-button) - (define-key map (kbd "TAB") #'forward-button) - (easy-menu-define cider-docview-mode-menu map - "Menu for CIDER's doc mode" - `("CiderDoc" - ["Look up in Clojuredocs" cider-docview-clojuredocs] - ["Look up in Clojuredocs (browser)" cider-docview-clojuredocs-web] - ["JavaDoc in browser" cider-docview-javadoc] - ["Jump to source" cider-docview-source] - "--" - ["Quit" cider-popup-buffer-quit-function] - )) - map)) - -(defvar cider-docview-symbol) -(defvar cider-docview-javadoc-url) -(defvar cider-docview-file) -(defvar cider-docview-line) - -(define-derived-mode cider-docview-mode help-mode "Doc" - "Major mode for displaying CIDER documentation. - -\\{cider-docview-mode-map}" - (setq buffer-read-only t) - (setq-local sesman-system 'CIDER) - (when cider-special-mode-truncate-lines - (setq-local truncate-lines t)) - (setq-local electric-indent-chars nil) - (setq-local cider-docview-symbol nil) - (setq-local cider-docview-javadoc-url nil) - (setq-local cider-docview-file nil) - (setq-local cider-docview-line nil)) - - -;;; Interactive functions - -(defun cider-docview-javadoc () - "Open the Javadoc for the current class, if available." - (interactive) - (if cider-docview-javadoc-url - (browse-url cider-docview-javadoc-url) - (error "No Javadoc available for %s" cider-docview-symbol))) - -(defun cider-javadoc-handler (symbol-name) - "Invoke the nREPL \"info\" op on SYMBOL-NAME if available." - (when symbol-name - (let* ((info (cider-var-info symbol-name)) - (url (nrepl-dict-get info "javadoc"))) - (if url - (browse-url url) - (user-error "No Javadoc available for %s" symbol-name))))) - -(defun cider-javadoc (arg) - "Open Javadoc documentation in a popup buffer. - -Prompts for the symbol to use, or uses the symbol at point, depending on -the value of `cider-prompt-for-symbol'. With prefix arg ARG, does the -opposite of what that option dictates." - (interactive "P") - (cider-ensure-connected) - (cider-ensure-op-supported "info") - (funcall (cider-prompt-for-symbol-function arg) - "Javadoc for" - #'cider-javadoc-handler)) - -(defun cider-docview-source () - "Open the source for the current symbol, if available." - (interactive) - (if cider-docview-file - (if-let* ((buffer (and (not (cider--tooling-file-p cider-docview-file)) - (cider-find-file cider-docview-file)))) - (cider-jump-to buffer (if cider-docview-line - (cons cider-docview-line nil) - cider-docview-symbol) - nil) - (user-error - (substitute-command-keys - "Can't find the source because it wasn't defined with `cider-eval-buffer'"))) - (error "No source location for %s" cider-docview-symbol))) - -(defvar cider-buffer-ns) - -(declare-function cider-clojuredocs-lookup "cider-clojuredocs") - -(defun cider-docview-clojuredocs () - "Return the clojuredocs documentation for `cider-docview-symbol'." - (interactive) - (if cider-buffer-ns - (cider-clojuredocs-lookup cider-docview-symbol) - (error "%s cannot be looked up on ClojureDocs" cider-docview-symbol))) - -(declare-function cider-clojuredocs-web-lookup "cider-clojuredocs") - -(defun cider-docview-clojuredocs-web () - "Open the clojuredocs documentation for `cider-docview-symbol' in a web browser." - (interactive) - (if cider-buffer-ns - (cider-clojuredocs-web-lookup cider-docview-symbol) - (error "%s cannot be looked up on ClojureDocs" cider-docview-symbol))) - -(defconst cider-doc-buffer "*cider-doc*") - -(defun cider-create-doc-buffer (symbol &optional compact) - "Populates *cider-doc* with the documentation for SYMBOL, -favoring a COMPACT format if specified." - (when-let* ((info (cider-var-info symbol))) - (cider-docview-render (cider-make-popup-buffer cider-doc-buffer nil 'ancillary) symbol info compact))) - -(defun cider-create-compact-doc-buffer (symbol) - "Populates *cider-doc* with the documentation for SYMBOL. - -Favors a compact rendering of docstrings" - (cider-create-doc-buffer symbol :compact)) - -(defun cider-doc-lookup (symbol) - "Look up documentation for SYMBOL." - (if-let* ((buffer (cider-create-doc-buffer symbol))) - (cider-popup-buffer-display buffer cider-doc-auto-select-buffer) - (user-error "Symbol %s not resolved" symbol))) - -(defun cider-doc (&optional arg) - "Open Clojure documentation in a popup buffer. - -Prompts for the symbol to use, or uses the symbol at point, depending on -the value of `cider-prompt-for-symbol'. With prefix arg ARG, does the -opposite of what that option dictates." - (interactive "P") - (cider-ensure-connected) - (funcall (cider-prompt-for-symbol-function arg) - "Doc for" - #'cider-doc-lookup)) - - -;;; Font Lock and Formatting - -(defun cider-docview-fontify-code-blocks (buffer mode) - "Font lock BUFFER code blocks using MODE and remove markdown characters. -This processes the triple backtick GFM markdown extension. An overlay is used -to shade the background. Blocks are marked to be ignored by other fonification -and line wrap." - (with-current-buffer buffer - (save-excursion - (while (search-forward-regexp "```\n" nil t) - (replace-match "") - (let ((beg (point)) - (bg `(:background ,cider-docview-code-background-color))) - (when (search-forward-regexp "```\n" nil t) - (replace-match "") - (cider-font-lock-region-as mode beg (point)) - (overlay-put (make-overlay beg (point)) 'font-lock-face bg) - (put-text-property beg (point) 'block 'code))))))) - -(defun cider-docview-fontify-literals (buffer) - "Font lock BUFFER literal text and remove backtick markdown characters. -Preformatted code text blocks are ignored." - (with-current-buffer buffer - (save-excursion - (while (search-forward "`" nil t) - (if (eq (get-text-property (point) 'block) 'code) - (forward-char) - (progn - (replace-match "") - (let ((beg (point))) - (when (search-forward "`" (line-end-position) t) - (replace-match "") - (put-text-property beg (point) 'font-lock-face 'cider-docview-literal-face))))))))) - -(defun cider-docview-fontify-emphasis (buffer) - "Font lock BUFFER emphasized text and remove markdown characters. -One '*' represents emphasis, multiple '**'s represent strong emphasis. -Preformatted code text blocks are ignored." - (with-current-buffer buffer - (save-excursion - (while (search-forward-regexp "\\(*+\\)\\(\\w\\)" nil t) - (if (eq (get-text-property (point) 'block) 'code) - (forward-char) - (progn - (replace-match "\\2") - (let ((beg (1- (point))) - (face (if (> (length (match-string 1)) 1) - 'cider-docview-strong-face - 'cider-docview-emphasis-face))) - (when (search-forward-regexp "\\(\\w\\)\\*+" (line-end-position) t) - (replace-match "\\1") - (put-text-property beg (point) 'font-lock-face face))))))))) - -(defun cider-docview-format-tables (buffer) - "Align BUFFER tables and dim borders. -This processes the GFM table markdown extension using `org-table'. -Tables are marked to be ignored by line wrap." - (require 'org-table) - (with-current-buffer buffer - (save-excursion - (let ((border 'cider-docview-table-border-face)) - (org-table-map-tables - (lambda () - (org-table-align) - (goto-char (org-table-begin)) - (while (search-forward-regexp "[+|-]" (org-table-end) t) - (put-text-property (match-beginning 0) (match-end 0) 'font-lock-face border)) - (put-text-property (org-table-begin) (org-table-end) 'block 'table))))))) - -(defun cider-docview-wrap-text (buffer) - "For text in BUFFER not propertized as 'block', apply line wrap." - (with-current-buffer buffer - (save-excursion - (while (not (eobp)) - (unless (get-text-property (point) 'block) - (fill-region (point) (line-end-position))) - (forward-line))))) - - -;;; Rendering - -(defun cider-docview-render-java-doc (buffer text) - "Emit into BUFFER formatted doc TEXT for a Java class or member." - (with-current-buffer buffer - (let ((beg (point))) - (insert text) - (save-excursion - (goto-char beg) - (cider-docview-fontify-code-blocks buffer 'java-mode) ; left alone hereafter - (cider-docview-fontify-literals buffer) - (cider-docview-fontify-emphasis buffer) - (cider-docview-format-tables buffer) ; may contain literals, emphasis - (cider-docview-wrap-text buffer))))) ; ignores code, table blocks - -(defun cider--abbreviate-file-protocol (file-with-protocol) - "Abbreviate the file-path in `file:/path/to/file' of FILE-WITH-PROTOCOL. - -Same for `jar:file:...!/' segments." - (let ((result (if (string-match "^\\(jar\\|zip\\):\\(file:.+\\)!/\\(.+\\)" file-with-protocol) - (match-string 3 file-with-protocol) - file-with-protocol))) - (if (string-match "\\`file:\\(.*\\)" result) - (let ((file (match-string 1 result)) - (proj-dir (clojure-project-dir))) - (if (and proj-dir - (file-in-directory-p file proj-dir)) - (file-relative-name file proj-dir) - file)) - result))) - -(defun cider-docview-render-info (buffer info &optional compact for-tooltip) - "Emit into BUFFER formatted INFO for the Clojure or Java symbol, -in a COMPACT format is specified, FOR-TOOLTIP if specified." - (let* ((ns (nrepl-dict-get info "ns")) - (name (nrepl-dict-get info "name")) - (added (nrepl-dict-get info "added")) - (depr (nrepl-dict-get info "deprecated")) - (macro (nrepl-dict-get info "macro")) - (special (nrepl-dict-get info "special-form")) - (builtin (nrepl-dict-get info "built-in")) ;; babashka specific - (forms (when-let* ((str (nrepl-dict-get info "forms-str"))) - (split-string str "\n"))) - (args (or (nrepl-dict-get info "annotated-arglists") - (when-let* ((str (nrepl-dict-get info "arglists-str"))) - (split-string str "\n")))) - (rendered-fragments (cider--render-docstring (list "doc-fragments" (unless compact - (nrepl-dict-get info "doc-fragments")) - "doc-block-tags-fragments" (nrepl-dict-get info "doc-block-tags-fragments") - "doc-first-sentence-fragments" (nrepl-dict-get info "doc-first-sentence-fragments")))) - (fetched-doc (nrepl-dict-get info "doc")) - (doc (or rendered-fragments - (if compact - (cider-docstring--dumb-trim fetched-doc) - fetched-doc) - (unless compact - "Not documented."))) - (url (nrepl-dict-get info "url")) - (class (nrepl-dict-get info "class")) - (member (nrepl-dict-get info "member")) - (javadoc (nrepl-dict-get info "javadoc")) - (super (nrepl-dict-get info "super")) - (ifaces (nrepl-dict-get info "interfaces")) - (spec (nrepl-dict-get info "spec")) - (clj-name (if ns (concat ns "/" name) name)) - (java-name (if member (concat class "/" member) class)) - (see-also (nrepl-dict-get info "see-also"))) - (cider--help-setup-xref (list #'cider-doc-lookup (format "%s/%s" ns name)) nil buffer) - (with-current-buffer buffer - (cl-flet ((emit (text &optional face sep) - (insert (if face - (propertize text 'font-lock-face face) - text) - (or sep "\n")))) - (emit (if class java-name clj-name) 'font-lock-function-name-face) - (when super - (emit (concat "Extends: " (cider-font-lock-as 'java-mode super)))) - (when ifaces - (emit (concat "Implements: " (cider-font-lock-as 'java-mode (car ifaces)))) - ;; choose a separator that will produce correct alignment on monospace and regular fonts: - (let ((sep (if for-tooltip - " " - " "))) - (dolist (iface (cdr ifaces)) -