Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlighting of special code comment types like TODO, INFO, etc. #11895

Open
1 task done
adiepenbrock opened this issue May 16, 2024 · 14 comments
Open
1 task done

Highlighting of special code comment types like TODO, INFO, etc. #11895

adiepenbrock opened this issue May 16, 2024 · 14 comments
Labels
editor Feedback for code editing, formatting, editor iterations, etc feature [core label] potential extension Functionality that could be implemented as an extension (consider moving to community extensions)

Comments

@adiepenbrock
Copy link

Check for existing issues

  • 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

image
@JosephTLyons JosephTLyons added editor Feedback for code editing, formatting, editor iterations, etc potential extension Functionality that could be implemented as an extension (consider moving to community extensions) and removed triage labels May 16, 2024
@francesco-gaglione
Copy link
Contributor

francesco-gaglione commented Jul 20, 2024

I'm considering to work on this. Some instructions on how to do it? Colours for example.
And is it still needed?

@diogox
Copy link

diogox commented Aug 20, 2024

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 :)

@francesco-gaglione
Copy link
Contributor

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?

@kofron
Copy link

kofron commented Sep 9, 2024

@francesco-gaglione did you wind up taking a stab at this?

@francesco-gaglione
Copy link
Contributor

@kofron I need first the confirmation from mainteiners to do this into zed core and not in the plugins

@everdrone
Copy link
Contributor

There is this open issue: zed-industries/extensions#523 where the direction was to implement it as an extension.

@aretrace
Copy link

aretrace commented Nov 1, 2024

My hope is that a straightforward comment tag system could just be integrated into zed itself.

@berkus
Copy link
Contributor

berkus commented Nov 4, 2024

@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.

@francesco-gaglione
Copy link
Contributor

@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?

@berkus
Copy link
Contributor

berkus commented Nov 4, 2024

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.

@phistep
Copy link

phistep commented Nov 7, 2024

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" } },
}

@iairu
Copy link

iairu commented Nov 21, 2024

@kofron I need first the confirmation from mainteiners to do this into zed core and not in the plugins

@kofron @berkus see #9082 (comment)

tl;dr: someone tried to merge a working implementation but got denied, devs want this as an extension and not in core

@Trikzon
Copy link

Trikzon commented Dec 18, 2024

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.

@berkus
Copy link
Contributor

berkus commented Jan 2, 2025

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 #10546 but it's all unified under zed-industries/extensions#523

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor Feedback for code editing, formatting, editor iterations, etc feature [core label] potential extension Functionality that could be implemented as an extension (consider moving to community extensions)
Projects
None yet
Development

No branches or pull requests