Repository navigation
refactor: replace plenary.nvim with native vim.system/vim.uv (#317) - #330
Merged
Merged
Conversation
rcasia
force-pushed
the
stack/plenary-2-remove-dependency
branch
from
September 5, 2026 13:53
04c8e52 to
2002f83
Compare
rcasia
enabled auto-merge (squash)
September 5, 2026 13:54
Mirrors the existing nio.wrap(vim.system) convention from command/command_executor.lua. The DI seam PR #328 added (BuildToolLauncher(deps).job_runner) made this a drop-in default swap — same contract (new(opts):start(), command/args/cwd/on_stdout/on_stderr/on_exit), no callers changed. Also fixed the latent dap.repl bug PR #328 documented: a failed pcall(require, 'dap.repl') left repl as the pcall's truthy error-message string instead of nil, which would have crashed any repl.clear()/append() call when dap.repl isn't installed.
…based fallback Reuses util/dir_scan.lua's existing vim.uv.fs_scandir-based recursive walk instead of writing new scanning code, filtered to the same build-marker filenames the old plenary.scandir call cared about. Also fixes a real latent bug in dir_scan.lua found while wiring this up: scan() reassigned the module-level iter_dir upvalue instead of using a local, so an injected test stub (e.g. from test_dir_scan_spec.lua) would permanently replace the real implementation for every later call to scan() in the same process -- silently breaking any test that runs afterwards and calls the real scan() (exactly what happened to this PR's own new integration tests until this fix).
…ew defaults Same real-JVM / real-filesystem coverage PR #328 added, now exercising the new vim.system-backed job runner and dir_scan-based fallback instead of the old plenary-based defaults.
Nothing in lua/neotest-java/ requires plenary anymore. It's kept as a dev/test-only dependency (Makefile + scripts/minimal_init.lua) solely to provide luassert (bundled inside it), used by a handful of specs' busted-style assertions -- unrelated to the plugin's own runtime. Updated ARCHITECTURE.md, CONTRIBUTING.md, health.lua, and tests/testrc.vim (used by the e2e harness, which never needed plenary) to reflect this. README.md's lazy.nvim snippets still list nvim-lua/plenary.nvim under nvim-neotest/neotest's own dependencies -- left untouched since that's neotest's own dependency, confirmed by grepping deps/neotest/lua/neotest/lib/* which genuinely requires plenary internally. Closes #317.
…'s eq helper All remaining busted-style matchers (assert.is_true/is_false/is_nil/ is_not_nil/is_truthy/is_function/are.same) replaced with: - plain Lua assert(cond, msg) for truthiness/nil checks - tests.assertions.eq (already the project's standard deep-equality helper, used everywhere else) for are.same call sites Also dropped a stale ---@module "luassert" annotation from test_positions_discoverer_spec.lua, which used no luassert matchers. Removes the last reason the test suite needed luassert (bundled inside plenary.nvim), enabling full plenary removal in the next commits.
With no luassert-style assertions left in the suite, minimal_init.lua no longer needs to clone plenary.nvim, add it to the runtimepath, or clobber the global assert with luassert's extension. Same for the Makefile target. plenary.nvim is now fully absent: not a runtime dependency, not a dev/test dependency, not referenced anywhere in the repo's code.
…rockspec deps - tests/performance/path_benchmark.lua: dropped the plenary.path comparison sections (dead code now that plenary is not on any runtimepath). - tests/e2e/full_workflow_spec.lua: converted its luassert matchers to plain assert() so it at least parses consistently (it is never executed - see #333). - .github/workflows/luarocks.yml: removed plenary.nvim from the generated rockspec's dependency list, since it's no longer a runtime dependency of this plugin. Full sweep confirms: 'grep -rn plenary|luassert' across lua/, tests/, scripts/, .github/, and Makefile returns only a historical comment in detect_project_type.lua referencing the old implementation.
rcasia
force-pushed
the
stack/plenary-2-remove-dependency
branch
from
September 5, 2026 14:01
2002f83 to
1e61835
Compare
rcasia
disabled auto-merge
September 5, 2026 14:03
… dependency
The previous commits removed plenary.nvim from the Makefile install
target and tests/testrc.vim entirely. That broke the e2e job: neotest
itself requires plenary.path/plenary.filetype internally
(deps/neotest/lua/neotest/lib/file/init.lua:2, lib/positions,
lib/subprocess), and the e2e harness builds a user-like runtimepath by
hand (--noplugin -u tests/testrc.vim) instead of via a plugin manager
that would resolve neotest's deps for it.
Symptom: the inner nvim crashes on require('plenary.path') when
neotest.lib.file loads, run.lua keeps polling for results that never
arrive, and the job dies at the 5-minute timeout. Reproduced exactly
with:
nvim --headless --noplugin -u tests/testrc.vim \
-c "lua print(require('neotest.lib.file').is_dir('.'))"
Fix: restore the plenary clone + runtimepath entry, now explicitly
commented as neotest's transitive dependency, not neotest-java's. The
unit/integration harness (scripts/minimal_init.lua) intentionally keeps
NO plenary - the 189/189 suite passes without it, proving neotest-java's
own code no longer depends on plenary.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #317, #331, #332
Stacked on #328— #328 merged tomain(squashed) on 2026-09-05; this branch is rebased ontomainand now contains only the plenary removal commits.neotest-java no longer depends on plenary.nvim. The plugin's own code, its unit/integration harness, and its published rockspec no longer reference it — the 189-test suite passes with plenary entirely absent from the unit harness runtimepath.
One honest caveat (caught by CI after rebasing onto main, commit 8bdf2ab): the e2e harness still clones plenary.nvim and puts it on the runtimepath — because neotest itself requires
plenary.path/plenary.filetypeinternally (neotest/lib/file,lib/positions,lib/subprocess). The e2e harness builds a user-like environment by hand (--noplugin -u tests/testrc.vim) instead of via a plugin manager, so it must provide neotest's transitive deps; real users get it automatically (see README). This is neotest's dependency, not ours — once neotest drops plenary upstream, we can too. README.md entries listing plenary under neotest's own dependencies remain correct and untouched.What changed
Runtime swap (the plenary.nvim usages)
build_tool/launcher.lua: defaultjob_runneris now a smallvim.system-based implementation, matching the samevim.systemusage already established incommand/command_executor.lua. Same contract as the oldplenary.job-based default (new(opts):start(),command/args/cwd/on_stdout/on_stderr/on_exit) — no callers changed.local _, repl = pcall(require, "dap.repl")leftreplas a truthy error-message string whendap.replisn't installed.util/detect_project_type.lua: defaultscandirfallback now reusesutil/dir_scan.lua's existingvim.uv.fs_scandir-based recursive walk instead ofplenary.scandir.dir_scan.luafound while wiring this up:scan()reassigned the module-leveliter_dirupvalue instead of using a local, so any test injecting a stub permanently poisoned every later realscan()call in the same process.luassert removal (plenary's last hold-out use, as a dev/test dep)
assert.is_true/is_false/is_nil/is_not_nil/is_truthy/is_function/are.same) in 7 test files to plain Luaassert(cond, msg)and the project's owntests.assertions.eqhelper (already the standard everywhere else; same deep-equality semantics, same argument order asare.same).scripts/minimal_init.luano longer injects_G.assert = require("luassert").Makefileinstall target and test runtimepath,.github/workflows/luarocks.ymlrockspec deps, andtests/performance/path_benchmark.lua's dead plenary comparison sections.Todo
rm -rf deps && make installverifies plenary is never cloned; full suite passesTest results
bash scripts/testafter fresh install (without plenary on disk at all): 189/189 passing, 0 fails (same count as before)stylua --check .: cleanluacheck lua/neotest-java/... tests/...: 0 warnings, 80 fileslua-language-server --check .: clean, 82 files