-
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 doesn't play well with 'pretty-mode' #429
Comments
Can't reproduce. From (ns test.core)
(defn foo
"I don't do a whole lot."
[x]
(println x "Hello, World!"))
(foo 1)
(partial foo 1) Rename (ns test.core)
(defn bar
"I don't do a whole lot."
[x]
(println x "Hello, World!"))
(bar 1)
(partial bar 1) You already had a bar and wanted foo to have the same name or something? Need more details to reproduce. |
@expez bad copy-pasta in the first listing. fixed. |
Do you get the same if you load the code into the REPL before doing the refactoring? E.g. by using C-c C-k in CIDER? |
i can see that you are using prettifing symbols on partial. try the feature
with prettifing switched off. it might confuse the column counts cljr works
with.
…On Sat, 18 Aug 2018, 13:48 Eugene Yaremenko, ***@***.***> wrote:
This is what I'm getting
[image: https://i.imgur.com/oXPZD7z.png]
<https://camo.githubusercontent.com/8ec487650865bde5fe823adeda1762261fdeb314/68747470733a2f2f692e696d6775722e636f6d2f6f58505a44377a2e706e67>
[image: https://i.imgur.com/xBNvQhC.png]
<https://camo.githubusercontent.com/2cd4ccd9c6ad8bb7754b4e1273b282c293c9a60f/68747470733a2f2f692e696d6775722e636f6d2f78424e765168432e706e67>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#429 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA9PnjRk-CtU_RY1mDKhfKddrwI7I2vpks5uSA0fgaJpZM4WCgnu>
.
|
@expez Doesn't help. Btw it reports @benedekfazekas OMG 🙀 it helped. I don't understand. |
So basically |
@benedekfazekas Checked. You are right. It affects column number. It's strange that there was no error report or warning of any kind. Can be really nasty in big projects. Now we just need to decide who's bug it is 😄 |
yeah. used to love prettify symbols too. but it messes with cljr and even
more importantly with indentation. I still use it but very tuned down.
…On Sun, 19 Aug 2018, 11:42 Eugene Yaremenko, ***@***.***> wrote:
it might confuse the column counts cljr works
@benedekfazekas <https://github.com/benedekfazekas> Just caked. You are
right. It affects column number.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#429 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA9PniiNa3AES_JTWdWnQ087bfAvkPq0ks5uSUD8gaJpZM4WCgnu>
.
|
Is there a way to get the 'real' column number? If not, then I don't see how cljr could handle this... |
@expez Indirect buffers probably can be used for this. They can have different modes then the original one. |
@expez Also in this case |
Keep in mind that this also doesn't work: (defn foo
"I don't do a whole lot."
[x]
(println x "Hello, World!"))
(foo 1)
(partial map identity) (foo 1) I don't know how |
@JAremko We can get issues at both ends of this:
Both of these will report the wrong column number with pretty-mode, but sometimes it isn't fatal (because you're still inside the same symbol). |
also the 2. is reported by the middleware (refactor-nrepl) which is clojure
code working with the files in the filesystem. no way that will know about
prettify symbols
…On Mon, 20 Aug 2018, 10:20 Lars Andersen, ***@***.***> wrote:
@JAremko <https://github.com/JAremko> We can get issues at both ends of
this:
1. At the beginning we send down line/col to the middleware to find
occurrences of a symbol to work on .
2. After the middleware returns we use line/col to make edits to the
right locations.
Both of these will report the wrong column number with pretty-mode, but
sometimes it isn't fatal (because you're still inside the same symbol).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#429 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA9PniS-ymA6l3OpiUdl2k1eKLIThJ0Kks5uSnE2gaJpZM4WCgnu>
.
|
Thankfully it doesn't have to, because the pretty symbols only really exist in emacs. The regular text is what's stored in the file on disk. |
right. sorry, what i meant is that the line/cols returned by the middleware
are not emacs buffer related
…On Mon, 20 Aug 2018, 12:13 Lars Andersen, ***@***.***> wrote:
no way that will know about prettify symbols
Thankfully it doesn't have to, because the pretty symbols only really
exist in emacs. The regular text is what's stored in the file on disk.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#429 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA9PnqPk0jdgnafQepKPseFYqnY8oKWHks5uSou6gaJpZM4WCgnu>
.
|
has anyone found a workaround for this issue? |
@Nimamoh I ended up simply disabling fancy symbols primary because they also mess up long line highlight. |
Steps to reproduce the problem
Run
cljr-rename-symbol
withfoo
renamed tobar
onExpected behavior
Actual behavior
Environment & Version information
CIDER version
clj-refactor.el version
2.4.0-SNAPSHOT
Lein version
Leiningen 2.8.1 on Java 10.0.1 OpenJDK 64-Bit Server VM
Emacs version
26.1
The text was updated successfully, but these errors were encountered: