Skip to content

mcsf/agtag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 

Repository files navigation

agtag

A bespoke low-tech alternative to ctags to generate tag files (i.e. symbol lookup tables) for large hybrid codebases like Gutenberg and WordPress.

agtag crawls a codebase in search for global symbols, such as exported identifiers in JavaScript, TypeScript interfaces, or named functions in PHP, and collects these symbols into an index known as a tag file.

Tag files allow text editors to quickly jump to definitions across a codebase, provide rudimentary completion, etc. Though a blunt tool, tags generated by agtag can, in the right circumstances, provide better lookup capabilities than modern LSP-powered editors.

Usage

Generate a tag file for the current project:

$ agtag > tags

Install

  • Place agtag anywhere included in your shell's $PATH.
  • Make sure it can be executed with chmod +x agtag.

Requirements

FAQ

  • I don't use ag; can I use rg / ugrep / ack?

This script has only been used with ag and it assumes a series of ag-specific options, but you should be able to adapt it by overwriting the existing environment variables (AG_FMT_OPTS, AG_JS_OPTS, AG_PHP_OPTS). Meanwhile, we'll need a more suitable name than ag tag. ;-)

About

Use `ag` to generate tags (as in `ctags`) for a project, or to look up a specific tag.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages