# Mapping inventory Inventory of every mapping site in the shared type-only transform (`packages/tsrx/src/transform/segments.js`), grouped by the `mapping_data` variant it uses (`packages/tsrx/src/source-map-utils.js`), with the content-mapper span kind each one becomes. Taken on 2026-09-18 for Phase 0 of https://github.com/tsrx-org/tsrx/issues/41. ## Feature bit assignment per variant | Variant | Flags | Span features | | ------------------------------------------ | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `mapping_data` | verification, completion, semantic, navigation, structure | Hover, SignatureHelp, InlayHints, SemanticTokens, Completion, AutoInsert, Definition, TypeDefinition, Implementation, References, DocumentHighlights, Rename, CallHierarchy, CodeActions, LinkedEditing, FoldingRanges, SelectionRanges, DocumentSymbols, CodeLens | | `mapping_data_verify_only` | verification | none (diagnostics always apply) | | `mapping_data_verify_complete` | verification, completion | Completion, AutoInsert | | `mapping_data_completion_only` | completion | Completion, AutoInsert | | `mapping_data_string_span` | as `mapping_data` minus completion; `semantic.shouldHighlight()` is `false` | as `mapping_data` minus Completion, AutoInsert, SemanticTokens | | `{ ...mapping_data, verification: false }` | all but verification | as `mapping_data` | `verification` has no feature bit in the protocol: diagnostics apply to every span. Formatting is never enabled (`format: false` everywhere). ## Sites Length column: whether the generated span length equals the source span length. `equal` sites become `Verbatim` when the text is identical, otherwise `Atom`. `may differ` sites are `Atom`, except obfuscated identifiers which are `Alias` so diagnostic text shows the authored name. | Site (segments.js) | Variant | Length | Notes | | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `Identifier` token | `mapping_data` (or `verification: false` via `disable_verification`, `mapping_data_verify_only` via `verify_only`, `mapping_data_string_span` via `string_literal_source_span`) | may differ | Obfuscated identifiers (`_$_` prefix from `identifier-utils.js`, e.g. `#state`), `source_name`/`source_length` rewrites, capitalized names → `Alias` (obfuscated) or `Atom`; unchanged names → `Verbatim` | | `JSXIdentifier` token | `mapping_data` (or `verification: false`) | may differ | Capitalized dynamic component names → `Atom` | | Extra source-mapping tokens (`add_extra_source_mapping_tokens`) | `mapping_data` | may differ | Synthesized identifiers borrowing an authored span | | `Literal` token (`handle_literal`) | `mapping_data_verify_only` | equal | `Verbatim` | | `TemplateLiteral` quasi tokens (including delimiters) | `mapping_data` | equal | `Verbatim` only when generated text matches the authored token; includes no-substitution templates. Other-printer text mismatches are skipped. | | Whole `TemplateLiteral` | `mapping_data_verify_only` | may differ | Diagnostic fallback, including when another printer changes the text. Omitted only when an exact no-substitution token mapping supplies diagnostics and editor features. | | Preserved comment (`add_preserved_comment_mappings`) | `mapping_data_verify_only` | equal | `Verbatim` | | Declaration/export anchors (`declaration_mapping`, `add_export_mapping`) | `mapping_data_verify_only` | may differ | Statement ranges; `Atom` | | `ImportDeclaration` `import` keyword and last character | `mapping_data_verify_only` | equal | `Verbatim` | | JSX class-name attribute tokens | `mapping_data` + `customData.hover` / `customData.definition` | equal | `Verbatim`, but Hover and Definition bits are left off so the TSRX server owns those features | | `JSXExpressionContainer` node | `mapping_data_verify_only` | may differ | `Atom` | | `JSXText` starting with `@` | `mapping_data_completion_only` | equal | `Verbatim`, Completion + AutoInsert only | | JSXElement `<` token | `mapping_data_verify_only` | equal (1) | `Verbatim` | | JSXElement opening `>` token | `mapping_data_verify_complete` | equal (1) | `Verbatim` | | JSXElement closing tag / self-closing tag | `mapping_data_verify_only` / `mapping_data_verify_complete` | differs (+1 for the emitted `;`) | `Atom` | | `@if` / `@for` / `@switch` / `@try` / `@else` control-flow nodes | `mapping_data_verify_only` | may differ | Keyword and body ranges; `Atom` | | File-start anchor (offset 0, length 1) | `mapping_data` | equal | Enables import insertion; `Verbatim` when the first character matches | | Diagnostic anchors (`add_diagnostic_mappings`) | `mapping_data_verify_only` | may differ | Narrow spans for compile errors that point at source-only tokens or at a `<>` the code prints (#1322); `Atom` | | `cssMappings` (`