Skip to content

ts-inject.nvim v0.3.1

Latest

Choose a tag to compare

@MysticalDevil MysticalDevil released this 02 May 23:58
· 10 commits to main since this release

This is a maintenance release focused on code-quality improvements, internal deduplication, and a correctness fix for C/C++ variable-declaration injection.

Changelog (v0.3.0 → v0.3.1)

Fixed

  • C/C++ name_pattern injection missed pointer/array declarations.
    • host/_c_family.lua previously captured declarator: (_) which matched pointer_declarator (raw text *summary_sql). The anchored ^...$ Lua pattern therefore failed to match.
    • Fixed by explicitly matching (identifier), (pointer_declarator declarator: (identifier)), and (array_declarator declarator: (identifier)).
  • Removed duplicate unanchored C/cpp name_pattern rules from builtin.lua ([%a_][%w_]*[Ss][Qq][Ll] without ^...$), which could incorrectly match mid-string identifiers.

Changed

  • Extracted shared display helpers (add, add_kv, list_or_none, append_section, open_float) from debug.lua / health.lua into host/_util.lua. Removed ~90 lines of duplication.
  • Unified internal API style:
    • runtime.lua: all path construction now uses vim.fs.joinpath.
    • query_builder.lua: table.insert replaced with t[#t+1].
    • health.lua: vim.fn.filereadable replaced with vim.uv.fs_stat.
  • Removed dead code:
    • rules.lua: deleted private copy_list() helper; clone_rules() now delegates fully to vim.deepcopy.
    • xml.lua: removed private join_tags() and reused util.join_fn_list().
  • Hardened query_store.root_dir(): replaced fragile chained vim.fs.dirname with vim.fn.fnamemodify(..., ":p:h:h:h").
  • Merged generated_languages() into supported_languages() alias (identical sets).
  • Added clarifying comments for config.lua field aliasing, arg_prefix(), and #any-lua-match? vs #lua-match? usage in concatenated-string hosts.

Refactored

  • host/_c_family.lua: extracted value_pair() helper to deduplicate the four identical if backslash_value_str then ... end patterns in render_name_pattern and render_call, cutting ~13 lines of repetition.

Commits

5 commits since v0.3.0