Skip to content
This repository was archived by the owner on Feb 5, 2024. It is now read-only.

Ambiguous use of user-defined command #43

Closed
5 tasks done
bijancn opened this issue Feb 2, 2024 · 4 comments
Closed
5 tasks done

Ambiguous use of user-defined command #43

bijancn opened this issue Feb 2, 2024 · 4 comments

Comments

@bijancn
Copy link

bijancn commented Feb 2, 2024

Describe the bug

Just tried to install according to the README. When I try to run any command I get

Error executing Lua callback: vim/_editor.lua:0: nvim_exec2(): Vim:E464: Ambiguous use of user-defined command: CopilotChat Explain how it works.
stack traceback:
        [C]: in function 'nvim_exec2'
        vim/_editor.lua: in function 'cmd'
        ...hare/nvim/lazy/CopilotChat.nvim/lua/CopilotChat/init.lua:29: in function <...hare/nvim/lazy/CopilotChat.nvim/lua/CopilotChat/init.lua:28>
Press ENTER or type command to continue

I am using

  "CopilotChat.nvim": { "branch": "main", "commit": "9722cf72c486e14f739cbb7de07700d555ad8bc8" },

And this is the config for lazy

    {
        "jellydn/CopilotChat.nvim",
        dependencies = { "zbirenbaum/copilot.lua" }, -- Or { "github/copilot.vim" }
        opts = {
            mode = "split",                          -- newbuffer or split  , default: newbuffer
            debug = true,                            -- Enable or disable debug mode, the log file will be in ~/.local/state/nvim/CopilotChat.nvim.log
        },
        build = function()
            vim.defer_fn(function()
                vim.cmd("UpdateRemotePlugins")
                vim.notify("CopilotChat - Updated remote plugins. Please restart Neovim.")
            end, 3000)
        end,
        event = "VeryLazy",
        keys = {
            { "<leader>cce", "<cmd>CopilotChatExplain<cr>", desc = "CopilotChat - Explain code" },
            { "<leader>cct", "<cmd>CopilotChatTests<cr>",   desc = "CopilotChat - Generate tests" },
        },
    },

When I try to activate debug = true I still don't see anything in ~/.local/state/nvim/CopilotChat.nvim.log.

Reproduction

Config

System Info

Error executing Lua callback: vim/_editor.lua:0: nvim_exec2(): Vim:E464: Ambiguous use of user-defined command: CopilotChat Explain how it works.
stack traceback:
        [C]: in function 'nvim_exec2'
        vim/_editor.lua: in function 'cmd'
        ...hare/nvim/lazy/CopilotChat.nvim/lua/CopilotChat/init.lua:29: in function <...hare/nvim/lazy/CopilotChat.nvim/lua/CopilotChat/init.lua:28>
Press ENTER or type command to continue

Used Package Manager

n/a

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@jellydn
Copy link
Owner

jellydn commented Feb 2, 2024

Hi @bijancn Probably, that is the same issue with #38. You need to run UpdateRemotePlugins and restart Neovim.

@jellydn jellydn closed this as completed Feb 2, 2024
@bijancn
Copy link
Author

bijancn commented Feb 2, 2024

Ahh. I'm sorry @jellydn . I did actually run the command but before I restarted Neovim, so the plugin wasn't installed yet. Maybe you could add an extra step about making sure it's installed before running UpdateRemotePlugins? It seems obvious but still easy to forget. Especially when one doesn't know what the command does 😇

@jellydn
Copy link
Owner

jellydn commented Feb 2, 2024

Ahh. I'm sorry @jellydn . I did actually run the command but before I restarted Neovim, so the plugin wasn't installed yet. Maybe you could add an extra step about making sure it's installed before running UpdateRemotePlugins? It seems obvious but still easy to forget. Especially when one doesn't know what the command does 😇

That's on readme: step 3 and 4.

image

@bijancn
Copy link
Author

bijancn commented Feb 2, 2024

Okay maybe it's just me but when I

  • Edit my lazy setup
  • Run :UpdateRemotePlugins (nothing happens)
  • Restart neovim (plugin gets installed)

So for me I needed to

  • Edit my lazy setup
  • Restart neovim (plugin gets installed)
  • Run :UpdateRemotePlugins (plugin starts working)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants