zed
zed copied to clipboard
Highlighting of special code comment types like TODO, INFO, etc.
Check for existing issues
- [X] Completed
Describe the feature
One feature that I find really useful in other editors, e.g., Neovim with the plugin "folke/todo-comments," is the ability to highlight specific types of comments like // TODO // INFO and others. This feature enhances productivity by making it easier to locate and manage important comments within the codebase when scrolling / jumping through the code.
Because there may be users who don't want this kind of highlights in the code, it should be configurable by the user (activate / deactivate, configure highlighting color or deriving it from the used theme, etc.)
There is already a feature request (#4808) to introduce a separate tree-structure overview of these comments. However, I think this should also be available in the code itself.
If applicable, add mockups / screenshots to help present your vision of the feature
I'm considering to work on this. Some instructions on how to do it? Colours for example. And is it still needed?
I don't know about the color requirements, but any implementation would probably be a good start. I use this every day in other editors and find it very useful :)
I readed somewhere that this should be done zed extensions and not in the core codebase. It is still true or we want to consider to implement it in the core?
@francesco-gaglione did you wind up taking a stab at this?
@kofron I need first the confirmation from mainteiners to do this into zed core and not in the plugins
There is this open issue: https://github.com/zed-industries/extensions/issues/523 where the direction was to implement it as an extension.
My hope is that a straightforward comment tag system could just be integrated into zed itself.
@francesco-gaglione you can take a stab at implementing this in the core. Why I believe this is useful:
- we will have a working highlight implementation
- it will expose what APIs are necessary; if they are all available to the plugins, it will be trivial to port over
- otherwise, first things to do would be to expose those APIs to plugins
So the work is not wasted anyway.
@berkus it is a lot of time I don't contribute here... but it is very usefull so I'll take a look.... some hint on where to start?
No idea, i am not super familiar with zed's internals. I would look through syntax highlighting and editing plumbing - it's probably there at the intersection of those parts.
I also use NOTE and this package https://github.com/folke/todo-comments.nvim includes
keywords = {
FIX = {
icon = " ", -- icon used for the sign, and in search results
color = "error", -- can be a hex color, or a named color (see below)
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords
-- signs = false, -- configure signs for some keywords individually
},
TODO = { icon = " ", color = "info" },
HACK = { icon = " ", color = "warning" },
WARN = { icon = " ", color = "warning", alt = { "WARNING", "XXX" } },
PERF = { icon = " ", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
NOTE = { icon = " ", color = "hint", alt = { "INFO" } },
TEST = { icon = "⏲ ", color = "test", alt = { "TESTING", "PASSED", "FAILED" } },
}
@kofron I need first the confirmation from mainteiners to do this into zed core and not in the plugins
@kofron @berkus see https://github.com/zed-industries/zed/pull/9082#issuecomment-1997957426
tl;dr: someone tried to merge a working implementation but got denied, devs want this as an extension and not in core
Not sure if this would need another issue, but it would also be nice if Zed would have a panel for listing all TODO comments in a project to find them easier.
Not sure if this would need another issue, but it would also be nice if Zed would have a panel for listing all TODO comments in a project to find them easier.
This seems to be related https://github.com/zed-industries/zed/issues/10546 but it's all unified under https://github.com/zed-industries/extensions/issues/523