zbirenbaum / copilot.lua

Fully featured & enhanced replacement for copilot.vim complete with API for interacting with Github Copilot
MIT License
2.63k stars 75 forks source link

Only get 1-line suggestions for JS/TS (panel shows entire suggestion) #229

Closed dseravalli closed 11 months ago

dseravalli commented 11 months ago

It's happening in TS/JS files consistently, but not in Python or Ruby files. I have tried both with and without the cmp plugin and the behavior is the same.

Installed with Lazy like this:

  {
    "zbirenbaum/copilot.lua",
    cmd = 'Copilot',
    event = 'InsertEnter',
    config = function()
      require("copilot").setup({
        suggestion = {
          auto_trigger = true
        }
      })
    end
  },

or like this:

  {
    "zbirenbaum/copilot.lua",
    cmd = 'Copilot',
    event = 'InsertEnter',
    config = function()
      require("copilot").setup({
        suggestion = { enabled = false },
        panel = { enabled = false },
      })
    end
  },
  {
    "zbirenbaum/copilot-cmp",
    config = function()
      require("copilot_cmp").setup()
    end
  },

What I see in insert mode: Screenshot-2023-10-31-18 28 43

The panel on the same line: Screenshot-2023-10-31-18 28 30

MunifTanjim commented 11 months ago

Try updating to the latest version.

Beside that, we can't control what suggestion Copilot generates. If the suggestion is not satisfactory, you can give feedback here: https://github.com/orgs/community/discussions/categories/copilot

dseravalli commented 11 months ago

@MunifTanjim Why is there a difference between the panel and the suggestion? Doesn't the panel showing full suggestions suggest Copilot is working?

MunifTanjim commented 11 months ago

Copilot has separate APIs for generating codes for Panel and Suggestion. That's why they're different. The editor plugin just shows whatever Copilot generates.