-
Notifications
You must be signed in to change notification settings - Fork 111
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
cljr-rename-symbol crashes for the first time on an unevaluated namespace (cljr-warn-on-eval 't) #401
Comments
Had the same issue on |
managed to reproduce this. The problem essentially is that cljr can not get the ns for the symbol to be renamed. we use these calls to resolve the ns of the symbol (symbol (cider-symbol-at-point))
(var-info (cljr--var-info symbol))
(ns (nrepl-dict-get var-info "ns")) this calls a cider function which only returns something if the namespace is loaded. this results in a proper fix would be to call there are several workarounds:
|
Thank you, @benedekfazekas, for exploration of this bug and finding workarounds for it. I wonder why code is not loaded if cljr have asked about evaluation before asking for a new name for the symbol and I confirmed evaluation:
Any why after
I actually need to load the whole project (not that example project) to be able to refactor symbol uses through all project files so tried to
Doesn't work.
Could work but haven't tried it yet.
This works. |
Hi!
Cljr fails to rename symbol in code which is successfully compiled and run by
lein test
.Expected behavior
cd /Users/YourName/Desktop
.git clone https://github.com/developer2019/example
/Users/YourName/Desktop/example/src/anagram.clj
in Emacs.M-x cider-mode
<menu-bar> <CIDER> <Start a REPL>
anagrams-for
(line 4, symbol 10) and press M-xcljr-rename-symbol
RET.It tells that project needs to be evaluated, type
y RET
.Actual behavior
cd /Users/YourName/Desktop
.git clone https://github.com/developer2019/example
/Users/YourName/Desktop/example/src/anagram.clj in Emacs
.M-x cider-mode
<menu-bar> <CIDER> <Start a REPL>
anagrams-for
(line 4, symbol 10) and press M-xcljr-rename-symbol
RET.It tells that project needs to be evaluated, type
y RET
.Wrong type argument: char-or-string-p, nil
.Steps to reproduce the problem
cd /Users/YourName/Desktop
.git clone https://github.com/developer2019/example
/Users/YourName/Desktop/example/src/anagram.clj in Emacs
.M-x cider-mode
<menu-bar> <CIDER> <Start a REPL>
anagrams-for
(line 4, symbol 10) and press M-xcljr-rename-symbol
RET.It tells that project needs to be evaluated, type
y RET
.Wrong type argument: char-or-string-p, nil
.Environment & Version information
lein test
compiles this code and runs successfully.clj-refactor.el version information
clj-refactor 2.4.0-SNAPSHOT (package: 20171117.317), refactor-nrepl 2.4.0-SNAPSHOT from MELPA (i. e. latest clj-refactor).
CIDER version information
Leiningen or Boot version
lein test
compiles this project and runs successfully.Emacs version
Operating system
The text was updated successfully, but these errors were encountered: