Class KotlinSemanticIndexer
-
- All Implemented Interfaces:
public final class KotlinSemanticIndexerLightweight Kotlin semantic analysis — symbols and references.
The CORE symbol/reference extraction is pure text analysis driven by Kotlin language structure (regex on declarations and call sites), so it always works with zero extra dependencies — honoring the "self-development resources are not loaded/downloaded by default" rule.
available additionally probes for kotlin-compiler-embeddable (PSI) on the classpath; when present, callers may opt into AST-backed analysis later. It is never a Maven dependency of browser4-coding, so nothing is downloaded unless the deployment explicitly adds it.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classKotlinSemanticIndexer.KotlinSymbolA Kotlin symbol definition found by the indexer.
public final classKotlinSemanticIndexer.KotlinReferenceA reference to a symbol (call site or usage).
public final classKotlinSemanticIndexer.FileReferenceA cross-file reference hit.
public classKotlinSemanticIndexer.Companion
-
Field Summary
Fields Modifier and Type Field Description public final static KotlinSemanticIndexer.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description KotlinSemanticIndexer()
-
Method Summary
Modifier and Type Method Description final List<KotlinSemanticIndexer.KotlinSymbol>symbols(String content, String fileName)List symbol definitions in Kotlin source (zero-dependency text analysis). final List<KotlinSemanticIndexer.KotlinReference>references(String content, String symbol, String fileName)Find references to symbol in Kotlin source — call sites ( symbol(...)) and property usages (.symbol/ baresymbol).final List<KotlinSemanticIndexer.FileReference>referencesInFiles(Map<String, String> files, String symbol, Boolean excludeDeclaringFiles)Cross-file references: scan files (relative path → Kotlin source) for symbol, returning hits annotated with their file. final List<String>inheritanceChain(Map<String, String> files, String className, Integer maxDepth)Inheritance chain of className across files: class SeoToolExecutor : AbstractToolExecutor(...)→ chain SeoToolExecutor, AbstractToolExecutor, ...-
-
Method Detail
-
symbols
final List<KotlinSemanticIndexer.KotlinSymbol> symbols(String content, String fileName)
List symbol definitions in Kotlin source (zero-dependency text analysis).
-
references
final List<KotlinSemanticIndexer.KotlinReference> references(String content, String symbol, String fileName)
Find references to symbol in Kotlin source — call sites (
symbol(...)) and property usages (.symbol/ baresymbol). Zero-dependency text analysis.
-
referencesInFiles
final List<KotlinSemanticIndexer.FileReference> referencesInFiles(Map<String, String> files, String symbol, Boolean excludeDeclaringFiles)
Cross-file references: scan files (relative path → Kotlin source) for symbol, returning hits annotated with their file. Use before refactoring a symbol to assess the blast radius across the module.
- Parameters:
files- relative path → file contentsymbol- the symbol to findexcludeDeclaringFiles- when true, skip files that declare the symbol (only count external usages)
-
inheritanceChain
final List<String> inheritanceChain(Map<String, String> files, String className, Integer maxDepth)
Inheritance chain of className across files:
class SeoToolExecutor : AbstractToolExecutor(...)→ chain SeoToolExecutor, AbstractToolExecutor, ... walking the primary supertype. Stops when no parent is found. Zero-dependency text analysis; generic/interface noise is ignored.
-
-
-
-