Skip to content

Conversation

@evelez7
Copy link
Member

@evelez7 evelez7 commented Nov 21, 2025

No description provided.

@evelez7 evelez7 marked this pull request as ready for review November 21, 2025 22:14
Copy link
Member Author

evelez7 commented Nov 21, 2025

@llvmbot
Copy link
Member

llvmbot commented Nov 21, 2025

@llvm/pr-subscribers-clang-tools-extra

Author: Erick Velez (evelez7)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/169109.diff

2 Files Affected:

  • (modified) clang-tools-extra/clang-doc/assets/class-template.mustache (+1)
  • (modified) clang-tools-extra/test/clang-doc/namespace.cpp (+4-4)
diff --git a/clang-tools-extra/clang-doc/assets/class-template.mustache b/clang-tools-extra/clang-doc/assets/class-template.mustache
index 8eb28f33e65f6..8e221227bd9d9 100644
--- a/clang-tools-extra/clang-doc/assets/class-template.mustache
+++ b/clang-tools-extra/clang-doc/assets/class-template.mustache
@@ -128,6 +128,7 @@
             <section class="hero section-container">
                 <div class="hero__title">
                     <h1 class="hero__title-large">{{TagType}} {{Name}}</h1>
+                    <p>Defined at line {{Location.LineNumber}} of file {{Location.Filename}}</p>
                     {{#Description}}
                     <div class="hero__subtitle">
                         {{>Comments}}
diff --git a/clang-tools-extra/test/clang-doc/namespace.cpp b/clang-tools-extra/test/clang-doc/namespace.cpp
index 96ea5bc52b0be..e68cea3c1d539 100644
--- a/clang-tools-extra/test/clang-doc/namespace.cpp
+++ b/clang-tools-extra/test/clang-doc/namespace.cpp
@@ -70,7 +70,7 @@ void anonFunction() {}
 class AnonClass {};
 // MD-ANON-CLASS-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp#[[@LINE-1]]*
 // HTML-ANON-CLASS-LINE: <p>Defined at line [[@LINE-2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
-// MUSTACHE-ANON-CLASS-LINE-NOT: <p>Defined at line [[@LINE-3]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
+// MUSTACHE-ANON-CLASS-LINE: <p>Defined at line [[@LINE-3]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
 
 // MD-ANON-CLASS: # class AnonClass
 // HTML-ANON-CLASS: <h1>class AnonClass</h1>
@@ -117,7 +117,7 @@ void functionInPrimaryNamespace() {}
 class ClassInPrimaryNamespace {};
 // MD-PRIMARY-CLASS-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp#[[@LINE-1]]*
 // HTML-PRIMARY-CLASS-LINE: <p>Defined at line [[@LINE-2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
-// MUSTACHE-PRIMARY-CLASS-LINE-NOT: <p>Defined at line [[@LINE-3]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
+// MUSTACHE-PRIMARY-CLASS-LINE: <p>Defined at line [[@LINE-3]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
 
 // MD-PRIMARY-CLASS: # class ClassInPrimaryNamespace
 // MD-PRIMARY-CLASS: Class in PrimaryNamespace
@@ -139,7 +139,7 @@ void functionInNestedNamespace() {}
 class ClassInNestedNamespace {};
 // MD-NESTED-CLASS-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp#[[@LINE-1]]*
 // HTML-NESTED-CLASS-LINE: <p>Defined at line [[@LINE-2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
-// MUSTACHE-NESTED-CLASS-LINE-NOT: <p>Defined at line [[@LINE-3]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
+// MUSTACHE-NESTED-CLASS-LINE: <p>Defined at line [[@LINE-3]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
 
 // MD-NESTED-CLASS: # class ClassInNestedNamespace
 // MD-NESTED-CLASS: Class in NestedNamespace
@@ -233,7 +233,7 @@ void functionInAnotherNamespace() {}
 class ClassInAnotherNamespace {};
 // MD-ANOTHER-CLASS-LINE: *Defined at {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp#[[@LINE-1]]*
 // HTML-ANOTHER-CLASS-LINE: <p>Defined at line [[@LINE-2]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
-// MUSTACHE-ANOTHER-CLASS-LINE-NOT: <p>Defined at line [[@LINE-3]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
+// MUSTACHE-ANOTHER-CLASS-LINE: <p>Defined at line [[@LINE-3]] of file {{.*}}clang-tools-extra{{[\/]}}test{{[\/]}}clang-doc{{[\/]}}namespace.cpp</p>
 
 // MD-ANOTHER-CLASS: # class ClassInAnotherNamespace
 // MD-ANOTHER-CLASS:  Class in AnotherNamespace

@evelez7 evelez7 requested review from ilovepi and petrhosek November 21, 2025 22:17
Copy link
Member Author

evelez7 commented Nov 21, 2025

Definition line can be seen in the basic project: https://erickvelez.com/clang-doc-mustache-output/pr169109/GlobalNamespace/_ZTV5Shape.html

@github-actions
Copy link

🐧 Linux x64 Test Results

  • 3053 tests passed
  • 7 tests skipped

@evelez7 evelez7 force-pushed the users/evelez7/clang-doc-add-definition-to-classes branch from dc51cf9 to ee57352 Compare November 24, 2025 17:50
@evelez7 evelez7 force-pushed the users/evelez7/clang-doc-test-mustache-namespace branch from 79f518f to 7ad494f Compare November 24, 2025 17:50
Base automatically changed from users/evelez7/clang-doc-test-mustache-namespace to main November 24, 2025 18:08
@evelez7 evelez7 force-pushed the users/evelez7/clang-doc-add-definition-to-classes branch 2 times, most recently from 41497b6 to 0a0e570 Compare November 24, 2025 18:22
Copy link
Member Author

evelez7 commented Nov 24, 2025

Merge activity

  • Nov 24, 6:22 PM UTC: Graphite rebased this pull request as part of a merge.
  • Nov 24, 6:35 PM UTC: Graphite rebased this pull request as part of a merge.
  • Nov 24, 6:41 PM UTC: Graphite rebased this pull request as part of a merge.
  • Nov 24, 6:46 PM UTC: Graphite rebased this pull request as part of a merge.
  • Nov 24, 6:51 PM UTC: Graphite rebased this pull request as part of a merge.
  • Nov 24, 6:59 PM UTC: Graphite rebased this pull request as part of a merge.

@evelez7 evelez7 force-pushed the users/evelez7/clang-doc-add-definition-to-classes branch 4 times, most recently from aff0940 to f7f6b44 Compare November 24, 2025 18:50
@evelez7 evelez7 force-pushed the users/evelez7/clang-doc-add-definition-to-classes branch from f7f6b44 to 66601fc Compare November 24, 2025 18:59
@evelez7 evelez7 merged commit 4a0d485 into main Nov 24, 2025
5 of 9 checks passed
@evelez7 evelez7 deleted the users/evelez7/clang-doc-add-definition-to-classes branch November 24, 2025 19:01
aadeshps-mcw pushed a commit to aadeshps-mcw/llvm-project that referenced this pull request Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants