Giter VIP home page Giter VIP logo

copilotchat.nvim's Introduction

Project Update: My Fork Now Part of CopilotC-Nvim

I'm pleased to share that my fork has been archived and integrated into the CopilotC-Nvim organization. This move enhances collaboration, increases update frequency, and expands community support.

What's Next?

  • Check out the project at CopilotChat.nvim.
  • For updates and contributions, visit the new repository under CopilotC-Nvim.

Your support and contributions are appreciated as we continue to develop Copilot Chat for Neovim.

copilotchat.nvim's People

Contributors

allcontributors[bot] avatar cassius0924 avatar example123 avatar github-actions[bot] avatar gptlang avatar jellydn avatar kristofka avatar qoobes avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

copilotchat.nvim's Issues

Empty Command and Ambiguous Use of Command

  • I saw the other thread which talked about this but I can not seem to find a solution
  • I am using NVChad on linux and I can not do remoteupdateplugins and I just installed it via lazy, can't seem to figure out what's wrong with that?

Copilot chat stopped working, getting a load of python errors in recent versions

Describe the bug

Getting the following error each time I try and interact with CopilotChat - this is new and it worked as expected up until the last couple of updates.

Using Lazyvim

Traceback (most recent call last):
  File "/Users/my.user/.local/share/nvim/lazy/CopilotChat.nvim/rplugin/python3/copilot-plugin.py", line 29, in copilot_agent_cmd
    self.vsplit_chat_handler.chat(args[0], file_type, code)
  File "/Users/my.user/.local/share/nvim/lazy/CopilotChat.nvim/rplugin/python3/handlers/vsplit_chat_handler.py", line 38, in chat
    super().chat(prompt, filetype, code, self.nvim.current.window.handle)
  File "/Users/my.user/.local/share/nvim/lazy/CopilotChat.nvim/rplugin/python3/handlers/chat_handler.py", line 47, in chat
    self._add_start_separator(system_prompt, prompt, code, filetype, winnr)
  File "/Users/my.user/.local/share/nvim/lazy/CopilotChat.nvim/rplugin/python3/handlers/chat_handler.py", line 82, in _add_start_separator
    self._add_regular_start_separator(
  File "/Users/my.user/.local/share/nvim/lazy/CopilotChat.nvim/rplugin/python3/handlers/chat_handler.py", line 114, in _add_regular_start_separator
    self._add_folds(code, code_height, last_row_before, system_prompt_height, winnr)
  File "/Users/my.user/.local/share/nvim/lazy/CopilotChat.nvim/rplugin/python3/handlers/chat_handler.py", line 173, in _add_folds
    self.nvim.command(full_command)
  File "/opt/homebrew/lib/python3.11/site-packages/pynvim/api/nvim.py", line 311, in command
    return self.request('nvim_command', string, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/pynvim/api/nvim.py", line 199, in request
    res = self._session.request(name, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/pynvim/msgpack_rpc/session.py", line 139, in request
    raise self.error_wrapper(err)
pynvim.api.common.NvimError: Vim(fold):E350: Cannot create fold with current 'foldmethod'

Reproduction

Run CopilotChat <text>

System Info

System:
    OS: macOS 13.6.3
    CPU: (10) arm64 Apple M1 Max
    Memory: 541.86 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.9.0 - ~/Library/Caches/fnm_multishells/63871_1706948617636/bin/node
    npm: 10.1.0 - ~/Library/Caches/fnm_multishells/63871_1706948617636/bin/npm
    pnpm: 8.13.1 - ~/Library/Caches/fnm_multishells/63871_1706948617636/bin/pnpm
    bun: 1.0.18 - ~/.bun/bin/bun
    Watchman: 2023.12.04.00 - /opt/homebrew/bin/watchman
  Browsers:
    Chrome: 121.0.6167.139
    Edge: 121.0.2277.98
    Safari: 17.1

Used Package Manager

pnpm

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.

Copilot chat fails when called from a window where foldmethod is not manual

Describe the bug

Running CopilotChat when the default foldmethod is not manual results in the following error :

Traceback (most recent call last):
  File "/Users/***/.local/share/nvim/lazy/CopilotChat.nvim/rplugin/python3/copilot-plugin.py", line 39, in copilot_agent_visual_cmd
    self.vsplit_chat_handler.chat(args[0], file_type, code)
  File "/Users/***/.local/share/nvim/lazy/CopilotChat.nvim/rplugin/python3/handlers/vsplit_chat_handler.py", line 38, in chat
    super().chat(prompt, filetype, code, self.nvim.current.window.handle)
  File "/Users/***/.local/share/nvim/lazy/CopilotChat.nvim/rplugin/python3/handlers/chat_handler.py", line 48, in chat
    self._add_start_separator(system_prompt, prompt, code, filetype, winnr)
  File "/Users/***/.local/share/nvim/lazy/CopilotChat.nvim/rplugin/python3/handlers/chat_handler.py", line 79, in _add_start_separator
    self._add_start_separator_with_token_count(
  File "/Users/***/.local/share/nvim/lazy/CopilotChat.nvim/rplugin/python3/handlers/chat_handler.py", line 160, in _add_start_separator_with_token_count
    self._add_folds(code, code_height, last_row_before, system_prompt_height, winnr)
  File "/Users/***/.local/share/nvim/lazy/CopilotChat.nvim/rplugin/python3/handlers/chat_handler.py", line 176, in _add_folds
    self.nvim.command(full_command)
  File "/opt/homebrew/anaconda3/lib/python3.11/site-packages/pynvim/api/nvim.py", line 311, in command
    return self.request('nvim_command', string, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/anaconda3/lib/python3.11/site-packages/pynvim/api/nvim.py", line 199, in request
    res = self._session.request(name, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/anaconda3/lib/python3.11/site-packages/pynvim/msgpack_rpc/session.py", line 139, in request
    raise self.error_wrapper(err)
pynvim.api.common.NvimError: Vim(fold):E350: Cannot create fold with current 'foldmethod'

The culprit seems to be at the line referenced here :

self.nvim.command(full_command)

adding

        self.nvim.command("set foldmethod=manual")

before this line seems to fix the issue, although I don't know wether it's generally a good approach.

Reproduction

:set foldmethod returns foldmethod=expr , CopilotChat crashes

System Info

neovim main branch, CopilotChat.nvim main branch

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.

Add log entries displaying the request/response transactions between the lua and python

Describe the bug

I don't get a response of the plugin. Procedure:

  1. yank something
  2. Run :CopilotChatReview
  3. A vertical split is opened with the following content:
### User
Review the following code and provide concise suggestions.

### Copilot

---

This is displayed via :messages:

18 lines yanked                                                                                     
Done!

That's it.

Now my question is: How can I debug this? Where do I get access to diagnostic information?

Reproduction

See description

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 19.67 GB / 30.97 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 18.19.0 - /usr/bin/node
    Yarn: 1.15.2 - ~/.yarn/bin/yarn
    npm: 10.2.3 - /usr/bin/npm
  Browsers:
    Chrome: 121.0.6167.139
    Chromium: 121.0.6167.85

Used Package Manager

npm

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.

Syntax highlighting not working in Copilot chat

Describe the bug

When I am using Copilot, my syntax highlighting is not working. What am I doing wrong? Here is my configuration:

  {
    "jellydn/CopilotChat.nvim",
    branch = "canary",
    dependencies = { "zbirenbaum/copilot.lua" },
    opts = {
      mode = "split",
      debug = false,
      prompts = {
        Explain = "Explain how it works.",
        Review = "Review the following code and provide concise suggestions.",
        Tests = "Briefly explain how the selected code works, then generate unit tests.",
        Refactor = "Refactor the code to improve clarity and readability.",
        Spelling = "Please correct any grammar and spelling errors in the following text.",
        Wording = "Please improve the grammar and wording of the following text.",
      },
    },
    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" },
      { "<leader>ccr", "<cmd>CopilotChatReview<CR>",   desc = "CopilotChat - Review code" },
      { "<leader>ccR", "<cmd>CopilotChatRefactor<CR>", desc = "CopilotChat - Refactor code" },
      { "<leader>ccS", "<cmd>CopilotChatSpelling<CR>", desc = "CopilotChat - Correct spelling" },
      { "<leader>ccw", "<cmd>CopilotChatWording<CR>",  desc = "CopilotChat - Improve wording" },
    },
  },
Screenshot 2024-02-02 at 17 57 28

Reproduction

default config

System Info

System:
    OS: macOS 14.3
    CPU: (8) arm64 Apple M1 Pro
    Memory: 88.34 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 21.2.0 - ~/.nvm/versions/node/v21.2.0/bin/node
    Yarn: 1.22.21 - ~/.nvm/versions/node/v21.2.0/bin/yarn
    npm: 10.2.3 - ~/.nvm/versions/node/v21.2.0/bin/npm
  Browsers:
    Chrome: 121.0.6167.139
    Firefox: 120.0.1
    Safari: 17.3

Used Package Manager

yarn

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.

Ambiguous use of user-defined command' error on specifically windows

Describe the bug

I get the error I mention at the end of the description when I use any of the commands given the Readme. I believe it is only a windows error as in my Ubuntu WSL I have not received this error.

Error executing Lua callback: vim/_editor.lua:341: 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:341: in function 'cmd'
...nvim-data/lazy/CopilotChat.nvim/lua/CopilotChat/init.lua:23: in function <...nvim-data/lazy/CopilotChat.nvim/lua/CopilotChat/init.lua:22>

Reproduction

Use the config given in the usage section on Windows. Try any command or keybindings.

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (8) x64 Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
    Memory: 909.82 MB / 7.80 GB
  Binaries:
    Node: 20.10.0 - ~\.nvm\versions\node\v20.10.0\bin\node.EXE
    Yarn: 1.22.21 - ~\.nvm\versions\node\v20.10.0\bin\yarn.CMD
    npm: 10.2.3 - ~\.nvm\versions\node\v20.10.0\bin\npm.CMD
    pnpm: 8.12.1 - ~\.nvm\versions\node\v20.10.0\bin\pnpm.CMD
  Browsers:
    Chrome: 120.0.6099.225
    Edge: Chromium (121.0.2277.83)
    Internet Explorer: 11.0.19041.3636

Used Package Manager

npm

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.

pynvim.api.common.NvimError: Vim:E121: Undefined variable: g:copilot_chat_view_option

Describe the bug

When I try to use CopilatChat anything command I get error:

image

error caught in async handler '/Users/lukasz.kurpiewski/.local/share/nvim/lazy/CopilotChat.nvim/rplugin/python3/copilot-plugin.py:command:CopilotChat [['w
hat does it do']]'
Traceback (most recent call last):
  File "/Users/lukasz.kurpiewski/.local/share/nvim/lazy/CopilotChat.nvim/rplugin/python3/copilot-plugin.py", line 55, in copilotChat
    view_option = self.nvim.eval("g:copilot_chat_view_option")
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/pynvim/api/nvim.py", line 319, in eval
    return self.request('nvim_eval', string, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/pynvim/api/nvim.py", line 199, in request
    res = self._session.request(name, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/pynvim/msgpack_rpc/session.py", line 139, in request
    raise self.error_wrapper(err)
pynvim.api.common.NvimError: Vim:E121: Undefined variable: g:copilot_chat_view_option
  • I have set python3_host_prog = '/opt/homebrew/bin/python3' in my vim.g option
  • I'm using Lazy.nvim
  • I install it like this:
  {
    "jellydn/CopilotChat.nvim",
    event = "VeryLazy",
    opts = {
      mode = "split",
      prompts = {
        Explain = "Explain how it works.",
        Review = "Review the following code and provide concise suggestions.",
        Tests = "Briefly explain how the selected code works, then generate unit tests.",
        Refactor = "Refactor the code to improve clarity and readability.",
      },
    },
    build = function()
      vim.defer_fn(function()
        vim.cmd("UpdateRemotePlugins")
        vim.notify("CopilotChat - Updated remote plugins. Please restart Neovim.")
      end, 3000)
    end,
    config = function()
      local present, wk = pcall(require, "which-key")
      if not present then
        return
      end

      wk.register({
        c = {
          c = {
            name = "Copilot Chat",
          }
        }
      }, {
        mode = "n",
        prefix = "<leader>",
        silent = true,
        noremap = true,
        nowait = false,
      })
    end,
    keys = {
      { "<leader>ccc", ":CopilotChat ",                desc = "CopilotChat - Prompt" },
      { "<leader>cce", ":CopilotChatExplain ",         desc = "CopilotChat - Explain code" },
      { "<leader>cct", "<cmd>CopilotChatTests<cr>",    desc = "CopilotChat - Generate tests" },
      { "<leader>ccr", "<cmd>CopilotChatReview<cr>",   desc = "CopilotChat - Review code" },
      { "<leader>ccR", "<cmd>CopilotChatRefactor<cr>", desc = "CopilotChat - Refactor code" },
    }
  },

I see it's an issue with pynvim. I already removed it from pip, checked different Python versions, removed pip cache, installed with --no-cache-dir option. Nothing helps. It was working fine and after some update just happend like this.

I also tried using lazy = false flag for plugin but doesn't change anything.

When I run :UpdateRemotePlugins:

remote/host: python3 host registered plugins ['copilot-plugin.py']
remote/host: generated rplugin manifest: /Users/lukasz.kurpiewski/.local/share/nvim/rplugin.vim

I have no idea what's the issue.

Reproduction

Just use command

System Info

System:
    OS: macOS 14.3
    CPU: (10) arm64 Apple M1 Pro
    Memory: 887.22 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.9.0 - ~/Library/Caches/fnm_multishells/89082_1706370365515/bin/node
    Yarn: 1.22.21 - /opt/homebrew/bin/yarn
    npm: 10.1.0 - ~/Library/Caches/fnm_multishells/89082_1706370365515/bin/npm
    pnpm: 8.8.0 - ~/Library/pnpm/pnpm
    bun: 1.0.20 - ~/.bun/bin/bun
    Watchman: 2024.01.22.00 - /opt/homebrew/bin/watchman
  Browsers:
    Chrome: 121.0.6167.85
    Safari: 17.3

Additionally:

Python 3.11.7
pip 23.3.2 from /opt/homebrew/lib/python3.11/site-packages/pip (python 3.11)
NVIM v0.10.0-dev-2191+g4e59422e1
Build type: RelWithDebInfo
LuaJIT 2.1.1706032906

Info from `checkhealth`:

Python 3 provider (optional) ~
- pyenv: Path: /opt/homebrew/Cellar/pyenv/2.3.35/libexec/pyenv
- pyenv: $PYENV_ROOT is not set. Infer from `pyenv root`.
- WARNING pyenv: Root does not exist: /Users/lukasz.kurpiewski/.pyenv. Ignoring pyenv for all following checks.
- Using: g:python3_host_prog = "/opt/homebrew/bin/python3"
- Executable: /opt/homebrew/bin/python3
- Python version: 3.11.7
- pynvim version: 0.5.0
- OK Latest pynvim is installed.

Python virtualenv ~
- OK no $VIRTUAL_ENV

Used Package Manager

npm

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.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/checkout v4
  • JohnnyMorganz/stylua-action v3
  • actions/checkout v4
  • stefanzweifel/git-auto-commit-action v5
  • actions/checkout v4
  • rhysd/action-setup-vim v1
  • leafo/gh-actions-lua v10
  • leafo/gh-actions-luarocks v4
pip_requirements
requirements.txt
  • pynvim ==0.5.0

  • Check this box to trigger a request for Renovate to run again on this repository

ImportError when using :updateremoteplugin.

Describe the bug

Encountered ImportError loading plugin at /home/carlesoctav/.local/share/nvim/lazy/CopilotChat.nvim/rplugin/python3/copilot-plugin.py:
cannot import name 'LiteralString' from 'typing' (/usr/lib/python3.10/typing.py)
Traceback (most recent call last):
File "/home/carlesoctav/.local/lib/python3.10/site-packages/pynvim/plugin/host.py", line 193, in _load
module = _handle_import(directory, name)
File "/home/carlesoctav/.local/lib/python3.10/site-packages/pynvim/plugin/host.py", line 40, in _handle_import
return importlib.import_module(name)
File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
ImportError: cannot import name 'LiteralString' from 'typing' (/usr/lib/python3.10/typing.py)

remote/host: python3 host registered plugins []
remote/host: generated rplugin manifest: /home/carlesoctav/.local/share/nvim/rplugin.vim

Reproduction

Perform all the instructions outlined in the README document.

System Info

i'll put my python dependencies here:
python 3.10.12
importlib-metadata==4.6.4
jeepney==0.7.1
keyring==23.5.0
launchpadlib==1.10.16
lazr.restfulclient==0.14.4
lazr.uri==1.0.6
more-itertools==8.10.0
msgpack==1.0.3
netifaces==0.11.0
numpy==1.26.3
oauthlib==3.2.0
opencv-python==4.9.0.80
prompt-toolkit==3.0.43
PyGObject==3.42.1
PyJWT==2.3.0
pynvim==0.5.0
pyparsing==2.4.7
python-apt==2.4.0+ubuntu2
python-dotenv==1.0.1
PyYAML==5.4.1
regex==2023.12.25
requests==2.31.0
SecretStorage==3.3.1
six==1.16.0
systemd-python==234
tiktoken==0.5.2
ubuntu-advantage-tools==8001
ufw==0.36.1
unattended-upgrades==0.1
urllib3==2.2.0
wadllib==1.3.6
wcwidth==0.2.13
youtube-dl==2021.12.17
zipp==1.0.

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.

Asking further questions

Hey!

First of all, thanks alot for the effort!
Secondly, after asking the first question, i would like to ask further question on the same context, is this possible? It seems i am able to add to buffer but not trigger to actually start

Ambiguous use of user-defined command

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.

Proposal to combine my fork with yours

Hi @jellydn , I've been adding new features on my own to CopilotChat.nvim.

I made a ton of changes and didn't account for it to be public, so I just created a new repo, copy the core Copilot API from CopilotChat.nvim into the new repo and not fork the original project.

But now I see the original CopilotChat.nvim repo pointed to your fork, and it seems like you're gonna be quite active on the project, I think maybe we should work together actively on the same code base.

My project is currently here https://github.com/ziontee113/CopilotAgent.nvim
I plan to make this into a super agent that can handle complex coding tasks, hence the name of the derived repo.

CopilotAgent and CopilotAgentVisual is basically like the original CopilotChat, but re-written with some new features.
InplaceHandler purpose is to prompt copilot and replace code in place, like ChatGPT.nvim using popup windows.
I also created new PopUp / Layout modules to handle such tasks like nui.nvim, but in Python.

Here's how I'm using it:

return {
    "ziontee113/CopilotAgent.nvim",
    config = function()
        vim.keymap.set({ "n" }, "<C-p>", ":CopilotAgent ", {})
        vim.keymap.set({ "x" }, "<C-p>", ":CopilotAgentVisual ", {})

        vim.keymap.set({ "x" }, "<C-S-i>", ":InplaceHandler<CR>", { silent = true })
        vim.keymap.set({ "x" }, "<C-A-i>", ":InplaceHandler<CR>", { silent = true })

        vim.keymap.set({ "n" }, "<C-S-l>", "<cmd>EchoPark<CR>", {})
        vim.keymap.set({ "n" }, "<C-S-p>", "<cmd>PriorityMatrix<CR>", {})
    end,
}

I'm still very inexperienced with collaborating with other people. If you want to we could join forces and make a great plugin together.
Please let me know what you think. Thank you very much.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.