#16531·nix

:doc command unfolds partial applications even when definition has documentation

Author: leana8959Created Sep 27, 2026Updated Sep 29, 2026
Labelsbug

Describe the bug

In the following snippet, :doc bar will explain foo instead of bar because bar is foo partially applied.

Steps To Reproduce

Save this to a file. In the repl, run :doc bar.

nix
rec {
  /**
    foo
    */
  foo = _: _: {};
  
  /**
    bar
    */
  bar = foo {};
}

Expected behavior

Nix should not try to find the documentation of the underlying function. Or, alternatively, it should allow a pragma comment to specify whether it tries to find the documentation of the underlying function.

Metadata

nix-env (Nix) 2.34.8

Additional context

Checklist


Add :+1: to issues you find important.