Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add a command to clear the highlights produced by :CopilotChatReview #362

Open
Tebro opened this issue Jun 25, 2024 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@Tebro
Copy link

Tebro commented Jun 25, 2024

When using :CopilotChatReview it will print its suggestions in chat, but also highlight them in the buffer. Would be nice to be able to clear this highlights.

@jellydn jellydn added the enhancement New feature or request label Jun 26, 2024
@masakiq
Copy link

masakiq commented Jul 20, 2024

This is a workaround.

By defining the following Lua function, you can clear the review highlights:

function CopilotChatReviewClear()
  local ns = vim.api.nvim_create_namespace('copilot_review')
  vim.diagnostic.reset(ns)
end

vim.api.nvim_create_user_command(
  'CopilotChatReviewClear',
  CopilotChatReviewClear,
  {}
)

Then, run the command:

:CopilotChatReviewClear

Alternatively, if you don't need the highlights, you might also consider using the keymap below to silence the function callbacks:

require("CopilotChat").setup {
  prompts = {
    Review = {
      callback = function(_, _)
        -- do nothing
      end,
    },
  },
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants