Syntax highlighting not working in Copilot chat #47
-
Describe the bugWhen 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" },
},
}, Reproductiondefault config System InfoSystem:
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 Manageryarn Validations
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
Hi @k-martynov, thanks for your report. I just tried with Could you try with below config? Please make sure that you run {
"jellydn/CopilotChat.nvim",
dependencies = { "zbirenbaum/copilot.lua" },
opts = {
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.notify("Please update the remote plugins by running ':UpdateRemotePlugins', then restart Neovim.")
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" },
},
}, |
Beta Was this translation helpful? Give feedback.
-
@jellydn I've used your config but the result still the same: |
Beta Was this translation helpful? Give feedback.
-
Do you run |
Beta Was this translation helpful? Give feedback.
-
@jellydn yes |
Beta Was this translation helpful? Give feedback.
-
By the way, what is your Neovim version? |
Beta Was this translation helpful? Give feedback.
After updating to 0.10
Everything works well!