-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[clang-doc] Use QualName in Markdown output #119815
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ilovepi
merged 10 commits into
main
from
users/ilovepi/spr/clang-doc-use-qualname-in-markdown-output
Dec 13, 2024
Merged
[clang-doc] Use QualName in Markdown output #119815
ilovepi
merged 10 commits into
main
from
users/ilovepi/spr/clang-doc-use-qualname-in-markdown-output
Dec 13, 2024
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Created using spr 1.3.6-beta.1 [skip ci]
Created using spr 1.3.6-beta.1
@llvm/pr-subscribers-clang-tools-extra Author: Paul Kirth (ilovepi) ChangesQualName will provide the more useful typename when the type is Fixes #67549 Full diff: https://github.com/llvm/llvm-project/pull/119815.diff 2 Files Affected:
diff --git a/clang-tools-extra/clang-doc/MDGenerator.cpp b/clang-tools-extra/clang-doc/MDGenerator.cpp
index 795eb4b904e3ef..00c6605725dae9 100644
--- a/clang-tools-extra/clang-doc/MDGenerator.cpp
+++ b/clang-tools-extra/clang-doc/MDGenerator.cpp
@@ -157,17 +157,17 @@ static void genMarkdown(const ClangDocContext &CDCtx, const FunctionInfo &I,
for (const auto &N : I.Params) {
if (!First)
Stream << ", ";
- Stream << N.Type.Name + " " + N.Name;
+ Stream << N.Type.QualName + " " + N.Name;
First = false;
}
writeHeader(I.Name, 3, OS);
std::string Access = getAccessSpelling(I.Access).str();
if (Access != "")
- writeLine(genItalic(Access + " " + I.ReturnType.Type.Name + " " + I.Name +
+ writeLine(genItalic(Access + " " + I.ReturnType.Type.QualName + " " + I.Name +
"(" + Stream.str() + ")"),
OS);
else
- writeLine(genItalic(I.ReturnType.Type.Name + " " + I.Name + "(" +
+ writeLine(genItalic(I.ReturnType.Type.QualName + " " + I.Name + "(" +
Stream.str() + ")"),
OS);
if (I.DefLoc)
diff --git a/clang-tools-extra/test/clang-doc/templates.cpp b/clang-tools-extra/test/clang-doc/templates.cpp
index bf6528437b6ba9..b5590a92e7524c 100644
--- a/clang-tools-extra/test/clang-doc/templates.cpp
+++ b/clang-tools-extra/test/clang-doc/templates.cpp
@@ -150,7 +150,7 @@ tuple<int,int,bool> func_with_tuple_param(tuple<int,int,bool> t){ return t;}
// YAML-NEXT: ...
// MD: ### func_with_tuple_param
-// MD: *tuple func_with_tuple_param(tuple t)*
+// MD: *tuple<int, int, _Bool> func_with_tuple_param(tuple<int, int, _Bool> t)*
// MD: *Defined at {{.*}}templates.cpp#[[# @LINE - 44]]*
// MD: A function with a tuple parameter
// MD: **t** The input to func_with_tuple_param
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
petrhosek
approved these changes
Dec 13, 2024
Created using spr 1.3.6-beta.1 [skip ci]
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1 [skip ci]
Created using spr 1.3.6-beta.1 [skip ci]
Created using spr 1.3.6-beta.1 [skip ci]
Created using spr 1.3.6-beta.1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
QualName will provide the more useful typename when the type is
templated.
Fixes #67549