clojure-lsp / clojure-lsp

Clojure & ClojureScript Language Server (LSP) implementation

Home Page:https://clojure-lsp.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Regression] Renaming defrecord results in renaming alias instead of the name

Kaspazza opened this issue · comments

Describe the bug
When I run lsp-rename on defrecord, the places where defrecord is references are replaced in the alias part of the name instead of the changed name.
E.g.
a. We have defrecord Files
b. We have it references somewhere as namespace-a/Files

Run lsp-rename on defrecord Files to FilesC
It changes defrecord name (a.) in that place to FilesC
It changes the reference (b.) from namespace-a/Files to -> FilesCace-a/Files
^ so it replaced the beginning of the reference, instead of the part after the alias.

To Reproduce
Steps to reproduce the behavior:

  1. Go to FilesConf
  2. run lsp-rename to FilesConfig
  3. Go to where it's referenced
  4. It will be renamed at that point from (core-conf-files/->FilesConf) to (->FilesConfigiles/->FilesConf)

Expected behavior
At point 4. It should be renamed from (core-conf-files/->FilesConf) to (core-conf-files/->FilesConfig)
Changing only what's after the alias.

User details (please complete the following information):

  • OS: MacOS M2
  • Editor emacs doom
  • Version: 2024.01.15-12.02.49-nightly mac aarch
    (It was working at version 2022.06.22)

Minimal repro:

(ns foo)

(defrecord MyRecord [])

(ns bar
  (:require [foo :as f]))

(f/MyRecord)