zbirenbaum / copilot.lua

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

Can't make copilot work with markdown files #200

Closed adonespitogo closed 11 months ago

adonespitogo commented 11 months ago

I tried adding the option filetypes and set markdown to true, but copilot is still not working for markdown files. I'm using copilot-cmp along with copilot.lua.

When I type :LspInfo copilot is not listed in the lsp clients.

MunifTanjim commented 11 months ago

What does :Copilot status say when you're editing markdown file?

adonespitogo commented 11 months ago

Here's the :Copilot status output:

[Copilot] Online                                                                                                                                                                  
[Copilot] Disabled ('filetype' markdown rejected by config filetypes[markdown])

Here's my packer config for copilot.lua and copilot-cmp:

  use({
    "zbirenbaum/copilot.lua",
    cmd = "Copilot",
    event = "InsertEnter",
    config = function()
      require("copilot").setup({
        panel = {
          enable = false,
        },
        suggestion = {
          enable = false,
          debounce = 250,
        },
        filetypes = {
          markdown = true,
        },
      })
    end,
  })
  use({
    "zbirenbaum/copilot-cmp",
    after = { "copilot.lua" },
    config = function()
      require("copilot_cmp").setup()
    end,
  })
MunifTanjim commented 11 months ago

Your config looks alright.

Did you compile packer config (or whatever it is that needed to be done... I don't use packer) after changing the config?

Also make sure you're using the latest version of the plugin.

adonespitogo commented 11 months ago

Yes every plugin in my system is updated using :PackerSync. There’s no need to compile packer. Closing and reopening nvim is enough to reload all config changes.

MunifTanjim commented 11 months ago

What's the output for :Copilot version?

Are you using the exact config from https://github.com/zbirenbaum/copilot.lua/issues/200#issuecomment-1666965998? Or is there any difference in your actual config?

filetypes = {
  markdown = true,
},

is working alright for me.

adonespitogo commented 11 months ago

:Copilot version output

Neovim 0.9.1                                                                                                                                                                      
copilot.vim 1.9.1                                                                                                                                                                 
copilot.lua e48bd7020a98be217d85c006a298656294fd6210                                                                                                                              
copilot/dist/agent.js not running                                                                                                                                                 
Node.js 16.4.0 

If you would like to see my complete nvim config, here's the link to my repo:

https://github.com/adonespitogo/nvim/blob/master/lua/packer_init.lua

adonespitogo commented 11 months ago

Hi, I just did another :PackerSync just now and everything worked. I don't why it did not work previously for markddown files. It was working with my golang files, but not with markdown. But now it worked for markdown after updating my nvim plugins. We can now close this issue as resolved.