# `orchestrator.pkg.csharp_extractor`
<!-- generated by `orchestrator understand`; the PKG is source of truth, edits here are advisory -->

[← Episteme](../README.md) · [Architecture](../architecture.md)

**Source:** [`src/orchestrator/pkg/csharp_extractor.py`](../../src/orchestrator/pkg/csharp_extractor.py)

2 types · 26 functions · python

## Changing this safely

**Tested by** (1): `tests.pkg.test_csharp_extractor`

**Most depended-upon here** — a change to these reaches the most code (call graph, ≤4 hops):

- [`_text`](../../src/orchestrator/pkg/csharp_extractor.py#L721) — reaches **23** symbols · **no test path visible**
- [`_field_text`](../../src/orchestrator/pkg/csharp_extractor.py#L716) — reaches **8** symbols · **no test path visible**
- [`_join_ns`](../../src/orchestrator/pkg/csharp_extractor.py#L491) — reaches **8** symbols · **no test path visible**
- [`_base_types`](../../src/orchestrator/pkg/csharp_extractor.py#L528) — reaches **7** symbols · **no test path visible**
- [`_last_segment`](../../src/orchestrator/pkg/csharp_extractor.py#L503) — reaches **7** symbols · **no test path visible**
- [`CSharpExtractor`](../../src/orchestrator/pkg/csharp_extractor.py#L92) — reaches **6** symbols
- [`_attributes`](../../src/orchestrator/pkg/csharp_extractor.py#L552) — reaches **5** symbols · **no test path visible**
- [`_find_string`](../../src/orchestrator/pkg/csharp_extractor.py#L574) — reaches **5** symbols · **no test path visible**

_26 of the symbols other code depends on here have no test path the graph can see — worth a second look before changing them. Absence of a path is not proof of absence of a test: calls through an attribute chain (`obj.method()`) are skipped rather than guessed at, so indirect coverage is invisible._

## Types

### `CSharpExtractor`

[`src/orchestrator/pkg/csharp_extractor.py:92`](../../src/orchestrator/pkg/csharp_extractor.py#L92)

- **Called by** (1 production · 4 test): [`default_extractors`](../../src/orchestrator/pkg/extractor.py#L530), [`_facts`](../../tests/pkg/test_csharp_extractor.py#L41), [`test_first_party_base_type_keeps_its_namespace`](../../tests/pkg/test_csharp_extractor.py#L363), [`test_framework_base_type_is_not_placed_in_the_local_namespace`](../../tests/pkg/test_csharp_extractor.py#L339), [`test_repo_extractor_dispatches_csharp_by_suffix`](../../tests/pkg/test_csharp_extractor.py#L97)
- **Fields**: `language`, `suffixes`
- **Documented in**: `docs/specs/language-support-roadmap.md#track-1-c-cs-do-first-lowest-risk`

### `_TypeRec`

[`src/orchestrator/pkg/csharp_extractor.py:82`](../../src/orchestrator/pkg/csharp_extractor.py#L82)

- **Called by** (1): [`_emit_type`](../../src/orchestrator/pkg/csharp_extractor.py#L197)
- **Fields**: `methods`, `name`, `namespace`, `node`, `type_id`

## Functions

### `_attr_string_arg`

[`src/orchestrator/pkg/csharp_extractor.py:566`](../../src/orchestrator/pkg/csharp_extractor.py#L566)

- **Called by** (1): [`_endpoint_edges`](../../src/orchestrator/pkg/csharp_extractor.py#L331)
- **Calls** (1): [`_find_string`](../../src/orchestrator/pkg/csharp_extractor.py#L574)

### `_attributes`

[`src/orchestrator/pkg/csharp_extractor.py:552`](../../src/orchestrator/pkg/csharp_extractor.py#L552)

- **Called by** (3): [`_endpoint_edges`](../../src/orchestrator/pkg/csharp_extractor.py#L331), [`_entity_edges`](../../src/orchestrator/pkg/csharp_extractor.py#L404), [`_is_controller`](../../src/orchestrator/pkg/csharp_extractor.py#L366)
- **Calls** (2): [`_field_text`](../../src/orchestrator/pkg/csharp_extractor.py#L716), [`_last_segment`](../../src/orchestrator/pkg/csharp_extractor.py#L503)

### `_base_types`

[`src/orchestrator/pkg/csharp_extractor.py:528`](../../src/orchestrator/pkg/csharp_extractor.py#L528)

- **Called by** (3): [`_emit_type`](../../src/orchestrator/pkg/csharp_extractor.py#L197), [`_entity_edges`](../../src/orchestrator/pkg/csharp_extractor.py#L404), [`_is_controller`](../../src/orchestrator/pkg/csharp_extractor.py#L366)
- **Calls** (1): [`_text`](../../src/orchestrator/pkg/csharp_extractor.py#L721)

### `_bound_names`

[`src/orchestrator/pkg/csharp_extractor.py:621`](../../src/orchestrator/pkg/csharp_extractor.py#L621)

- **Called by** (1): [`_call_edges`](../../src/orchestrator/pkg/csharp_extractor.py#L465)

### `_call_edges`

[`src/orchestrator/pkg/csharp_extractor.py:465`](../../src/orchestrator/pkg/csharp_extractor.py#L465)

- **Called by** (1): [`_framework_edges`](../../src/orchestrator/pkg/csharp_extractor.py#L296)
- **Calls** (4): [`Edge`](../../src/orchestrator/pkg/facts.py#L137), [`Provenance`](../../src/orchestrator/pkg/facts.py#L81), [`_bound_names`](../../src/orchestrator/pkg/csharp_extractor.py#L621), [`_calls_in`](../../src/orchestrator/pkg/csharp_extractor.py#L602)

### `_calls_in`

[`src/orchestrator/pkg/csharp_extractor.py:602`](../../src/orchestrator/pkg/csharp_extractor.py#L602)

- **Called by** (1): [`_call_edges`](../../src/orchestrator/pkg/csharp_extractor.py#L465)
- **Calls** (1): [`_unqualified_call_name`](../../src/orchestrator/pkg/csharp_extractor.py#L669)

### `_csharp_parser`

[`src/orchestrator/pkg/csharp_extractor.py:727`](../../src/orchestrator/pkg/csharp_extractor.py#L727)

- **Called by** (2): [`_parser_for`](../../src/orchestrator/pkg/scope.py#L466), [`extract`](../../src/orchestrator/pkg/csharp_extractor.py#L143)
- **Calls** (3): `language`, `tree_sitter.Language`, `tree_sitter.Parser`

### `_endpoint_edges`

[`src/orchestrator/pkg/csharp_extractor.py:331`](../../src/orchestrator/pkg/csharp_extractor.py#L331)

- **Called by** (1): [`_framework_edges`](../../src/orchestrator/pkg/csharp_extractor.py#L296)
- **Calls** (7): [`Edge`](../../src/orchestrator/pkg/facts.py#L137), [`Node`](../../src/orchestrator/pkg/facts.py#L121), [`Provenance`](../../src/orchestrator/pkg/facts.py#L81), [`_attr_string_arg`](../../src/orchestrator/pkg/csharp_extractor.py#L566), [`_attributes`](../../src/orchestrator/pkg/csharp_extractor.py#L552), [`_is_controller`](../../src/orchestrator/pkg/csharp_extractor.py#L366), [`_join_route`](../../src/orchestrator/pkg/csharp_extractor.py#L497)

### `_entity_edges`

[`src/orchestrator/pkg/csharp_extractor.py:404`](../../src/orchestrator/pkg/csharp_extractor.py#L404)

- **Called by** (1): [`_framework_edges`](../../src/orchestrator/pkg/csharp_extractor.py#L296)
- **Calls** (10): [`Edge`](../../src/orchestrator/pkg/facts.py#L137), [`Node`](../../src/orchestrator/pkg/facts.py#L121), [`Provenance`](../../src/orchestrator/pkg/facts.py#L81), [`_attributes`](../../src/orchestrator/pkg/csharp_extractor.py#L552), [`_base_types`](../../src/orchestrator/pkg/csharp_extractor.py#L528), [`_entity_id`](../../src/orchestrator/pkg/csharp_extractor.py#L487), [`_generic_head`](../../src/orchestrator/pkg/csharp_extractor.py#L683), [`_last_segment`](../../src/orchestrator/pkg/csharp_extractor.py#L503), [`_ref_type_names`](../../src/orchestrator/pkg/csharp_extractor.py#L700), [`_type_arg_names`](../../src/orchestrator/pkg/csharp_extractor.py#L691)

### `_entity_id`

[`src/orchestrator/pkg/csharp_extractor.py:487`](../../src/orchestrator/pkg/csharp_extractor.py#L487)

- **Called by** (1): [`_entity_edges`](../../src/orchestrator/pkg/csharp_extractor.py#L404)
- **Calls** (1): [`_join_ns`](../../src/orchestrator/pkg/csharp_extractor.py#L491)

### `_field_names`

[`src/orchestrator/pkg/csharp_extractor.py:540`](../../src/orchestrator/pkg/csharp_extractor.py#L540)

- **Called by** (1): [`_emit_type`](../../src/orchestrator/pkg/csharp_extractor.py#L197)
- **Calls** (1): [`_text`](../../src/orchestrator/pkg/csharp_extractor.py#L721)

### `_field_text`

[`src/orchestrator/pkg/csharp_extractor.py:716`](../../src/orchestrator/pkg/csharp_extractor.py#L716)

- **Called by** (3): [`_attributes`](../../src/orchestrator/pkg/csharp_extractor.py#L552), [`_emit_type`](../../src/orchestrator/pkg/csharp_extractor.py#L197), [`_walk`](../../src/orchestrator/pkg/csharp_extractor.py#L170)
- **Calls** (1): [`_text`](../../src/orchestrator/pkg/csharp_extractor.py#L721)

### `_find_string`

[`src/orchestrator/pkg/csharp_extractor.py:574`](../../src/orchestrator/pkg/csharp_extractor.py#L574)

- **Called by** (3): [`_attr_string_arg`](../../src/orchestrator/pkg/csharp_extractor.py#L566), [`_find_string`](../../src/orchestrator/pkg/csharp_extractor.py#L574), [`_minimal_api_edges`](../../src/orchestrator/pkg/csharp_extractor.py#L380)
- **Calls** (2): [`_find_string`](../../src/orchestrator/pkg/csharp_extractor.py#L574), [`_text`](../../src/orchestrator/pkg/csharp_extractor.py#L721)

### `_framework_edges`

[`src/orchestrator/pkg/csharp_extractor.py:296`](../../src/orchestrator/pkg/csharp_extractor.py#L296)

- **Called by** (1): [`extract`](../../src/orchestrator/pkg/csharp_extractor.py#L143)
- **Calls** (5): [`_call_edges`](../../src/orchestrator/pkg/csharp_extractor.py#L465), [`_endpoint_edges`](../../src/orchestrator/pkg/csharp_extractor.py#L331), [`_entity_edges`](../../src/orchestrator/pkg/csharp_extractor.py#L404), [`_join_ns`](../../src/orchestrator/pkg/csharp_extractor.py#L491), [`_minimal_api_edges`](../../src/orchestrator/pkg/csharp_extractor.py#L380)

### `_generic_head`

[`src/orchestrator/pkg/csharp_extractor.py:683`](../../src/orchestrator/pkg/csharp_extractor.py#L683)

- **Called by** (2): [`_entity_edges`](../../src/orchestrator/pkg/csharp_extractor.py#L404), [`_member_name`](../../src/orchestrator/pkg/csharp_extractor.py#L588)
- **Calls** (1): [`_text`](../../src/orchestrator/pkg/csharp_extractor.py#L721)

### `_is_controller`

[`src/orchestrator/pkg/csharp_extractor.py:366`](../../src/orchestrator/pkg/csharp_extractor.py#L366)

- **Called by** (1): [`_endpoint_edges`](../../src/orchestrator/pkg/csharp_extractor.py#L331)
- **Calls** (3): [`_attributes`](../../src/orchestrator/pkg/csharp_extractor.py#L552), [`_base_types`](../../src/orchestrator/pkg/csharp_extractor.py#L528), [`_last_segment`](../../src/orchestrator/pkg/csharp_extractor.py#L503)

### `_join_ns`

[`src/orchestrator/pkg/csharp_extractor.py:491`](../../src/orchestrator/pkg/csharp_extractor.py#L491)

- **Called by** (6): [`_emit_type`](../../src/orchestrator/pkg/csharp_extractor.py#L197), [`_entity_id`](../../src/orchestrator/pkg/csharp_extractor.py#L487), [`_framework_edges`](../../src/orchestrator/pkg/csharp_extractor.py#L296), [`_resolve_type`](../../src/orchestrator/pkg/csharp_extractor.py#L508), [`_walk`](../../src/orchestrator/pkg/csharp_extractor.py#L170), [`resolve`](../../src/orchestrator/pkg/csharp_extractor.py#L314)

### `_join_route`

[`src/orchestrator/pkg/csharp_extractor.py:497`](../../src/orchestrator/pkg/csharp_extractor.py#L497)

- **Called by** (1): [`_endpoint_edges`](../../src/orchestrator/pkg/csharp_extractor.py#L331)

### `_last_segment`

[`src/orchestrator/pkg/csharp_extractor.py:503`](../../src/orchestrator/pkg/csharp_extractor.py#L503)

- **Called by** (4): [`_attributes`](../../src/orchestrator/pkg/csharp_extractor.py#L552), [`_entity_edges`](../../src/orchestrator/pkg/csharp_extractor.py#L404), [`_is_controller`](../../src/orchestrator/pkg/csharp_extractor.py#L366), [`resolve`](../../src/orchestrator/pkg/csharp_extractor.py#L314)

### `_member_name`

[`src/orchestrator/pkg/csharp_extractor.py:588`](../../src/orchestrator/pkg/csharp_extractor.py#L588)

- **Called by** (1): [`_minimal_api_edges`](../../src/orchestrator/pkg/csharp_extractor.py#L380)
- **Calls** (2): [`_generic_head`](../../src/orchestrator/pkg/csharp_extractor.py#L683), [`_text`](../../src/orchestrator/pkg/csharp_extractor.py#L721)

### `_minimal_api_edges`

[`src/orchestrator/pkg/csharp_extractor.py:380`](../../src/orchestrator/pkg/csharp_extractor.py#L380)

- **Called by** (1): [`_framework_edges`](../../src/orchestrator/pkg/csharp_extractor.py#L296)
- **Calls** (5): [`Edge`](../../src/orchestrator/pkg/facts.py#L137), [`Node`](../../src/orchestrator/pkg/facts.py#L121), [`Provenance`](../../src/orchestrator/pkg/facts.py#L81), [`_find_string`](../../src/orchestrator/pkg/csharp_extractor.py#L574), [`_member_name`](../../src/orchestrator/pkg/csharp_extractor.py#L588)

### `_ref_type_names`

[`src/orchestrator/pkg/csharp_extractor.py:700`](../../src/orchestrator/pkg/csharp_extractor.py#L700)

- **Called by** (2): [`_entity_edges`](../../src/orchestrator/pkg/csharp_extractor.py#L404), [`_ref_type_names`](../../src/orchestrator/pkg/csharp_extractor.py#L700)
- **Calls** (3): [`_ref_type_names`](../../src/orchestrator/pkg/csharp_extractor.py#L700), [`_text`](../../src/orchestrator/pkg/csharp_extractor.py#L721), [`_type_arg_names`](../../src/orchestrator/pkg/csharp_extractor.py#L691)

### `_resolve_type`

[`src/orchestrator/pkg/csharp_extractor.py:508`](../../src/orchestrator/pkg/csharp_extractor.py#L508)

- **Called by** (1): [`_emit_type`](../../src/orchestrator/pkg/csharp_extractor.py#L197)
- **Calls** (1): [`_join_ns`](../../src/orchestrator/pkg/csharp_extractor.py#L491)

### `_text`

[`src/orchestrator/pkg/csharp_extractor.py:721`](../../src/orchestrator/pkg/csharp_extractor.py#L721)

- **Called by** (12): [`_base_types`](../../src/orchestrator/pkg/csharp_extractor.py#L528), [`_emit_type`](../../src/orchestrator/pkg/csharp_extractor.py#L197), [`_field_names`](../../src/orchestrator/pkg/csharp_extractor.py#L540), [`_field_text`](../../src/orchestrator/pkg/csharp_extractor.py#L716), [`_find_string`](../../src/orchestrator/pkg/csharp_extractor.py#L574), [`_generic_head`](../../src/orchestrator/pkg/csharp_extractor.py#L683), [`_member_name`](../../src/orchestrator/pkg/csharp_extractor.py#L588), [`_ref_type_names`](../../src/orchestrator/pkg/csharp_extractor.py#L700), [`_type_arg_names`](../../src/orchestrator/pkg/csharp_extractor.py#L691), [`_unqualified_call_name`](../../src/orchestrator/pkg/csharp_extractor.py#L669), [`_usings`](../../src/orchestrator/pkg/csharp_extractor.py#L158), [`bind`](../../src/orchestrator/pkg/csharp_extractor.py#L633)

### `_type_arg_names`

[`src/orchestrator/pkg/csharp_extractor.py:691`](../../src/orchestrator/pkg/csharp_extractor.py#L691)

- **Called by** (2): [`_entity_edges`](../../src/orchestrator/pkg/csharp_extractor.py#L404), [`_ref_type_names`](../../src/orchestrator/pkg/csharp_extractor.py#L700)
- **Calls** (1): [`_text`](../../src/orchestrator/pkg/csharp_extractor.py#L721)

### `_unqualified_call_name`

[`src/orchestrator/pkg/csharp_extractor.py:669`](../../src/orchestrator/pkg/csharp_extractor.py#L669)

- **Called by** (1): [`_calls_in`](../../src/orchestrator/pkg/csharp_extractor.py#L602)
- **Calls** (1): [`_text`](../../src/orchestrator/pkg/csharp_extractor.py#L721)

## Imports

`__future__.annotations`, `dataclasses.dataclass`, `dataclasses.field`, [`orchestrator.pkg.extractor`](../../src/orchestrator/pkg/extractor.py#L1), [`orchestrator.pkg.facts`](../../src/orchestrator/pkg/facts.py#L1), `pathlib.Path`, `re`, `tree_sitter.Language`, `tree_sitter.Node`, `tree_sitter.Parser`, `tree_sitter_c_sharp`, `typing.Any`, `typing.TYPE_CHECKING`

## Imported by

[`orchestrator.pkg.extractor`](../../src/orchestrator/pkg/extractor.py#L1), [`orchestrator.pkg.scope`](orchestrator.pkg.scope.md), [`tests.pkg.test_csharp_extractor`](../../tests/pkg/test_csharp_extractor.py#L1)
