jmbuhr / otter.nvim

Just ask an otter! 🦦
MIT License
480 stars 11 forks source link

Rename doesn't work with dressing.nvim #139

Closed TroySigX closed 2 months ago

TroySigX commented 2 months ago

I have dressing.nvim installed, which is just a gui for vim.ui.input. Whenever I try :lua require('otter').ask_rename() command, this error appears:

Error executing vim.schedule lua callback: /usr/share/nvim/runtime/lua/vim/lsp/util.lua:473: bad argument #1 to 'gsub' (string expected, got nil)
stack traceback:
    [C]: in function 'gsub'
    /usr/share/nvim/runtime/lua/vim/lsp/util.lua:473: in function 'apply_text_edits'
    /usr/share/nvim/runtime/lua/vim/lsp/util.lua:615: in function 'apply_text_document_edit'
    /usr/share/nvim/runtime/lua/vim/lsp/util.lua:829: in function 'apply_workspace_edit'
    /usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:323: in function </usr/share/nvim/runtime/lua/vim/lsp/handlers.lua:317>
    ...x/.local/share/nvim/lazy/otter.nvim/lua/otter/keeper.lua:477: in function 'handler'
    /usr/share/nvim/runtime/lua/vim/lsp/client.lua:685: in function ''
    vim/_editor.lua: in function <vim/_editor.lua:0>
jmbuhr commented 2 months ago

I have some big changes coming up that will turn otter into a lsp client-server combo, which should make it more consistent with other plugins that hook into such things. I'm expecting this to also fix this bug. https://github.com/jmbuhr/otter.nvim/pull/137

TroySigX commented 2 months ago

Cool, thanks!

jmbuhr commented 2 months ago

I just merged the big rewrite, does that also happen to solve your issue?

TroySigX commented 2 months ago

It works! Thank you so much!