smjonas / inc-rename.nvim

Incremental LSP renaming based on Neovim's command-preview feature.
MIT License
667 stars 9 forks source link

E116: Incompatible with traces.vim: Invalid arguments for function dictwatcherdel #35

Closed fnune closed 11 months ago

fnune commented 1 year ago

Here's my setup:

-- using lazy.nvim
return {
  "smjonas/inc-rename.nvim",
  dependencies = { "stevearc/dressing.nvim" },
  config = function()
    local inc_rename = require("inc_rename")
    inc_rename.setup({ input_buffer_type = "dressing" })

    vim.keymap.set("n", "<leader>rn", function()
      return ":IncRename " .. vim.fn.expand("<cword>")
    end, { expr = true })
  end,
}

The keybinding puts me in command mode with :IncRename theword, but:

  1. No inc rename UI is visible in the buffer
  2. I get the following error message once I hit enter:
[inc-rename] An error occurred in the preview function. Please report this error here: https://github.com/smjonas/inc-rename.nvim/issues:
E116: Invalid arguments for function dictwatcherdel

Additionally, it leaves me in a weird state where I have to hit Ctrl-C for the error message to go away.

Neovim version:

 ~/.dotfiles => nvim --version
NVIM v0.9.0
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
smjonas commented 1 year ago

Thanks for reporting! Two questions:

fnune commented 1 year ago

Here are some screenshots:

image image image

Tried TS as well: image

Output of :LspInfo in Python:

 Press q or <Esc> to close this window. Press <Tab> to view server doc.

 Language client log: /home/fausto/.local/state/nvim/lsp.log
 Detected filetype:   python

 3 client(s) attached to this buffer: 

 Client: pyright (id: 1, bufnr: [1, 44])
    filetypes:       python
    autostart:       true
    root directory:  /home/fausto/Development/company
    cmd:             /home/fausto/.local/share/nvim/mason/bin/pyright-langserver --stdio

 Client: ruff_lsp (id: 2, bufnr: [1, 44])
    filetypes:       python
    autostart:       true
    root directory:  /home/fausto/Development/company
    cmd:             /home/fausto/.local/share/nvim/mason/bin/ruff-lsp

 Client: null-ls (id: 3, bufnr: [1, 44, 77])
    filetypes:       javascript, typescriptreact, typescript, vue, javascriptreact, python, go, lua, sh, json, sql, less, css, scss, sass, org, markdown, cpp, cs, c, proto, java, cuda, html, handlebars, yaml, markdown.mdx, jsonc, graphql, rust
    autostart:       false
    root directory:  /home/fausto/Development/company
    cmd:             <function>

 2 active client(s) not attached to this buffer: 

 Client: tsserver (id: 4, bufnr: [77])
    filetypes:       javascript, javascriptreact, javascript.jsx, typescript, typescriptreact, typescript.tsx
    autostart:       true
    root directory:  Running in single file mode.
    cmd:             /home/fausto/.local/share/nvim/mason/bin/typescript-language-server --stdio

 Client: eslint (id: 5, bufnr: [77])
    filetypes:       javascript, javascriptreact, javascript.jsx, typescript, typescriptreact, typescript.tsx, vue, svelte, astro
    autostart:       true
    root directory:  Running in single file mode.
    cmd:             /home/fausto/.local/share/nvim/mason/bin/vscode-eslint-language-server --stdio

 Configured servers list: bashls, clangd, lua_ls, ruff_lsp, rust_analyzer, sqlls, taplo, tsserver, pyright, yamlls, jsonls, eslint

Output of :LspInfo in TS:

 Press q or <Esc> to close this window. Press <Tab> to view server doc.

 Language client log: /home/fausto/.local/state/nvim/lsp.log
 Detected filetype:   typescriptreact

 3 client(s) attached to this buffer: 

 Client: null-ls (id: 3, bufnr: [1, 44, 77])
    filetypes:       javascript, typescriptreact, typescript, vue, javascriptreact, python, go, lua, sh, json, sql, less, css, scss, sass, org, markdown, cpp, cs, c, proto, java, cuda, html, handlebars, yaml, markdown.mdx, jsonc, graphql, rust
    autostart:       false
    root directory:  /home/fausto/Development/company
    cmd:             <function>

 Client: tsserver (id: 4, bufnr: [77])
    filetypes:       javascript, javascriptreact, javascript.jsx, typescript, typescriptreact, typescript.tsx
    autostart:       true
    root directory:  /home/fausto/Development/company/packages/company-app-frontend
    cmd:             /home/fausto/.local/share/nvim/mason/bin/typescript-language-server --stdio

 Client: eslint (id: 5, bufnr: [77])
    filetypes:       javascript, javascriptreact, javascript.jsx, typescript, typescriptreact, typescript.tsx, vue, svelte, astro
    autostart:       true
    root directory:  /home/fausto/Development/company/packages/company-app-frontend/src
    cmd:             /home/fausto/.local/share/nvim/mason/bin/vscode-eslint-language-server --stdio

 2 active client(s) not attached to this buffer: 

 Client: pyright (id: 1, bufnr: [1, 44])
    filetypes:       python
    autostart:       true
    root directory:  /home/fausto/Development/company
    cmd:             /home/fausto/.local/share/nvim/mason/bin/pyright-langserver --stdio

 Client: ruff_lsp (id: 2, bufnr: [1, 44])
    filetypes:       python
    autostart:       true
    root directory:  /home/fausto/Development/company
    cmd:             /home/fausto/.local/share/nvim/mason/bin/ruff-lsp

 Configured servers list: bashls, clangd, lua_ls, ruff_lsp, rust_analyzer, sqlls, taplo, tsserver, pyright, yamlls, jsonls, eslint
smjonas commented 1 year ago

I was able to reproduce the error using your Nvim config, however I have no idea which plugin might be causing this. You could use binary search to disable a set of plugins until the variable is renamed, i.e. the highlights are shown - unfortunately, I don't have time for this :) (A bisect feature for lazy.nvim would be nice for this btw).

fnune commented 1 year ago

When you say "your Nvim config", do you mean what I pasted in here or my full config from my dotfiles? :sweat_smile:

Sorry, didn't want you to go into so much trouble. I might have some time to help debug further this weekend.

smjonas commented 1 year ago

I meant your Nvim config (https://github.com/fnune/dotfiles/tree/master/neovim/.config/nvim). Thanks for looking into this!

fnune commented 1 year ago

Found it! The incompatible plugin is https://github.com/markonm/traces.vim

Disabling it fixes this issue.

Sorry to have prompted you to spend your time on this. At least it's some documentation here.

smjonas commented 1 year ago

I'm glad you found the issue!

Sorry to have prompted you to spend your time on this. At least it's some documentation here.

No worries at all, it was a valid bug report :)

twnaing commented 11 months ago

I also experienced the same issue.

Spent better part of an hour to work. Glad I found this.

It is a known issue now.

smjonas commented 11 months ago

I also experienced the same issue.

@twnaing Glad you found this issue. I will add a check whether traces.vim is installed to warn other users of this incompatibility