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

Renaming deftype scrambles signature #1721

Open
TimoKramer opened this issue Nov 9, 2023 · 0 comments
Open

Renaming deftype scrambles signature #1721

TimoKramer opened this issue Nov 9, 2023 · 0 comments
Labels
bug Something isn't working editor Related to clojure-lsp on a text editor

Comments

@TimoKramer
Copy link
Sponsor

Describe the bug
When renaming a deftype the outcome cuts characters before and after the renamed deftype name.

I am using Neovim 0.9.4 with nvim-lspconfig

To Reproduce
Steps to reproduce the behavior:

  1. Open new buffer
  2. Write (deftype FooBar [foo bar])
  3. Place cursor on FooBar
  4. LSP-rename with FooBarBaz
  5. Renamed to (deftypFooBarBazBaz [foo bar])

Expected behavior
The deftype and all occurrences should be renamed with FooBarBaz.

Screenshots
If applicable, add screenshots to help explain your problem.

Log - client <-> server
[DEBUG][2023-11-09 16:31:00] .../vim/lsp/rpc.lua:284    "rpc.send"      {  jsonrpc = "2.0",  method = "textDocument/didSave",  params = {    text = "(deftype FooBar [foo bar baz])\n",    textDocument = {      uri = "file:///home/timo/projects/temp/deftype-rename/core.clj"    }  }}
[DEBUG][2023-11-09 16:31:54] .../lua/vim/lsp.lua:1391   "LSP[clojure_lsp]"      "client.request"        1       "textDocument/prepareRename"    {  position = {    character = 13,    line = 0  },  textDocument = {    uri = "file:///home/timo/projects/temp/deftype-rename/core.clj"  }}     1
[DEBUG][2023-11-09 16:31:54] .../vim/lsp/rpc.lua:284    "rpc.send"      {  id = 53,  jsonrpc = "2.0",  method = "textDocument/prepareRename",  params = {    position = {      character = 13,      line = 0    },    textDocument = {      uri = "file:///home/timo/projects/temp/deftype-re name/core.clj"    }  }}
[DEBUG][2023-11-09 16:31:54] .../vim/lsp/rpc.lua:387    "rpc.receive"   {  id = 53,  jsonrpc = "2.0",  result = {    ["end"] = {      character = 15,      line = 0    },    start = {      character = 9,      line = 0    }  }}
[DEBUG][2023-11-09 16:31:57] .../lua/vim/lsp.lua:1391   "LSP[clojure_lsp]"      "client.request"        1       "textDocument/rename"   {  newName = "FooBarBaz",  position = {    character = 13,    line = 0  },  textDocument = {    uri = "file:///home/timo/projects/temp/deftype-rename /core.clj"  }}         1
[DEBUG][2023-11-09 16:31:57] .../vim/lsp/rpc.lua:284    "rpc.send"      {  id = 54,  jsonrpc = "2.0",  method = "textDocument/rename",  params = {    newName = "FooBarBaz",    position = {      character = 13,      line = 0    },    textDocument = {      uri = "file:///home/timo/proje cts/temp/deftype-rename/core.clj"    }  }}
[DEBUG][2023-11-09 16:31:57] .../vim/lsp/rpc.lua:387    "rpc.receive"   {  id = 54,  jsonrpc = "2.0",  result = {    changes = {      ["file:///home/timo/projects/temp/deftype-rename/core.clj"] = { {          newText = "FooBarBaz",          range = {            ["end"] = { character = 15,              line = 0            },            start = {              character = 9,              line = 0            }          }        }, {          newText = "FooBarBaz",          range = {            ["end"] = {              character = 15,              line = 0 },            start = {              character = 7,              line = 0            }          }        } }    }  }}
[DEBUG][2023-11-09 16:31:57] .../vim/lsp/rpc.lua:284    "rpc.send"      {  jsonrpc = "2.0",  method = "textDocument/didChange",  params = {    contentChanges = { {        text = "(deftype FooBarBaz [foo bar baz])\n"      } },    textDocument = {      uri = "file:///home/timo/projects/ temp/deftype-rename/core.clj",      version = 83    }  }}
[DEBUG][2023-11-09 16:31:57] .../vim/lsp/rpc.lua:387    "rpc.receive"   {  jsonrpc = "2.0",  method = "textDocument/publishDiagnostics",  params = {    diagnostics = {},    uri = "file:///home/timo/projects/temp/deftype-rename/core.clj"  }}
[DEBUG][2023-11-09 16:31:57] .../vim/lsp/rpc.lua:284    "rpc.send"      {  jsonrpc = "2.0",  method = "textDocument/didChange",  params = {    contentChanges = { {        text = "(deftypFooBarBazBaz [foo bar baz])\n"      } },    textDocument = {      uri = "file:///home/timo/projects /temp/deftype-rename/core.clj",      version = 84    }  }}

User details (please complete the following information):

  • OS: ArchLinux on WSL2 on Windows11
  • Editor: Neovim 0.9.4
  • Version: clojure-lsp 2023.10.30-16.25.41
    clj-kondo 2023.10.21-SNAPSHOT
@TimoKramer TimoKramer added bug Something isn't working editor Related to clojure-lsp on a text editor labels Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working editor Related to clojure-lsp on a text editor
Projects
None yet
Development

No branches or pull requests

1 participant