Skip to content

doc: add documentation to __addErrorContext primop#15817

Open
Zocker1999NET wants to merge 1 commit into
NixOS:masterfrom
Zocker1999NET:doc-addErrorContext
Open

doc: add documentation to __addErrorContext primop#15817
Zocker1999NET wants to merge 1 commit into
NixOS:masterfrom
Zocker1999NET:doc-addErrorContext

Conversation

@Zocker1999NET
Copy link
Copy Markdown

@Zocker1999NET Zocker1999NET commented May 8, 2026

This adds .args and .doc fields to the primop registration for __addErrorContext, making it appear in the builtins reference manual.

Motivation

more documentation -> more good

The issue is known since 2017 & I really think this function should be documented as it is helpful for making your own Nix expressions easier to debug.

Context

fixes #1609

I tried to use a similar documentation format already used on similar "side-effect" wrappers like warn.


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

Copilot AI review requested due to automatic review settings May 8, 2026 22:11
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes builtins.addErrorContext show up in the builtins reference manual by adding argument names (.args) and a documentation string (.doc) to the underlying __addErrorContext primop registration.

Changes:

  • Add .args = {"context", "value"} for the __addErrorContext primop.
  • Add a Markdown .doc block (including an example) describing addErrorContext.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/libexpr/primops.cc Outdated
@Zocker1999NET Zocker1999NET force-pushed the doc-addErrorContext branch from 843e015 to a4e691d Compare May 8, 2026 22:21
Comment thread src/libexpr/primops.cc Outdated
This adds .args and .doc fields to the primop registration for
__addErrorContext, making it appear in the builtins reference manual.
@Zocker1999NET Zocker1999NET force-pushed the doc-addErrorContext branch from a4e691d to 3fd52d9 Compare May 10, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

addErrorContext is undocumented

3 participants