This release has been something I've been thinking about for a long while, and a friend finally kicked me into spending the evening building it. For those who are unfamiliar, ctags is a venerable Unix program that indexes function/macro/etc definitions in files of most languages, allowing you to jump to them nearly instantly in an editor. What it generates is a simple file with four columns, the name of the item, the file it's defined in, where it is in the file, and what its type is. This format is well supported in vim, emacs, and there are extensions for most other editors.
I implemented a generator for this format that can index nixpkgs or any other Nix script source and provide simple goto definition type navigation in an editor. This format inherently has limitations: it doesn't know which of several things with a given name are actually the thing you want, but it is vastly better than grep as it's better integrated into the editor, faster, and has fewer false positives.
nix-doc has other features as well: it has a Nix evaluator plugin that lets you access documentation for functions directly from the REPL, and a command line search tool. It's also threaded and quite fast: making tags for nixpkgs on my machine takes 2.5s, and is not a task you have to do super frequently, searches are 0.8s, and the evaluator plugin is effectively instant.
This release has been something I've been thinking about for a long while, and a friend finally kicked me into spending the evening building it. For those who are unfamiliar, ctags is a venerable Unix program that indexes function/macro/etc definitions in files of most languages, allowing you to jump to them nearly instantly in an editor. What it generates is a simple file with four columns, the name of the item, the file it's defined in, where it is in the file, and what its type is. This format is well supported in vim, emacs, and there are extensions for most other editors.
I implemented a generator for this format that can index
nixpkgsor any other Nix script source and provide simple goto definition type navigation in an editor. This format inherently has limitations: it doesn't know which of several things with a given name are actually the thing you want, but it is vastly better than grep as it's better integrated into the editor, faster, and has fewer false positives.nix-doc has other features as well: it has a Nix evaluator plugin that lets you access documentation for functions directly from the REPL, and a command line search tool. It's also threaded and quite fast: making tags for nixpkgs on my machine takes 2.5s, and is not a task you have to do super frequently, searches are 0.8s, and the evaluator plugin is effectively instant.