[clang] [cindex] Add support for calling getFullyQualifiedName to the Python binding. (PR #135420)

Brian Cody via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 13 05:36:38 PDT 2025


================
@@ -535,6 +535,28 @@ def test_pretty(self):
         pp.set_property(PrintingPolicyProperty.SuppressTagKeyword, False)
         self.assertEqual(f.type.get_canonical().pretty_printed(pp), "struct X")
 
+    def test_fully_qualified_name(self):
+        source = """
+        namespace home {
+          class Bar {
+          };
+          class Foo {
+            public:
+              void setIt(Bar*);
+          };
+        }
+        class A : public home::Foo {
+        };
+        """
+        tu = get_tu(source, lang="cpp")
+        c = get_cursor(tu, "A")
+        pp = PrintingPolicy.create(c)
+        base = list(c.get_children())[0].type.get_declaration()
+        set_it = list(base.get_children())[1]
+        arg = list(set_it.get_arguments())[0]
----------------
epistax wrote:

Thanks, didn't occur to me that there would be a more direct route. 

https://github.com/llvm/llvm-project/pull/135420


More information about the cfe-commits mailing list