MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / method_label

Function method_label

graphify/interface_dispatch.py:78–91  ·  view source on GitHub ↗

Return a method node's bare name, for matching. Case is kept: C# and Swift are case sensitive, and an implementing member must spell the interface member exactly, so folding case could only pair a declaration with a member that does not implement it. The name is cut at the first pa

(node: dict)

Source from the content-addressed store, hash-verified

76
77
78def method_label(node: dict) -> str:
79 """Return a method node's bare name, for matching.
80
81 Case is kept: C# and Swift are case sensitive, and an implementing member
82 must spell the interface member exactly, so folding case could only pair a
83 declaration with a member that does not implement it.
84
85 The name is cut at the first parenthesis rather than by stripping a trailing
86 `()`. Today the extractors label every method `.Name()`, so the two are the
87 same, but the pair match is keyed on this string and a label that ever carried
88 a signature would silently stop matching instead of failing visibly.
89 """
90 label = str(node.get("label", "")).strip().removeprefix(".")
91 return label.split("(", 1)[0]
92
93
94def resolve_interface_dispatch(

Callers 2

Calls 1

getMethod · 0.45

Tested by

no test coverage detected