Skip to content

Add Kotlin syntax-aware file and symbol anchors - #43

Open
davidmoshal wants to merge 1 commit into
fiberplane:mainfrom
davidmoshal:feat/kotlin-symbol-support
Open

davidmoshal wants to merge 1 commit into
fiberplane:mainfrom
davidmoshal:feat/kotlin-symbol-support

Conversation

@davidmoshal

Copy link
Copy Markdown

Summary

Add syntax-aware file fingerprints and symbol anchors for Kotlin source and script files (.kt and .kts). The change pins fwcd/tree-sitter-kotlin 0.3.8 and follows the existing grammar/query registration pattern.

Symbol queries cover classes, interfaces, objects, named companion objects, functions, properties, enum entries, and type aliases. Kotlin getters and setters can appear as siblings of their property in this grammar; include them in the property's fingerprint and extracted range without consuming the next declaration. Normalize inline versus newline accessor placement for property anchors.

Tests

  • Add generic Kotlin fixtures and unit tests for declaration coverage, formatting, script files, symbol isolation, accessor edits/visibility, and extraction boundaries.
  • Add command-line tests for fresh anchors, formatting-only changes, changed or removed functions, and setter edits.
  • Import src/symbols.zig from the test entrypoint so its tests actually run. Update its previously dormant file-reading test to use @embedFile, compatible with Zig 0.16 and without silently skipping files.
  • zig build test -Doptimize=ReleaseSafe --summary all: 94/94 project tests passed; dependency test suites also passed.
  • zig fmt --check on all changed Zig files: passed.

Limits

As with existing languages, symbol names are unqualified and use the first matching declaration. Constructor parameter properties, destructuring names, and unnamed companion objects are not independent symbol targets; enclosing declaration/file anchors remain available. Grammar limitations can change fingerprints when comment placement changes the parsed tree. These limits are documented in the README.

Include property accessors in symbol fingerprints and extraction. Add Kotlin fixtures, unit coverage and command-line regressions; wire the symbols tests into the test runner.

Agent-Session: codex:01a0dfc2-f38e-7373-9a5d-4ddae6a60ae4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant