Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CIDER-REPL prints entire buffer when symbol not found #1389

Closed
korenyoni opened this issue Oct 29, 2015 · 16 comments
Closed

CIDER-REPL prints entire buffer when symbol not found #1389

korenyoni opened this issue Oct 29, 2015 · 16 comments
Labels

Comments

@korenyoni
Copy link

Ever since bumping tools.nrepl to 0.2.11, CIDER now prints my entire namespace buffer in the REPL if I refer to a symbol that doesn't exist in that namespace.

This wasn't happening before bumbing to that version of tools.nrepl.

I suspected that this was a compatibility issue with the new version tools.nrepl and CIDER, but upgrading to the latest version from the Melpa repo didn't fix it.

Actually, this also extends to errors such as "Can't take value of macro"

@expez expez added the bug label Oct 29, 2015
@scottdw
Copy link
Contributor

scottdw commented Oct 29, 2015

; CIDER 0.10.0snapshot (package: 20151025.1201) (Java 1.8.0_45, Clojure 1.7.0, nREPL 0.2.11)

After executing cider-load-buffer, exceptions at the repl cause the contents of the buffer to be printed after the exception. eg:

user> undefined
CompilerException java.lang.RuntimeException: Unable to resolve symbol: undefined in this context, compiling:(***buffer text removed***:1:6403) 

@bbatsov
Copy link
Member

bbatsov commented Oct 29, 2015

@scottdw What did get with nREPL 0.2.10? @cemerick Any ideas what might be causing this?

@scottdw
Copy link
Contributor

scottdw commented Oct 30, 2015

; CIDER 0.10.0snapshot (package: 20151028.758) (Java 1.8.0_45, Clojure 1.7.0, nREPL 0.2.10)
WARNING: CIDER requires nREPL 0.2.11 (or newer) to work properly
user> undefined
CompilerException java.lang.RuntimeException: Unable to resolve symbol: undefined in this context, compiling:(***temp folder***\form-init6925707551600658869.clj:1:6403) 

Reading through the code in tools.nrepl I think clojure/tools.nrepl@64238a1#diff-a15f8f9db1997aa5418a8345c820a473R68 is the culprit. In load-file file is used to refer to the contents of the file so maybe it should be file-name. But I'm not in a position to rebuild and test nrepl to confirm.

@bbatsov
Copy link
Member

bbatsov commented Oct 30, 2015

@cichli Can you look into this?

@cemerick
Copy link
Contributor

file in the eval context corresponds to *file*, a path, not the contents.

Anyway, I can replicate this. Looks like CIDER is sending a file's contents to eval instead of the filename.

@cemerick
Copy link
Contributor

@scottdw ech, I see what you were referring to re: the connection with load-file:

https://github.com/clojure/tools.nrepl/blob/0d964f9821fd5c13293af79b83bad29fc954dc65/src/main/clojure/clojure/tools/nrepl/middleware/load_file.clj#L80

file-name needs to clobber file in that altered message.

@cemerick
Copy link
Contributor

This is fixed on nREPL master, 0.2.12-SNAPSHOT will be available momentarily. Please test and report confirmation that the problem is resolved (or not).

@scottdw
Copy link
Contributor

scottdw commented Oct 30, 2015

Moving to 0.2.12-SNAPSHOT does resolve this issue and doesn't appear to have introduced any breakages (AFAICT).

@bbatsov
Copy link
Member

bbatsov commented Oct 30, 2015

Guess we need a stable release then.

On Friday, 30 October 2015, Scott Douglas-Watson [email protected]
wrote:

Moving to 0.2.12-SNAPSHOT does resolve this issue and doesn't appear to
have introduced any breakages (AFAICT).


Reply to this email directly or view it on GitHub
#1389 (comment)
.

Best Regards,
Bozhidar Batsov

http://www.batsov.com

@cemerick
Copy link
Contributor

Percolating through hudson now. Expect 0.2.12 in mvn central in an hour or so?

@bbatsov
Copy link
Member

bbatsov commented Oct 30, 2015

Fantastic. I'm on a trip with a computer for the weekend, so someone else
should update CIDER's deps.

On Friday, 30 October 2015, Chas Emerick [email protected] wrote:

Percolating through hudson now. Expect 0.2.12 in mvn central in an hour
or so?


Reply to this email directly or view it on GitHub
#1389 (comment)
.

Best Regards,
Bozhidar Batsov

http://www.batsov.com

@bbatsov
Copy link
Member

bbatsov commented Oct 30, 2015

Without a computer

On Friday, 30 October 2015, Bozhidar Batsov [email protected]
wrote:

Fantastic. I'm on a trip with a computer for the weekend, so someone else
should update CIDER's deps.

On Friday, 30 October 2015, Chas Emerick <[email protected]
javascript:_e(%7B%7D,'cvml','[email protected]');> wrote:

Percolating through hudson now. Expect 0.2.12 in mvn central in an hour
or so?


Reply to this email directly or view it on GitHub
#1389 (comment)
.

Best Regards,
Bozhidar Batsov

http://www.batsov.com

Best Regards,
Bozhidar Batsov

http://www.batsov.com

@korenyoni
Copy link
Author

Eagerly waited until 0.2.12 was up, and it works beautifully! None of this problem anymore. Thanks (:

@korenyoni
Copy link
Author

I'll leave the closing of this issue to the devs, if you guys need to sort things out for CIDER or nREPL.

@Malabarba
Copy link
Member

I can merge and deploy those PRs by @scottdw once I get a confirmation that the release is up.

Malabarba added a commit to clojure-emacs/cider-nrepl that referenced this issue Oct 30, 2015
Malabarba added a commit that referenced this issue Oct 30, 2015
[Fix #1389] Bump the required nREPL version to 0.2.12
@Malabarba
Copy link
Member

Deployed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants