dreamsofcode-io/neovim-python

Unused local 'opts'.

Closed this issue · 3 comments

em0ral commented

I keep getting "unused local 'opts' errors inline when viewing script.

which caused this error whne opening ant python script

"Error executing vim.schedule lua callback: /Users/em0ral/.config/nvim/lua/core/utils.lua:80: attempt to index a nil value
stack traceback:
        /Users/em0ral/.config/nvim/lua/core/utils.lua:80: in function </Users/em0ral/.config/nvim/lua/core/utils.lua:55>"

{
    "mfussenegger/nvim-dap",
    config = function(_, opts) <------------------------- issue starts right here
      require("core.utils").load_mappings("dap")
    end
  },
  {
    "mfussenegger/nvim-dap-python",
    ft = "python",
    dependencies = {
      "mfussenegger/nvim-dap",
      "rcarriga/nvim-dap-ui",
    },
    config = function(_, opts) <----------------------------------------------------- and here
      local path = "~/.local/share/nvim/mason/packages/debugpy/venv/bin/python"
      require("dap-python").setup(path)
      require("core.utils").load_mappings("dap_python")

You should be able to remove the opts input parameter. I'm not at a computer ATM, but I can fix this when I am. Also happy for you to cut a PR 😁

I´m not sure if it's the case. I have the same issue and can't make debbug work. The only message nvim shows me on the code is this two "Unused local 'opts'." in the plugins.lua.

I have another message in the lspconifg.lua --- "local lspconfig = require("lspconfig") - The same file is required with different names. ". I'm sure it do not relate to the debbug.

The message should just be a warning for the unused variable. You can just remove it from the function definition and it should get rid of the warning message.

The other warning message shouldn't be an issue. It's just warning about a potential naming conflict, but you can ignore it.