Clojure-lsp: Off-by-one error when renaming a var that is declared

Created on 29 Jul 2021  路  3Comments  路  Source: clojure-lsp/clojure-lsp

Describe the bug
When I use the document.renameCurrentWord lsp functionality, all of the vars are correctly renamed except for places where it is in a declare call. In that case, the replacement happens one character to the right (leaving the initial letter of the original name around and overwriting the existing character one past the end of the name, usually a closing parenthesis).

Screenshots

https://user-images.githubusercontent.com/603677/127538407-12659260-9b4a-4219-a010-3b674cf4596d.mov

User details (please complete the following information):

  • OS: OSX mojave 10.14.6
  • Editor: vim 8.2 with coc.nvim
  • Version:

clojure-lsp 2021.07.28-14.24.06
clj-kondo 2021.07.28

bug editor

All 3 comments

Thanks for the report, I can confirm the issue, this is actually related with how we are persisting the row/col/name-row/name-col of the declare analysis, you can check that document-highlighting is not correct as well.
I can take a look at this later

It was merged, I'll bump as soon a new clj-kondo release is available

Was this page helpful?
0 / 5 - 0 ratings