luozhiya / fittencode.nvim

Fitten Code AI Programming Assistant for Neovim
49 stars 8 forks source link

更新后 第一次实用cmp补全 会莫名奇妙卡住一下,必须要实用 ctrl+c 中断之后才能继续 #100

Closed cxwx closed 2 days ago

cxwx commented 3 days ago

卡住之前

================================================================================
Verbose logging started: 2024-07-01 15:19:10
Log level: DEBUG
Calling process: /opt/homebrew/Cellar/neovim/0.10.0/bin/nvim
Neovim version: {
  buildtype = "Release",
  luajit = "2.1.1716656478",
  nvim = "v0.10.0"
}
Process ID: 45443
Parent process ID: 45442
OS: {
  machine = "arm64",
  release = "23.5.0",
  sysname = "Darwin",
  version = "Darwin Kernel Version 23.5.0: Wed May  1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000"
}
================================================================================
[ INFO] [2024-07-01 15:19:10.786] Last session for user "********" loaded successful
[DEBUG] [2024-07-01 15:19:10.577] I > GENERATING
[DEBUG] [2024-07-01 15:19:10.577] I<"39185495e80b6"> Send request at cursor: { 0, 1 }
[DEBUG] [2024-07-01 15:19:10.719] I<"39185495e80b6"> Received and time elapsed: 141 ms
[DEBUG] [2024-07-01 15:19:10.720] I<"39185495e80b6"> Preprocessed: { ". local fn = vim.fn" }, Generated: { ". local fn = vim.fn"

ctrl+c 之后

================================================================================
Verbose logging started: 2024-07-01 15:19:10
Log level: DEBUG
Calling process: /opt/homebrew/Cellar/neovim/0.10.0/bin/nvim
Neovim version: {
  buildtype = "Release",
  luajit = "2.1.1716656478",
  nvim = "v0.10.0"
}
Process ID: 45443
Parent process ID: 45442
OS: {
  machine = "arm64",
  release = "23.5.0",
  sysname = "Darwin",
  version = "Darwin Kernel Version 23.5.0: Wed May  1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000"
}
================================================================================
[ INFO] [2024-07-01 15:19:10.786] Last session for user "********" loaded successful
[DEBUG] [2024-07-01 15:19:10.577] I > GENERATING
[DEBUG] [2024-07-01 15:19:10.577] I<"39185495e80b6"> Send request at cursor: { 0, 1 }
[DEBUG] [2024-07-01 15:19:10.719] I<"39185495e80b6"> Received and time elapsed: 141 ms
[DEBUG] [2024-07-01 15:19:10.720] I<"39185495e80b6"> Preprocessed: { ". local fn = vim.fn" }, Generated: { ". local fn = vim.fn" }
[DEBUG] [2024-07-01 15:19:28.995] I > IDLE
[DEBUG] [2024-07-01 15:19:28.005] I > SUGGESTIONS_READY
luozhiya commented 3 days ago

@cxwx

复现不了

cxwx commented 3 days ago

好像是啥其他插件出来的问题,我找找看,但是不使用fittencode就不会卡住

cxwx commented 2 days ago

问题应该是发生在 lualine.nvim 的配置中

          lualine_x = {
            {
              function()
                local emoji = {"⏸️ ", "⌛️", "⚠️ ", "🚫", "✅"}
                return "🅕 " .. emoji[require("fittencode").get_current_status()+1]
              end,
              cond = require("fittencode").has_suggestions,
              color = { fg = "#37b0e7", bg = "#101945" },
            },
          },

这样能复现吗?

@cxwx

复现不了

luozhiya commented 2 days ago

问题应该是发生在 lualine.nvim 的配置中

          lualine_x = {
            {
              function()
                local emoji = {"⏸️ ", "⌛️", "⚠️ ", "🚫", "✅"}
                return "🅕 " .. emoji[require("fittencode").get_current_status()+1]
              end,
              cond = require("fittencode").has_suggestions,
              color = { fg = "#37b0e7", bg = "#101945" },
            },
          },

这样能复现吗?

@cxwx

复现不了

有可能是这个原因,不过我现在没电脑测试。

您看下 readme说明,最近状态值改了,新增了disabled。

local StatusCodes = { DISABLED = 1, IDLE = 2, GENERATING = 3, ERROR = 4, NO_MORE_SUGGESTIONS = 5, SUGGESTIONS_READY = 6, }
cxwx commented 2 days ago

貌似是这里的问题。