Comments (7)
Interesting, we'd have to investigate. Should be a thin/easy fix.
Can you paste (meta #'csv/read-csv)
here? Following the same prior steps
Thanks - V
from cider.
Thanks for taking a look!
Here's the result of meta:
(meta #'csv/read-csv)
;; => {:arglists ([input & options]),
;; :doc
;; "Reads CSV-data from input (String or java.io.Reader) into a lazy\n sequence of vectors.\n\n Valid options are\n :separator (default \\,)\n :quote (default \\\")",
;; :line 87,
;; :column 1,
;; :file "clojure/data/csv.clj",
;; :name read-csv,
;; :ns #namespace[clojure.data.csv]}
from cider.
Thanks! That looks right.
My actual question should have been:
What's the result of (clojure.java.io/resource "clojure/data/csv.clj")
?
from cider.
I noticed this a while ago too with the new sync-deps
functionality in Clojure 1.12, the new libraries are added to the classpath but Cider couldn't find their source definition without a full REPL restart.
Looked into it a little and the issue appeared to be something to do with orchard.info/file-info
which cider-nrepl's info middleware uses to transform the :file key - for some strange reason it exhibited different behaviour when called from a info
op vs a regular eval op.
Might have something to do with interactive vs tooling sessions or thread-local vars?
from cider.
Could be anything. It might as well have to do with the classpath - probably Orchard's classpath matches 1:1 the JVM classpath at startup time, but newer Clojure features make it grow?
Let me know about (clojure.java.io/resource "clojure/data/csv.clj")
If my diagnostic is right, the fix could be potentially as simlpe as choosing one classloader over the other.
We might also ask around for best practices around classloader choice starting from Clojure 1.12.
from cider.
Dug up my experiment log and ran it again using clojure.data.csv
as the repro:
(ns repro)
(require '[clojure.repl.deps :as deps])
(deps/add-libs {'org.clojure/data.csv {:mvn/version "1.1.0"}})
(require '[clojure.data.csv :as csv])
(require '[clojure.java.io])
(clojure.java.io/resource "clojure/data/csv.clj")
;; => #object[java.net.URL 0x56797bbd "jar:file:/Users/yuhan/.m2/repository/org/clojure/data.csv/1.1.0/data.csv-1.1.0.jar!/clojure/data/csv.clj"]
(require '[orchard.info :as info])
(info/file-info "clojure/data/csv.clj")
;; => {:file
;; #object[java.net.URL 0x56b9da93 "jar:file:/Users/yuhan/.m2/repository/org/clojure/data.csv/1.1.0/data.csv-1.1.0.jar!/clojure/data/csv.clj"],
;; :resource "clojure/data/csv.clj"}
(require '[cider.nrepl.middleware.info :as c.info])
(-> (c.info/info-reply {:ns "repro"
:sym "csv/read-csv"})
(select-keys ["file"]))
;; => {"file"
;; "jar:file:/Users/yuhan/.m2/repository/org/clojure/data.csv/1.1.0/data.csv-1.1.0.jar!/clojure/data/csv.clj"}
;; but cider-find-var on this doesn't work:
csv/read-csv
From an elisp scratch buffer:
(with-current-buffer "repro.clj"
(nrepl-dict-get
(cider-var-info "inc")
"file"))
;; =>
;; "jar:file:/Users/yuhan/.m2/repository/org/clojure/clojure/1.12.0-alpha8/clojure-1.12.0-alpha8.jar!/clojure/core.clj"
(with-current-buffer "repro.clj"
(nrepl-dict-get
(cider-var-info "csv/read-csv")
"file"))
;; =>
;; "clojure/data/csv.clj"
(with-current-buffer "repro.clj"
(nrepl-dict-get
(cider-sync-tooling-eval
"(:file (orchard.info/file-info \"clojure/data/csv.clj\"))"
;; "(:file (cider.nrepl.middleware.info/info-reply \"clojure/core/logic.clj\"))"
)
"value"))
;; =>
;; "#object[java.net.URL 0x7de93292 \"jar:file:/Users/yuhan/.m2/repository/org/clojure/data.csv/1.1.0/data.csv-1.1.0.jar!/clojure/data/csv.clj\"]"
At some point I used cider-debug to instrument orchard.info/file-info and found it was indeed returning different results depending on the context it was called from.. didn't have the time to investigate any further but I hope this helps with narrowing down the cause !
from cider.
Thanks! Seems a good starting point.
from cider.
Related Issues (20)
- `[shadow-cljs]` output lost when repl-ing node http server HOT 2
- I have developed a simple way to search Clojure symbols with CIDER; merge into this package or keep separate? HOT 6
- Customize banner HOT 8
- Can't cider-jack-in to projects with private git dependencies HOT 7
- `cider--error-phase-of-last-exception` can call itself when the cider-nrepl middleware is faulty HOT 3
- Lots of compilation warnings since update to Emacs 29 HOT 4
- `cider-inspector-inspect-last-exception` should inspect specific exceptions, not the last one HOT 3
- `cider-test-run-loaded-tests` not running newly loaded tests after changing REPL namespace HOT 1
- cider-log: multiline items HOT 5
- Auto completion is not reliable after switching to cider-nrepl 0.45.0 HOT 4
- i'm unable to access javadocs HOT 2
- Don't offer to connect to YourKit ports
- cider-ns: jump to file/line on errors
- cider-ns-refresh: summarize errors as an overlay
- Wrong type argument: plistp HOT 13
- Reduce the `nrepl.middleware.print/quota` for interactive eval
- Ability to auto-inspect on repl eval HOT 2
- cider-log may no longer use Logview after timezone change HOT 2
- cider-pprint-eval-defun-to-comment inside form does not print comments in newline HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cider.