|
@@ -2,6 +2,9 @@
|
|
QAPI domain extension.
|
|
QAPI domain extension.
|
|
"""
|
|
"""
|
|
|
|
|
|
|
|
+# The best laid plans of mice and men, ...
|
|
|
|
+# pylint: disable=too-many-lines
|
|
|
|
+
|
|
from __future__ import annotations
|
|
from __future__ import annotations
|
|
|
|
|
|
from typing import (
|
|
from typing import (
|
|
@@ -116,6 +119,28 @@ def process_link(
|
|
|
|
|
|
return title, target
|
|
return title, target
|
|
|
|
|
|
|
|
+ def result_nodes(
|
|
|
|
+ self,
|
|
|
|
+ document: nodes.document,
|
|
|
|
+ env: BuildEnvironment,
|
|
|
|
+ node: Element,
|
|
|
|
+ is_ref: bool,
|
|
|
|
+ ) -> Tuple[List[nodes.Node], List[nodes.system_message]]:
|
|
|
|
+
|
|
|
|
+ # node here is the pending_xref node (or whatever nodeclass was
|
|
|
|
+ # configured at XRefRole class instantiation time).
|
|
|
|
+ results: List[nodes.Node] = [node]
|
|
|
|
+
|
|
|
|
+ if node.get("qapi:array"):
|
|
|
|
+ results.insert(0, nodes.literal("[", "["))
|
|
|
|
+ results.append(nodes.literal("]", "]"))
|
|
|
|
+
|
|
|
|
+ if node.get("qapi:optional"):
|
|
|
|
+ results.append(nodes.Text(", "))
|
|
|
|
+ results.append(nodes.emphasis("?", "optional"))
|
|
|
|
+
|
|
|
|
+ return results, []
|
|
|
|
+
|
|
|
|
|
|
# Alias for the return of handle_signature(), which is used in several places.
|
|
# Alias for the return of handle_signature(), which is used in several places.
|
|
# (In the Python domain, this is Tuple[str, str] instead.)
|
|
# (In the Python domain, this is Tuple[str, str] instead.)
|
|
@@ -413,6 +438,7 @@ class QAPICommand(QAPIObject):
|
|
"argument",
|
|
"argument",
|
|
label=_("Arguments"),
|
|
label=_("Arguments"),
|
|
names=("arg",),
|
|
names=("arg",),
|
|
|
|
+ typerolename="type",
|
|
can_collapse=False,
|
|
can_collapse=False,
|
|
),
|
|
),
|
|
# :error: descr
|
|
# :error: descr
|
|
@@ -426,6 +452,7 @@ class QAPICommand(QAPIObject):
|
|
GroupedField(
|
|
GroupedField(
|
|
"returnvalue",
|
|
"returnvalue",
|
|
label=_("Return"),
|
|
label=_("Return"),
|
|
|
|
+ rolename="type",
|
|
names=("return",),
|
|
names=("return",),
|
|
can_collapse=True,
|
|
can_collapse=True,
|
|
),
|
|
),
|
|
@@ -461,6 +488,7 @@ class QAPIAlternate(QAPIObject):
|
|
"alternative",
|
|
"alternative",
|
|
label=_("Alternatives"),
|
|
label=_("Alternatives"),
|
|
names=("alt",),
|
|
names=("alt",),
|
|
|
|
+ typerolename="type",
|
|
can_collapse=False,
|
|
can_collapse=False,
|
|
),
|
|
),
|
|
]
|
|
]
|
|
@@ -478,6 +506,7 @@ class QAPIObjectWithMembers(QAPIObject):
|
|
"member",
|
|
"member",
|
|
label=_("Members"),
|
|
label=_("Members"),
|
|
names=("memb",),
|
|
names=("memb",),
|
|
|
|
+ typerolename="type",
|
|
can_collapse=False,
|
|
can_collapse=False,
|
|
),
|
|
),
|
|
]
|
|
]
|