jackMort / ChatGPT.nvim

ChatGPT Neovim Plugin: Effortless Natural Language Generation with OpenAI's ChatGPT API
Apache License 2.0
3.76k stars 313 forks source link

attempt to get length of local prev_line #85

Closed yingzhu146 closed 1 year ago

yingzhu146 commented 1 year ago

Hi,

nvim head, macOS, ARM. Lazy.vim. on commit 60b4824, but this has been happening since first install (since reddit intro post).

I'm getting the following error:

error ``` Error executing lua callback: ...lar/neovim/0.8.2/share/nvim/runtime/lua/vim/lsp/sync.lua:177: attempt to get length of local 'prev_line' (a nil value) stack traceback: ...lar/neovim/0.8.2/share/nvim/runtime/lua/vim/lsp/sync.lua:177: in function 'compute_start_range' ...lar/neovim/0.8.2/share/nvim/runtime/lua/vim/lsp/sync.lua:408: in function 'compute_diff' ...w/Cellar/neovim/0.8.2/share/nvim/runtime/lua/vim/lsp.lua:442: in function 'incremental_changes' ...w/Cellar/neovim/0.8.2/share/nvim/runtime/lua/vim/lsp.lua:635: in function 'send_changes' ...w/Cellar/neovim/0.8.2/share/nvim/runtime/lua/vim/lsp.lua:1547: in function <...w/Cellar/neovim/0.8.2/share/nvim/runtime/lua/vim/lsp.lua:1541> ```

LspInfo shows the following

``` Language client log: /Users/yingzhu/.local/state/nvim/lsp.log Detected filetype: noice 0 client(s) attached to this buffer: 3 active client(s) not attached to this buffer: Client: 1 (id: 1, bufnr: []) filetypes: autostart: false root directory: Running in single file mode. cmd: /Users/yingzhu/.local/share/nvim/lazy/sg.nvim/target/debug/sg-lsp Client: copilot (id: 2, bufnr: [1, 62]) filetypes: TelescopePrompt autostart: false root directory: Running in single file mode. cmd: node /Users/yingzhu/.local/share/nvim/lazy/copilot.vim/copilot/dist/agent.js Client: marksman (id: 3, bufnr: [54]) filetypes: markdown autostart: true root directory: Running in single file mode. cmd: marksman server Configured servers list: denols, dockerls, codeqlls, cmake, eslint, julials, jsonnet_ls, bashls, awk_ls, cssls, gopls, bufls, grammarly, clojure_lsp, golangci_lint_ls, ruff_lsp, rust_analyzer, html, lua_ls, vimls, jsonls, marksman, yamlls, terraformls, pyright, sqlls, graphql, clangd, texlab ```

and my null-ls says nothing attached


    null-ls
    https://github.com/jose-elias-alvarez/null-ls.nvim

    Supported source(s)

    * Note: current buffer has no sources attached

it looks like something lsp related but no idea why - this only happens in the nui window in chatgpt, nowhere else.

many thanks for the help!

yingzhu146 commented 1 year ago

https://github.com/neovim/neovim/issues/17615#issuecomment-1386848317 -

the input field has "" as filetype

    {
      "github/copilot.vim",
      event = "VeryLazy",
      build = "curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash",
      config = function()
        vim.g.copilot_filetypes = {
          ["chatgpt"] = false,
          ["python"] = true,
          ["lua"] = true,
          ["rust"] = true,
          ["clojure"] = true,
          ["R"] = true,
          ["nu"] = true,
          ["javascript"] = true,
          ["typescript"] = true,
          ["go"] = true,
          ["markdown"] = true,
          ["*"] = false,
        }
      end,
    },

will solve the issue