Skip to content

Zed extension to highlight TODOs and other keywords in your code

License

Notifications You must be signed in to change notification settings

placintaalexandru/zed-todo-highlighter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TODO HIGHLIGHT for Zed

License: MIT Codecov CodeQL Dependabot enabled GitHub release (with filter)

Zed extension to highlight TODOs and other keywords in your code.





Preview

  • one keyword per line Logo

  • multiple keywords per line (in this case every keyword's patch will be highlighted using keyword's color) Logo

Config

In order to highlight the keywords, you need to allow Zed to draw background colors:

{
    "lsp_document_colors": "background"
}

TODO is a built-in keyword. You can override the look by customizing extension's settings.

To customize which keywords to highlight and their appearance, you can use local project's .zed/settings.json or global Zed's settings.json as long as the LSP server is enabled and configured:

"lsp": {
  "todo-highlight-lsp": {
    "initialization_options": {
      "highlights": {
        "TODO": {
          "background": "#81ff81"
        },
        "FIXME": {
          "background": "#ffff81"
        },
        "BUG": {
          "background": "#ff8181"
        }
      },
    },
  },
}

The color can be a RGB or a RGBA value, so the following is also accepted:

"lsp": {
  "todo-highlight-lsp": {
    "initialization_options": {
      "highlights": {
        "TODO": {
          "background": "#81ff811b"
        }
      }
    }
  }
}

Limitations

  1. Only background color is supported since it's the only feature supported by the LSP server. To add foreground color requires interaction with the editor and there is no Zed API at the moment.
  2. Not possible to show the line number of the highlighted keyword since extensions cannot modify the editor's UI.

About

Zed extension to highlight TODOs and other keywords in your code

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages