mirror of
https://github.com/NixOS/nix
synced 2025-06-26 20:01:15 +02:00
Use HintFmt for doc comments
This commit is contained in:
parent
6a125e65d0
commit
ce31a0457f
2 changed files with 6 additions and 6 deletions
|
@ -668,12 +668,12 @@ ProcessLineResult NixRepl::processLine(std::string line)
|
||||||
logger->cout(trim(renderMarkdownToTerminal(markdown)));
|
logger->cout(trim(renderMarkdownToTerminal(markdown)));
|
||||||
} else if (fallbackPos) {
|
} else if (fallbackPos) {
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << "Attribute `" << fallbackName << "`\n\n";
|
ss << HintFmt("Attribute '%1%'", fallbackName) << "\n\n";
|
||||||
ss << " … defined at " << state->positions[fallbackPos] << "\n\n";
|
ss << HintFmt(" … defined at %1%", state->positions[fallbackPos]) << "\n\n";
|
||||||
if (fallbackDoc) {
|
if (fallbackDoc) {
|
||||||
ss << fallbackDoc.getInnerText(state->positions);
|
ss << fallbackDoc.getInnerText(state->positions);
|
||||||
} else {
|
} else {
|
||||||
ss << "No documentation found.\n\n";
|
ss << HintFmt("No documentation found.") << "\n\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
auto markdown = ss.str();
|
auto markdown = ss.str();
|
||||||
|
|
|
@ -576,17 +576,17 @@ std::optional<EvalState::Doc> EvalState::getDoc(Value & v)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name.empty()) {
|
if (name.empty()) {
|
||||||
s << "Function ";
|
s << HintFmt("Function ");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
s << "Function `" << name << "`";
|
s << HintFmt("Function '%s'", name);
|
||||||
if (pos)
|
if (pos)
|
||||||
s << "\\\n … " ;
|
s << "\\\n … " ;
|
||||||
else
|
else
|
||||||
s << "\\\n";
|
s << "\\\n";
|
||||||
}
|
}
|
||||||
if (pos) {
|
if (pos) {
|
||||||
s << "defined at " << pos;
|
s << HintFmt("defined at %1%", pos);
|
||||||
}
|
}
|
||||||
if (!docStr.empty()) {
|
if (!docStr.empty()) {
|
||||||
s << "\n\n";
|
s << "\n\n";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue