mirror of
https://github.com/github/codeql.git
synced 2026-06-30 00:55:29 +02:00
Why this is needed: - With Kotlin 2.0 analysis, some local-variable locations resolve to a wider declaration span than before. - The previous extractor logic used provider-based ranges that can cover type, annotations, and modifiers, which shifts expected variable location facts. - This caused parity drift in tests that expect the location to point at the variable name token itself. What this changes: - Cache current source text per file during extraction. - Derive variable-name offsets by scanning the declaration slice and locating the declared identifier token. - Emit local-variable declaration/expr locations from that identifier span, with fallback to the previous provider when source offsets are unavailable. This restores stable name-anchored variable locations under Kotlin 2.0. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>