Closed Dioswilson closed 11 months ago
Hi, thanks for reporting. Can you send me the contents of the Lua file and let me know which symbol your cursor was on as you tried to rename? Thanks.
Sure, it happens on(almost) every lua file so can't rename this on a separate file(cursor is on top of "test"):
local test={"thing"}
test[1]="ABC"
I couldn't determine when It happens though, if I create a test.lua inside home dir it works fine, but on every project I create a lua file I have this issue
Ok, it seems to be working wrong with most of the filetypes when running under a project. When runnning in single file mode it works well . With java(jdtls) it doesn't thow any errors but it doesn't work, with C/C++(clangd) I get the same error and with python(pylsp) it works well
Could you send me the link to a project where it does not work? Since I can't reproduce it right now (seems to work for both single file mode and within a project).
Here is my nvim- config, doesn't work there
Also just created a new project with only "test.lua" and .git directory, it first worked, then opened my config tried to rename something there, it didn't work, and the went to rename somthing in test.lua and it didn't work anymore
That's strange, it works for me in your config:
What happens if you run := vim.lsp.buf.rename()
instead of :IncRename
?
Cannot test right now, but is project root the root directory of the project when you run :LspInfo
? For me issues ocurred when that happened
Yes, LspInfo shows this:
Client: lua_ls (id: 2, bufnr: [4])
filetypes: lua
autostart: true
root directory: /home/<me>/Desktop/nvim-config/lua/
cmd: /home/<me>/.local/share/nvim/mason/bin/lua-language-server
I will test when I get home with vim.lsp.buf.rename()
and try to figure out if ant plugin is getting in the way. Also i did try with lspsaga's rename and it worked well
Update: executing := vim.lsp.buf.rename()
works. I will try to figure out if another plugin is getting in the way
I found the issue. It happens whedn the custom-elements-languageserver
LSP is intalled. I uninstalled it and it works fine
Thanks a lot for investigating, I'm glad you figured it out!
Hello, I am having issues making it work on lua files, I've tested it on C,C++ and java and it worked well, but when trying to use it on lua files it doesn't work. I have this sudggeste mapping:
When trying to use it on lua files the dressing window appears for an instant and I get the following error:
[inc_rename] Nothing to rename
Also if I try to use the command manually the command tries to trigger as soon asi I write:Inc
with theE471: Argument required
errorI tried with Lspsaga's rename and it works fine. Lsp I use on Lua is stylua