folke / todo-comments.nvim

✅ Highlight, list and search todo comments in your projects
Apache License 2.0
2.94k stars 86 forks source link

bug: TodoTrouble is the only picker that shows TODOs from other files in the project? #218

Open GideonWolfe opened 12 months ago

GideonWolfe commented 12 months ago

Did you check docs and existing issues?

Neovim version (nvim -v)

NVIM v0.9.1

Operating system/version

Arch Linux

Describe the bug

When I open the view with :TodoTrouble, I can see many different TODOs from across files in this project

image

However if I use any of the other pickers, for example :TodoLocList, I only see TODOs from the current file

image

Steps To Reproduce

  1. Open TodoTrouble and observe multiple files
  2. Open other picker and see only file currently open

Expected Behavior

All pickers should show TODO items across entire project

Repro

-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")

-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
  vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end

-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", lazypath, })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  "folke/tokyonight.nvim",
  "folke/todo-comments.nvim",
  -- add any other plugins here
}
require("lazy").setup(plugins, {
  root = root .. "/plugins",
})

vim.cmd.colorscheme("tokyonight")
-- add anything else here
drusmanbashir commented 4 weeks ago

May I add that seeing current file to do is desirable in some instances? Can an option be added so that we can configure todo list from file only versus entire project?

b0ae989c commented 4 weeks ago

This doesn't look like a bug. Your repro config does not install trouble. Could you provide the proper repro so I can investigate this issue?

drusmanbashir commented 4 weeks ago

Hi @b0ae989c if that question was for me, then no its a feature enhancement request. I have opened a separate ticket today for it.