Skip to content

Indexing gap: mobile-app/src/components/meeting #2536

Description

@akm-akm

Version

0.11.0 (darwin/arm64, UI build)

What happened

index_status reports the file below under parse_partial (best-effort coverage), and the same
path is what check_index_coverage points at:

mobile-app/src/components/meeting/report-formats/lecture.tsx   error_ranges: 71-71,74-74

Both flagged lines are JSX that contains an unescaped & (an attribute string "Q&A" on line 71
and "No significant ... Q&A ..." on line 74). Deleting just the & on one of those two lines
clears the flag for that line and leaves the other one flagged — so the ampersand is the trigger,
not the surrounding code.

This is a coverage-signal-only problem as far as I can see: the file's File, Module, Type and
Function nodes and all of its IMPORTS / CALLS / USAGE edges are present in the graph, so I
cannot point at a concrete symbol that went missing. The line ranges are simply reported as not
fully parsed.

Minimal reproduction

A bare directory of .tsx files is enough — no package.json, tsconfig.json or imports needed.
Index it and run index_status --diagnostics full:

// a-flagged.tsx — reported: 2-2
export const A = () => (
  <Section title="Q&A" />
);

// b-clean-escaped.tsx — clean
export const B = () => (
  <Section title="Q&amp;A" />
);

// c-clean-single-line.tsx — clean
export const C = () => <Section title="Q&A" />;

// d-clean-unparenthesised.tsx — clean
export const D = () => <Section title="Q&A">
  <Child />
</Section>;

// e-flagged-jsx-text.tsx — reported: 3-3
export const E = () => (
  <View>
    <Label>Date & Time</Label>
  </View>
);

// f-clean-js-expression.tsx — clean
export const F = () => (
  <View>
    <Label>{'Date & Time'}</Label>
  </View>
);

Observed: the parenthesised, multi-line JSX trees (a, e) report the & line. The single-line
form (c), the unparenthesised form (d) and the JS-string form (f) are all clean. A
multi-line element with two such attributes reports both lines:

// reported: 3-3,4-4
export const G = () => (
  <Section>
    <Child title="Q&A" />
    <Child title="R&D" />
  </Section>
);

Expected

A literal & is valid JSX — in an attribute value and in JSX text — and should parse the same way
it does on a single line, without setting the best-effort coverage signal.

Scope

In the private React Native / Next.js monorepo this came from, 17 of the 29 parse_partial entries
are this one pattern (ampersands in UI copy such as Date & Time, Help & Support,
Account & Security, Q&A), across .tsx and one .html. Everything else in that list is
different: 7 non-JS files (.sql, .css, .mmd, .conf) and 5 test files covered below.

Unrelated second class (happy to split into its own issue)

5 Vitest files are flagged at this construct, which looks independent of the JSX problem:

vi.mock('./x', async (importOriginal) => ({
  ...(await importOriginal<typeof import('./x')>()),
}));

index_status reports error_ranges: 3-3 for that file. Reproducible on its own in a folder with
that one .ts file.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions