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

Syntax highlighting not working in Copilot chat #46

@k-martynov

Description

@k-martynov

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem rightquestionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions