================
@@ -57,7 +57,12 @@ static void writeFileDefinition(const ClangDocContext
&CDCtx, const Location &L,
OS << "*Defined at " << L.Filename << "#" << std::to_string(L.LineNumber)
<< "*";
} else {
- OS << "*Defined at [" << L.Filename << "#" << std::to_string(L.LineNumber)
+ OS << "*Defined at [" << L.Filename << "#";
+
+ if (!CDCtx.RepositoryLinePrefix)
+ OS << StringRef{*CDCtx.RepositoryLinePrefix};
+
+ OS << std::to_string(L.LineNumber)
----------------
ilovepi wrote:
```suggestion
OS << "*Defined at [" << L.Filename << "#"
<< CDCtx.RepositoryLinePrefix.value_or("")
<< std::to_string(L.LineNumber)
```
Perhaps something like this? In any case, there isn't a need to convert the
`optional<string>` into a `StringRef` here over just using the string value.
https://github.com/llvm/llvm-project/pull/131280
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits