-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add compatibility with nREPL 0.4 (#540)
Support with tools.nrepl is kept for now with the assumption that tools.nrepl namespaces would be loaded automatically by `lein repl` or `boot repl`. Support for tools.nrepl will likely be removed after a couple of releases (once mainstream Lein and Boot switch to nREPL 0.4).
- Loading branch information
Showing
28 changed files
with
219 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,13 +43,19 @@ | |
[4] https://tools.ietf.org/html/rfc2017" | ||
{:authors ["Reid 'arrdem' McKenzie <[email protected]>"]} | ||
(:require [cider.nrepl.middleware.slurp :refer [slurp-reply]]) | ||
(:import clojure.tools.nrepl.transport.Transport | ||
java.awt.Image | ||
(:import java.awt.Image | ||
[java.io ByteArrayOutputStream File OutputStream] | ||
[java.net URI URL] | ||
java.nio.file.Path | ||
javax.imageio.ImageIO)) | ||
|
||
;; Compatibility with the legacy tools.nrepl and the new nREPL 0.4.x. | ||
;; The assumption is that if someone is using old lein repl or boot repl | ||
;; they'll end up using the tools.nrepl, otherwise the modern one. | ||
(if (find-ns 'clojure.tools.nrepl) | ||
(import 'clojure.tools.nrepl.transport.Transport) | ||
(import 'nrepl.transport.Transport)) | ||
|
||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
|
||
(defprotocol URLCoercable | ||
|
@@ -80,7 +86,7 @@ | |
[{:keys [session value] :as response}] | ||
(cond | ||
;; FIXME (arrdem 2018-04-03): | ||
;; | ||
;; | ||
;; This could be more generic in terms of tolerating more | ||
;; protocols / schemes | ||
|
||
|
@@ -96,7 +102,7 @@ | |
:body "") | ||
|
||
;; FIXME (arrdem 2018-04-03): | ||
;; | ||
;; | ||
;; This is super snowflakey in terms of only supporting base64 | ||
;; coding this one kind of object. This could definitely be | ||
;; more generic / open to extension but hey at least it's | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,24 @@ | ||
(ns cider.nrepl.middleware.slurp | ||
"Rich reading & handling for CIDER. | ||
Goes with middleware.content-types, providing the capability to | ||
convert URLs to values which can be handled nicely." | ||
{:authors ["Reid 'arrdem' McKenzie <[email protected]>"]} | ||
(:require [clojure.edn :as edn] | ||
[clojure.java.io :as io] | ||
[clojure.string :as str] | ||
[clojure.tools.nrepl.transport :as transport] | ||
[clojure.tools.nrepl.misc :refer [response-for]]) | ||
[clojure.string :as str]) | ||
(:import [java.net MalformedURLException URL] | ||
java.io.ByteArrayOutputStream | ||
[java.nio.file Files Path Paths])) | ||
|
||
(if (find-ns 'clojure.tools.nrepl) | ||
(require | ||
'[clojure.tools.nrepl.misc :refer (response-for)] | ||
'[clojure.tools.nrepl.transport :as transport]) | ||
(require | ||
'[nrepl.misc :refer (response-for)] | ||
'[nrepl.transport :as transport])) | ||
|
||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
|
||
(defmacro if-class | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.