Commit Graph

8 Commits

Author SHA1 Message Date
Rintaro Ishizaki 26f8efed5f [TestDiscovery] Use file modification time to filter semantic index
Instead of querying the index twice (once for up-to-date files, once for
outdated ones), collect file modification timestamps during the syntactic
scan phase and use them to filter a single semantic index query.
For files that don't support syntactic scans, use the semantic index
results even if outdated.

Also extracts symlink-aware mtime resolution into URL.fileModificationDate
and exposes snapshotHasInMemoryModifications(_:) on DocumentManager.
2026-03-06 15:33:19 -08:00
Rintaro Ishizaki 1c99daabef [TestDiscovery] Prefer syntactic scan results over semantic index
Previously, test discovery used the semantic index as the primary
source and fell back to the syntactic index only for files where the
semantic index was out-of-date. This meant test locations came from the
semantic index, which only records a point position rather than the
full symbol range.

Flip the priority: use syntactic scan results as the primary source
(which have correct location ranges) and supplement with semantic index
results. The semantic results are range-fixed via
'textDocument/documentSymbol' before being returned.

This logic is unified into a single 'combineTests' helper shared by
both 'workspaceTests' and 'documentTests'.

Also fix 'SyntacticSwiftXCTestScanner' to emit extensions as proper
'AnnotatedTestItem' nodes (with 'isExtension: true') rather than a flat
list of methods, so extension test methods are correctly merged into
their class via 'mergingTestsInExtensions'. The class and extension
visitors are unified through a shared 'handleClassOrExtension' helper.
2026-03-04 16:58:21 -08:00
Alex Hoppen b033b8393b Address my own review comments 2025-12-08 15:16:36 -05:00
Adam Ward 158529270c Only scan tests if part of a test target 2025-12-08 15:16:36 -05:00
Adam Ward 9ba107d0c5 Fix some failing tests 2025-12-08 15:16:36 -05:00
Adam Ward 3d7fd2101e Rename to SyntacticIndex to acknowledge any language code be scanned 2025-12-08 15:16:36 -05:00
Adam Ward 22421b7ce3 Rename to SwiftSyntacticIndex 2025-12-08 15:16:36 -05:00
Adam Ward eb47fdf927 Rename SyntacticTestIndex to just SyntacticIndex 2025-12-08 15:16:36 -05:00