From 84484c1aaa11bad6ef129c329338b69302d7c563 Mon Sep 17 00:00:00 2001 From: Nisal <30633436+nisalVD@users.noreply.github.com> Date: Wed, 28 Feb 2024 21:39:18 +1100 Subject: [PATCH 01/17] docs: fixed up incorrect syntax for CopilotChatBuffer (#88) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cc8beaeb..948eb158 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ return { end, event = "VeryLazy", keys = { - { "ccb", "CopilotChatBuffer ", desc = "CopilotChat - Chat with current buffer" }, + { "ccb", ":CopilotChatBuffer ", desc = "CopilotChat - Chat with current buffer" }, { "cce", "CopilotChatExplain", desc = "CopilotChat - Explain code" }, { "cct", "CopilotChatTests", desc = "CopilotChat - Generate tests" }, { From 0773a851d4aec8bd1c1cf8e017031d425c754e1a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 28 Feb 2024 10:39:38 +0000 Subject: [PATCH 02/17] chore(doc): auto generate docs --- doc/CopilotChat.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/CopilotChat.txt b/doc/CopilotChat.txt index a48110c5..3c0b45ef 100644 --- a/doc/CopilotChat.txt +++ b/doc/CopilotChat.txt @@ -1,4 +1,4 @@ -*CopilotChat.txt* For NVIM v0.8.0 Last change: 2024 February 27 +*CopilotChat.txt* For NVIM v0.8.0 Last change: 2024 February 28 ============================================================================== Table of Contents *CopilotChat-table-of-contents* @@ -71,7 +71,7 @@ LAZY.NVIM ~ end, event = "VeryLazy", keys = { - { "ccb", "CopilotChatBuffer ", desc = "CopilotChat - Chat with current buffer" }, + { "ccb", ":CopilotChatBuffer ", desc = "CopilotChat - Chat with current buffer" }, { "cce", "CopilotChatExplain", desc = "CopilotChat - Explain code" }, { "cct", "CopilotChatTests", desc = "CopilotChat - Generate tests" }, { From f6a5f38690fdaa647ee848610ee817c010c5bc7b Mon Sep 17 00:00:00 2001 From: Huynh Duc Dung Date: Wed, 28 Feb 2024 19:06:30 +0800 Subject: [PATCH 03/17] docs: add announce --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 948eb158..115a205e 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,9 @@ +> [!NOTE] +> We are excited to announce that we are currently migrating the plugin to fully Lua in the [canary](https://github.com/CopilotC-Nvim/CopilotChat.nvim/tree/canary) branch. + > [!NOTE] > A new command, `CopilotChatBuffer` has been added. It allows you to chat with Copilot using the entire content of the buffer. From b59c014df4fe09cdaa1ada170944bcfa1b00c82b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 28 Feb 2024 11:08:35 +0000 Subject: [PATCH 04/17] chore(doc): auto generate docs --- doc/CopilotChat.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/CopilotChat.txt b/doc/CopilotChat.txt index 3c0b45ef..84da67f8 100644 --- a/doc/CopilotChat.txt +++ b/doc/CopilotChat.txt @@ -22,6 +22,10 @@ Table of Contents *CopilotChat-table-of-contents* |CopilotChat-| + [!NOTE] We are excited to announce that we are currently migrating the plugin + to fully Lua in the canary + branch. + [!NOTE] A new command, `CopilotChatBuffer` has been added. It allows you to chat with Copilot using the entire content of the buffer. From 3903ecb92d143ad44a9ed96b1abb65abdb2db0d6 Mon Sep 17 00:00:00 2001 From: Huynh Duc Dung Date: Wed, 28 Feb 2024 21:56:13 +0800 Subject: [PATCH 05/17] fix: check Python 3 provider check on health check Closed #84 --- lua/CopilotChat/health.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/CopilotChat/health.lua b/lua/CopilotChat/health.lua index 5893f812..227d76f9 100644 --- a/lua/CopilotChat/health.lua +++ b/lua/CopilotChat/health.lua @@ -31,6 +31,11 @@ end -- Add health check for python3 and pynvim function M.check() start('CopilotChat.nvim health check') + if vim.g.loaded_python3_provider == 0 then + warn('Python 3 provider is disabled. Please enable it to use CopilotChat.nvim') + return + end + local python_version = run_python_command('--version') if python_version == false then From a16d130b9ce79b8baaffc358f9ef6a4b4e31c74c Mon Sep 17 00:00:00 2001 From: Huynh Duc Dung Date: Wed, 28 Feb 2024 22:10:36 +0800 Subject: [PATCH 06/17] chore(ci): only bump on release branch --- .github/workflows/release.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5ed69576..822466c5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,10 +3,6 @@ on: push: branches: - release - pull_request: - branches: - - main - - release permissions: contents: write @@ -21,7 +17,6 @@ jobs: id: release with: release-type: simple - package-name: CopilotChat.nvim token: ${{ secrets.GITHUB_TOKEN }} - uses: actions/checkout@v3 - name: tag stable versions From 6a222a6e1228e362ba0e4a0eb14fc9977fafd98d Mon Sep 17 00:00:00 2001 From: Huynh Duc Dung Date: Wed, 28 Feb 2024 22:10:57 +0800 Subject: [PATCH 07/17] chore: bump to v1.9.1 --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index f8e233b2..9ab8337f 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.9.0 +1.9.1 From 5208678b8d817b5e0a6c7d9023fec6fc8d947d4f Mon Sep 17 00:00:00 2001 From: gptlang Date: Wed, 28 Feb 2024 18:19:20 +0000 Subject: [PATCH 08/17] fix: Work with non-json error messages #90 --- rplugin/python3/CopilotChat/copilot.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/rplugin/python3/CopilotChat/copilot.py b/rplugin/python3/CopilotChat/copilot.py index 2723c5dd..49df6600 100644 --- a/rplugin/python3/CopilotChat/copilot.py +++ b/rplugin/python3/CopilotChat/copilot.py @@ -140,8 +140,11 @@ def ask( f.write(f"Error: {response.status_code}\n") f.write(f"Request: {data}\n") f.write(f"Response: {response.text}\n") - - error_code = response.json().get("error", {}).get("code") + try: + error_code = response.json().get("error", {}).get("code") + except json.decoder.JSONDecodeError: + error_code = 0 + error_messages[error_code] = response.text if error_code and error_messages.get(response.status_code): error_messages[response.status_code] = ( f"{error_messages[response.status_code]}: {error_code}" From c51783a713091e117b01e031ca221d838a73edcd Mon Sep 17 00:00:00 2001 From: gptlang Date: Wed, 28 Feb 2024 20:06:29 +0000 Subject: [PATCH 09/17] fix JSON decode error --- rplugin/python3/CopilotChat/copilot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rplugin/python3/CopilotChat/copilot.py b/rplugin/python3/CopilotChat/copilot.py index 49df6600..3ee4ee54 100644 --- a/rplugin/python3/CopilotChat/copilot.py +++ b/rplugin/python3/CopilotChat/copilot.py @@ -142,7 +142,7 @@ def ask( f.write(f"Response: {response.text}\n") try: error_code = response.json().get("error", {}).get("code") - except json.decoder.JSONDecodeError: + except requests.exceptions.JSONDecodeError: error_code = 0 error_messages[error_code] = response.text if error_code and error_messages.get(response.status_code): From e2109387cfb638b217fa2447dd69157869dc4902 Mon Sep 17 00:00:00 2001 From: Huynh Duc Dung Date: Fri, 1 Mar 2024 21:08:04 +0800 Subject: [PATCH 10/17] ci: fix release action --- .github/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 822466c5..0cdce9f7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,9 @@ jobs: with: release-type: simple token: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} - name: tag stable versions if: ${{ steps.release.outputs.release_created }} run: | From b05861d034aaf89a481e8442107ecf97e896f13d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 1 Mar 2024 13:09:38 +0000 Subject: [PATCH 11/17] chore(doc): auto generate docs --- doc/CopilotChat.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/CopilotChat.txt b/doc/CopilotChat.txt index 84da67f8..392f4738 100644 --- a/doc/CopilotChat.txt +++ b/doc/CopilotChat.txt @@ -1,4 +1,4 @@ -*CopilotChat.txt* For NVIM v0.8.0 Last change: 2024 February 28 +*CopilotChat.txt* For NVIM v0.8.0 Last change: 2024 March 01 ============================================================================== Table of Contents *CopilotChat-table-of-contents* From 82b567e3705fdb45716ddac162150ebc8bba0403 Mon Sep 17 00:00:00 2001 From: "Dung Duc Huynh (Kaka)" <870029+jellydn@users.noreply.github.com> Date: Sat, 2 Mar 2024 20:07:25 +0800 Subject: [PATCH 12/17] docs: prepare for v2 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 115a205e..52d1c4fa 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ -> [!NOTE] +> [!IMPORTANT] > We are excited to announce that we are currently migrating the plugin to fully Lua in the [canary](https://github.com/CopilotC-Nvim/CopilotChat.nvim/tree/canary) branch. > [!NOTE] From 8434e3be4d5019fdc4ffc59a27650e39bdd1c2dc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sat, 2 Mar 2024 12:07:47 +0000 Subject: [PATCH 13/17] chore(doc): auto generate docs --- doc/CopilotChat.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/CopilotChat.txt b/doc/CopilotChat.txt index 392f4738..a3054794 100644 --- a/doc/CopilotChat.txt +++ b/doc/CopilotChat.txt @@ -1,4 +1,4 @@ -*CopilotChat.txt* For NVIM v0.8.0 Last change: 2024 March 01 +*CopilotChat.txt* For NVIM v0.8.0 Last change: 2024 March 02 ============================================================================== Table of Contents *CopilotChat-table-of-contents* @@ -22,8 +22,8 @@ Table of Contents *CopilotChat-table-of-contents* |CopilotChat-| - [!NOTE] We are excited to announce that we are currently migrating the plugin - to fully Lua in the canary + [!IMPORTANT] We are excited to announce that we are currently migrating the + plugin to fully Lua in the canary branch. [!NOTE] A new command, `CopilotChatBuffer` has been added. It allows you to From f852a10c143a4387b7eeb7ca93618c001f543f4f Mon Sep 17 00:00:00 2001 From: Oleksandr Slynko Date: Wed, 6 Mar 2024 17:48:29 +0000 Subject: [PATCH 14/17] PlugInstall configuration should be wrapped into lua (#127) --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 52d1c4fa..e555ca63 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,7 @@ Similar to the lazy setup, you can use the following configuration: Plug 'CopilotC-Nvim/CopilotChat.nvim' call plug#end() +lua << EOF local copilot_chat = require("CopilotChat") copilot_chat.setup({ debug = true, @@ -135,6 +136,8 @@ copilot_chat.setup({ event = "VeryLazy", }) +EOF + nnoremap ccb CopilotChatBuffer nnoremap cce CopilotChatExplain nnoremap cct CopilotChatTests From 06b9e1491971c3ead598da5cc6eee9f5657e6efb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 6 Mar 2024 17:48:49 +0000 Subject: [PATCH 15/17] chore(doc): auto generate docs --- doc/CopilotChat.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/CopilotChat.txt b/doc/CopilotChat.txt index a3054794..15ea2d30 100644 --- a/doc/CopilotChat.txt +++ b/doc/CopilotChat.txt @@ -1,4 +1,4 @@ -*CopilotChat.txt* For NVIM v0.8.0 Last change: 2024 March 02 +*CopilotChat.txt* For NVIM v0.8.0 Last change: 2024 March 06 ============================================================================== Table of Contents *CopilotChat-table-of-contents* @@ -139,6 +139,7 @@ Similar to the lazy setup, you can use the following configuration: Plug 'CopilotC-Nvim/CopilotChat.nvim' call plug#end() + lua << EOF local copilot_chat = require("CopilotChat") copilot_chat.setup({ debug = true, @@ -155,6 +156,8 @@ Similar to the lazy setup, you can use the following configuration: event = "VeryLazy", }) + EOF + nnoremap ccb CopilotChatBuffer nnoremap cce CopilotChatExplain nnoremap cct CopilotChatTests From c6020bcbc20c29ac23c4f5f63c3c393533d3de18 Mon Sep 17 00:00:00 2001 From: "allcontributors[bot]" <46447321+allcontributors[bot]@users.noreply.github.com> Date: Wed, 6 Mar 2024 21:52:37 +0400 Subject: [PATCH 16/17] docs: add alex-slynko as a contributor for doc (#130) --- .all-contributorsrc | 82 +++++++++++++++++++++++++++++++++++---------- README.md | 5 ++- 2 files changed, 67 insertions(+), 20 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index 49348a58..d7b5e3a7 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1,5 +1,7 @@ { - "files": ["README.md"], + "files": [ + "README.md" + ], "imageSize": 100, "commit": false, "commitType": "docs", @@ -10,112 +12,158 @@ "name": "gptlang", "avatar_url": "https://avatars.githubusercontent.com/u/121417512?v=4", "profile": "https://github.com/gptlang", - "contributions": ["code", "doc"] + "contributions": [ + "code", + "doc" + ] }, { "login": "jellydn", "name": "Dung Duc Huynh (Kaka)", "avatar_url": "https://avatars.githubusercontent.com/u/870029?v=4", "profile": "https://productsway.com/", - "contributions": ["code", "doc"] + "contributions": [ + "code", + "doc" + ] }, { "login": "qoobes", "name": "Ahmed Haracic", "avatar_url": "https://avatars.githubusercontent.com/u/58834655?v=4", "profile": "https://qoobes.dev", - "contributions": ["code"] + "contributions": [ + "code" + ] }, { "login": "ziontee113", "name": "Trí Thiện Nguyễn", "avatar_url": "https://avatars.githubusercontent.com/u/102876811?v=4", "profile": "https://youtube.com/@ziontee113", - "contributions": ["code"] + "contributions": [ + "code" + ] }, { "login": "Cassius0924", "name": "He Zhizhou", "avatar_url": "https://avatars.githubusercontent.com/u/62874592?v=4", "profile": "https://github.com/Cassius0924", - "contributions": ["code"] + "contributions": [ + "code" + ] }, { "login": "rguruprakash", "name": "Guruprakash Rajakkannu", "avatar_url": "https://avatars.githubusercontent.com/u/9963717?v=4", "profile": "https://www.linkedin.com/in/guruprakashrajakkannu/", - "contributions": ["code"] + "contributions": [ + "code" + ] }, { "login": "kristofka", "name": "kristofka", "avatar_url": "https://avatars.githubusercontent.com/u/140354?v=4", "profile": "https://github.com/kristofka", - "contributions": ["code"] + "contributions": [ + "code" + ] }, { "login": "PostCyberPunk", "name": "PostCyberPunk", "avatar_url": "https://avatars.githubusercontent.com/u/134976996?v=4", "profile": "https://github.com/PostCyberPunk", - "contributions": ["doc"] + "contributions": [ + "doc" + ] }, { "login": "ktns", "name": "Katsuhiko Nishimra", "avatar_url": "https://avatars.githubusercontent.com/u/1302759?v=4", "profile": "https://github.com/ktns", - "contributions": ["code"] + "contributions": [ + "code" + ] }, { "login": "errnoh", "name": "Erno Hopearuoho", "avatar_url": "https://avatars.githubusercontent.com/u/373946?v=4", "profile": "https://github.com/errnoh", - "contributions": ["code"] + "contributions": [ + "code" + ] }, { "login": "shaungarwood", "name": "Shaun Garwood", "avatar_url": "https://avatars.githubusercontent.com/u/4156525?v=4", "profile": "https://github.com/shaungarwood", - "contributions": ["code"] + "contributions": [ + "code" + ] }, { "login": "neutrinoA4", "name": "neutrinoA4", "avatar_url": "https://avatars.githubusercontent.com/u/122616073?v=4", "profile": "https://github.com/neutrinoA4", - "contributions": ["code", "doc"] + "contributions": [ + "code", + "doc" + ] }, { "login": "banjocat", "name": "Jack Muratore", "avatar_url": "https://avatars.githubusercontent.com/u/3247309?v=4", "profile": "https://github.com/banjocat", - "contributions": ["code"] + "contributions": [ + "code" + ] }, { "login": "AdrielVelazquez", "name": "Adriel Velazquez", "avatar_url": "https://avatars.githubusercontent.com/u/3443378?v=4", "profile": "https://github.com/AdrielVelazquez", - "contributions": ["code", "doc"] + "contributions": [ + "code", + "doc" + ] }, { "login": "deathbeam", "name": "Tomas Slusny", "avatar_url": "https://avatars.githubusercontent.com/u/5115805?v=4", "profile": "https://github.com/deathbeam", - "contributions": ["code", "doc"] + "contributions": [ + "code", + "doc" + ] }, { "login": "nisalVD", "name": "Nisal", "avatar_url": "https://avatars.githubusercontent.com/u/30633436?v=4", "profile": "http://nisalvd.netlify.com/", - "contributions": ["doc"] + "contributions": [ + "doc" + ] + }, + { + "login": "alex-slynko", + "name": "Oleksandr Slynko", + "avatar_url": "https://avatars.githubusercontent.com/u/4385389?v=4", + "profile": "https://medium.com/@slynko", + "contributions": [ + "doc" + ] } ], "contributorsPerLine": 7, diff --git a/README.md b/README.md index e555ca63..42a9cba1 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,7 @@ [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/CopilotC-Nvim/CopilotChat.nvim/main.svg)](https://results.pre-commit.ci/latest/github/CopilotC-Nvim/CopilotChat.nvim/main) - -[![All Contributors](https://img.shields.io/badge/all_contributors-16-orange.svg?style=flat-square)](#contributors-) - +[![All Contributors](https://img.shields.io/badge/all_contributors-17-orange.svg?style=flat-square)](#contributors-) > [!IMPORTANT] @@ -530,6 +528,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d Tomas Slusny
Tomas Slusny

💻 📖 Nisal
Nisal

📖 + Oleksandr Slynko
Oleksandr Slynko

📖 From bf64a21fc4cf8dc11396bbe8a51584bda26fd8c3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 6 Mar 2024 17:53:00 +0000 Subject: [PATCH 17/17] chore(doc): auto generate docs --- doc/CopilotChat.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/CopilotChat.txt b/doc/CopilotChat.txt index 15ea2d30..27d61a9d 100644 --- a/doc/CopilotChat.txt +++ b/doc/CopilotChat.txt @@ -560,7 +560,7 @@ CONTRIBUTORS ✨ *CopilotChat-copilot-chat-for-neovim-contributors-✨* Thanks goes to these wonderful people (emoji key ): -gptlang💻 📖Dung Duc Huynh (Kaka)💻 📖Ahmed Haracic💻Trí Thiện Nguyễn💻He Zhizhou💻Guruprakash Rajakkannu💻kristofka💻PostCyberPunk📖Katsuhiko Nishimra💻Erno Hopearuoho💻Shaun Garwood💻neutrinoA4💻 📖Jack Muratore💻Adriel Velazquez💻 📖Tomas Slusny💻 📖Nisal📖This project follows the all-contributors +gptlang💻 📖Dung Duc Huynh (Kaka)💻 📖Ahmed Haracic💻Trí Thiện Nguyễn💻He Zhizhou💻Guruprakash Rajakkannu💻kristofka💻PostCyberPunk📖Katsuhiko Nishimra💻Erno Hopearuoho💻Shaun Garwood💻neutrinoA4💻 📖Jack Muratore💻Adriel Velazquez💻 📖Tomas Slusny💻 📖Nisal📖Oleksandr Slynko📖This project follows the all-contributors specification. Contributions of any kind are welcome! @@ -575,7 +575,7 @@ STARGAZERS OVER TIME ~ 1. *Prerequisite*: https://img.shields.io/badge/python-%3E%3D3.10-blue.svg 2. *Documentation*: https://img.shields.io/badge/documentation-yes-brightgreen.svg 3. *pre-commit.ci status*: https://results.pre-commit.ci/badge/github/CopilotC-Nvim/CopilotChat.nvim/main.svg -4. *All Contributors*: https://img.shields.io/badge/all_contributors-16-orange.svg?style=flat-square +4. *All Contributors*: https://img.shields.io/badge/all_contributors-17-orange.svg?style=flat-square 5. *@treyhunner*: 6. *@nekowasabi*: 7. *@jellydn*: