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

Method _resolve_alias

graphify/extractors/csharp.py:502–517  ·  view source on GitHub ↗
(self, label: str, source_node: dict, source_file: str)

Source from the content-addressed store, hash-verified

500 return levels
501
502 def _resolve_alias(self, label: str, source_node: dict, source_file: str) -> str | None:
503 hits = set()
504 for target_fqn, scope_kind, scope_id in self.aliases_by_file.get(source_file, {}).get(label, []):
505 if not self._using_in_scope(scope_kind, scope_id, source_node):
506 continue
507 base_fqn = _strip_trailing_csharp_generic_args(html.unescape(target_fqn))
508 namespace, sep, simple_name = base_fqn.rpartition(".")
509 if not sep:
510 simple_name = namespace
511 namespace = ""
512 if not simple_name:
513 continue
514 hit = self.type_def_index.get((namespace, simple_name))
515 if hit:
516 hits.add(hit)
517 return next(iter(hits)) if len(hits) == 1 else None
518
519 def _resolve_nested_type(self, holder_nid: str, name: str) -> str | None:
520 hits: set[str] = set()

Callers 1

resolve_type_nameMethod · 0.95

Calls 3

_using_in_scopeMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected