Skip to content

bug: Getting error on LspAttach #2

@farzadmf

Description

@farzadmf

Did you check docs and existing issues?

  • I have read all the plugin docs
  • I have searched the existing issues
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

0.11.15

Operating system/version

MacOS 15.7.2

Describe the bug

I'm using [a heavily customized] LazyVim for Rust, and I basically copy pasted the config from README:

  {
    'alexpasmantier/krust.nvim',
    ft = 'rust',
    opts = {
      keymap = '<leader>ck', -- Set a keymap for Rust buffers (default: false)
      float_win = {
        border = 'rounded', -- Border style: "none", "single", "double", "rounded", "solid", "shadow"
        auto_focus = false, -- Auto-focus float (default: false)
      },
    },
  }

And when I open a Rust file, I get this error:

Error detected while processing LspAttach Autocommands for "*":
Error executing lua callback: ...farzadmf/.local/share/nvim/lazy/krust.nvim/lua/krust.lua:34: attempt to index field 'cmd' (a function value)
stack traceback:
	...farzadmf/.local/share/nvim/lazy/krust.nvim/lua/krust.lua:34: in function 'start'
	.../share/nvim/lazy/amazonq.nvim/lua/amazonq/completion.lua:121: in function 'start'
	....local/share/nvim/lazy/amazonq.nvim/lua/amazonq/init.lua:137: in function <....local/share/nvim/lazy/amazonq.nvim/lua/amazonq/init.lua:130>
	[C]: in function 'nvim_exec_autocmds'
	.../neovim/0.11.5/share/nvim/runtime/lua/vim/lsp/client.lua:1025: in function 'on_attach'
	.../neovim/0.11.5/share/nvim/runtime/lua/vim/lsp/client.lua:575: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>

Steps To Reproduce

Nothing much to add here, basically:

  1. Open a Rust file

Expected Behavior

The plugin seems to be working fine (I think) despite the error, so it would be nice not to get it in the first place (eg, silence the error) ... or better yet, fix it so that it doesn't happen 🙂

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions