Closed HoloTheDrunk closed 1 year ago
I'm having the same issue: todo-comments
highlights keywords but they don't show up in any list.
Additionally, when I call require('todo-comments').jump_next()
or require('todo-comments').jump_prev()
, if a keyword is available, I'm getting this stack trace:
If there's no keywords, it works as intended and I get No more todo comments to jump to
.
I'm using nvim 0.8. Here's my config if it helps:
require("todo-comments").setup {
keywords = {
DELETEME = {
icon = "",
color = "#ff0000",
},
FIXME = {
icon = "",
color = "#fff400",
},
HACK = {
icon = "",
color = "#00f9ff",
},
TODO = {
icon = "",
color = "#ed00ff",
},
WIP = {
icon = "",
color = "#ff7C00",
}
},
merge_keywords = false,
}
The weird thing about this in my case was that TodoTelescope was working correctly, but TodoTrouble / TodoQuickfix both didn't.
@midoBB that's interesting. Are you using the default config? Can you give me an example with a comment that shows with Telescope, but not with the other commands?
This is my config at the moment. To be noted that if I don't include this pattern the Telescope search doesn't find the Todo comments.
local status_ok, trouble = pcall(require, "trouble")
if not status_ok then
return
end
trouble.setup {
mode = "workspace_diagnostics",
fold_open = "",
fold_closed = "",
auto_jump = { "lsp_definitions" },
auto_fold = true,
use_diagnostic_signs = true,
}
local status_ok, todo = pcall(require, "todo-comments")
if not status_ok then
return
end
todo.setup {
signs = true,
search = {
pattern = [[\b(KEYWORDS)\b]]
}
}
The default higlight pattern requires a :
, so I guess that's your issue?
I'm so sorry for troubling you. Yes, adding a column seemed to fix both.
@HoloTheDrunk did you change any of the patterns? highlight and search pattersn have a different syntax, so make sure you make them behave the same
I have the same issue.
Are there any updates on this?
UPD. https://github.com/BurntSushi/ripgrep/issues/623 solved the problem. I just had to add configuration like this.
I'm also confronted with the problem and adding --hidden
doesn't work for me. Also, when I run jump_next()
it says that there're no more todos.
i'm using lazy
& nvchad
and here is my code in custom/plugins.lua
related to todo-comments
{
"folke/todo-comments.nvim",
dependencies = {{"nvim-lua/plenary.nvim"}},
init = function()
require("core.utils").lazy_load "todo-comments.nvim"
end,
config = function (_, opts)
require("todo-comments").setup(opts)
end,
},
i have the same issue
Same issue for me too. TODO comments are highlighted, but the quickfix list, which I'm opening with a Telescope mapping, not with TodoTelescope
, remains empty. RunningTodoQuickfix
then populates it with values and I can access it with my dedicated Telescope mapping.
@folke, do you maybe have some pointers for us? Or is this by design?
I notice that I have this issue with specific files. Everything works fine in for example my vue/js/ts files but NOT in lua. Highlights showing up correctly but not listing in for example TodoTelescope.
@calvinchoy I fixed the issue by appending "--no-ignore-vcs" to the key search.args in opts/require('todo-comments').setup()
search = {
command = "rg",
args = {
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
"--no-ignore-vcs",
},
}
I had similar problems with telescope-live-grep not working in some projects and that was also fixed
@calvinchoy I fixed the issue by appending "--no-ignore-vcs" to the key search in opts/require('todo-comments').setup()
search = { command = "rg", args = { "--color=never", "--no-heading", "--with-filename", "--line-number", "--column", "--no-ignore-vcs", }, }
I had similar problems with telescope-live-grep not working in some projects and that fixed as well
Excellent, thanks!
todo-comments
finds the comments properly but they do not show in any of the lists (not Loc, QuickFix, Telescope nor Trouble).Error message Code sample used where FIXMEs are detected and highlighted (bottom window is Trouble)
Neovim version: 0.8