[gi-docgen/ebassi/introspectable: 2/3] generate: Add shadows/shadowed-by metadata
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gi-docgen/ebassi/introspectable: 2/3] generate: Add shadows/shadowed-by metadata
- Date: Wed, 9 Feb 2022 16:21:41 +0000 (UTC)
commit 729bb609c46181bf5bc76c7f6ec222125160057e
Author: Emmanuele Bassi <ebassi gnome org>
Date: Wed Feb 9 16:18:50 2022 +0000
generate: Add shadows/shadowed-by metadata
Methods and functions can shadow other symbols within the same type
and namespace; and, in turn, can be shadowed by other symbols.
We can use this information inside the templates when generating the
documentation.
gidocgen/gdgenerate.py | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
---
diff --git a/gidocgen/gdgenerate.py b/gidocgen/gdgenerate.py
index 1e4099f..57d8272 100644
--- a/gidocgen/gdgenerate.py
+++ b/gidocgen/gdgenerate.py
@@ -835,6 +835,20 @@ class TemplateMethod:
self.introspectable = method.introspectable
+ self.shadows = method.shadows
+ if method.shadows:
+ for m in type_.methods:
+ if m.name == method.shadows:
+ self.shadows_symbol = m.identifier
+ break
+ self.shadowed_by = method.shadowed_by
+ if method.shadowed_by:
+ for m in type_.methods:
+ if m.name == method.shadowed_by:
+ self.shadowed_by_symbol = m.identifier
+ break
+
+
def transform_property_attribute(namespace, type_, method, value):
if value in type_.properties:
text = f"{namespace.name}.{type_.name}:{value}"
@@ -1044,6 +1058,17 @@ class TemplateFunction:
self.introspectable = func.introspectable
+ self.shadows = func.shadows
+ if func.shadows:
+ f = namespace.find_function(func.shadows)
+ if f is not None:
+ self.shadows_symbol = f.identifier
+ self.shadowed_by = func.shadowed_by
+ if func.shadowed_by:
+ f = namespace.find_function(func.shadowed_by)
+ if f is not None:
+ self.shadowed_by_symbol = f.identifier
+
@property
def c_decl(self):
res = []
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]