Repository navigation
ts-inject.nvim 0.3.0
ts-inject.nvim v0.3.0
This release completes the migration of all host languages to generated runtime queries, introduces GraphQL and Regex injection support across multiple hosts, and significantly refactors the builder architecture for maintainability.
Changelog (v0.2.0 → v0.3.0)
Core architecture
- Migrated all 19 host languages to fully generated runtime queries (up from 5 in v0.2.0).
- New generated builders:
c,cpp,bash,perl,php,c_sharp,kotlin,elixir,java,scala,xml,zig. - Extracted shared engine modules:
_util.lua— dispatch, prefix, and builder utilities_concat.lua— binary, native, and recursive string concatenation_c_family.lua— shared C/C++ injection engine
- Unified builder signatures to
build(rules, _opts)and replaced hand-written dispatch withutil.build_dispatcher()across all 17 generated builders. - Replaced
for depth = 2, MAX_CONCAT_DEPTHloops withconcat.expand()in 9 builders. - Unified arg-index prefix generation via
util.arg_prefix(). - Rewrote
rules.name_pattern_for()as lookup tables instead of 13 repetitiveifbranches. - Added early rule-kind validation in
query_builder.luawith clear errors for unknown kinds. - Split config resolution into
mode_resolverandrule_resolver.
New injection support
- GraphQL across 9 hosts:
- JavaScript / TypeScript:
gql/graphql/gqlRequesttemplate tags - Rust:
*_gql/*Graphqlnaming suffix, content prefix, andgraphql!/gql!macros - Python, Go, Java, Kotlin, C#, PHP, Scala: content-prefix or call-site based
- JavaScript / TypeScript:
- Regex across 6 hosts:
- Java:
Pattern.compile(...)andString.matches(...)arguments - C#:
Regex.Match(...)/Regex.Replace(...)andnew Regex(...)arguments - PHP:
preg_match/preg_replace/preg_splitfirst argument - Scala:
"...".rsuffix andnew Regex(...)arguments - C:
regcomp(...)second argument - C++:
std::regex(...)constructor arguments
- Java:
- C inline assembly:
asm,__asm__,__asm__ volatileviagnu_asm_expression. - Elixir SQL: strings, sigils,
<>concatenation, Ecto calls,# sqlcomment marker. - Perl SQL: strings, heredocs, DBI call sites.
- XML MyBatis: mapper SQL tag injection.
- Bash heredoc expansion: delimiter mappings for SQL, Python, Lua, JavaScript, TypeScript, Ruby, Perl, GraphQL, JSON, Regex.
Diagnostics and UX
:TSInjectDebugand:TSInjectHealthnow open in centered floating windows withq/<Esc>to close.- Enriched
:TSInjectHealthoutput with warnings for unsupported host/rule combinations. - Added generated query syntax validation before runtime installation.
Testing
- Added
tests/comprehensive.lua: 200-assertion headless suite covering all 19 hosts, custom rules, debug, and health commands. - Refactored smoke tests into modular structure:
tests/smoke/init.lua— shared utilitiestests/smoke/lang/*.lua— per-language assertion modulestests/smoke/integration/*.lua— integration tests
- Expanded fixture coverage: DDL, CTE, JOIN, subquery, aggregate, window functions, and GraphQL/Regex assertions.
Fixes
- Corrected
build_dispatcherstatic_preamble ordering (; extendsnow placed before preamble). - Fixed
health.luacrash when generated query errors contained newlines. - Fixed PHP nowdoc SQL injection via
(nowdoc_string)+fragment matching. - Corrected Kotlin annotation injection rules.
Tooling and docs
- Added
scripts/preview-inject.sh(moved fromtmp/) with--list,--line, parser checks, and colorized output. - Reorganized README/help docs: installation front-loaded, verification sections removed, configuration boundaries documented.
- Added
AGENTS.mdwith project conventions and validation rules. - Updated
PLAN.mdto mark 0.2 as completed.