Skip to content

Adding support for .slns, among other enhancements#2

Open
haondt wants to merge 9 commits intod7omdev:mainfrom
haondt:main
Open

Adding support for .slns, among other enhancements#2
haondt wants to merge 9 commits intod7omdev:mainfrom
haondt:main

Conversation

@haondt
Copy link

@haondt haondt commented Mar 20, 2026

This is a pretty big change, feel free to close the PR if you're not interested. I have no intention of breaking up this change (I can make additional changes/fixes if needed), but felt I should at least offer to contribute back. It started with a smaller change and kind of spiralled.

Changes:

  • moved the search to an async picker (based off of this gist), to live-search for packages
  • uses the dotnet cli for all operations. This has the benefit of respecting the users NuGet.Config when searching packages
  • enhanced the package picker to show if packages are outdated or contain mixed versions in different csprojs
  • enhanced the version picker to show the currently used version(s) and the latest version
  • added some tooling to customize the search, namely including prerelease packages and specifying nuget sources
  • added support for multiple .csproj and .sln files.
  • added support for fidget.nvim to show progress updates

I believe it also addresses some, but not all of the concerns in #1. It can update and consolidate multiple csprojs under the same solution, but some more work would need to be done to install a package on discrete projects.

@d7omdev
Copy link
Owner

d7omdev commented Mar 21, 2026

Hey @haondt, this is really cool, thanks for putting this together. The async live-search alone is a huge UX improvement over the old input prompt approach, Glad you decided to share it.

I went through everything carefully and found a few bugs worth fixing before I merge:


Bug 1 — version aggregation picks the lowest, not the highest (dotnet.lua lines 96, 173, 211, 261)

After table.sort(versions, utils.version_lt) the list is ascending, so versions[1] is the lowest version. The annotation says it should be the highest — fix is just
changing it to versions[#versions].


Bug 2 — crash in the remove failure path (pickers/csproj.lua:69)

notify.show_error_float("Failed: " .. package .. " " .. sel.value, ...)

package isn't in scope here, it resolves to Lua's own built-in package table and blows up with a concatenation error. Should be sel.value.id.


Bug 3 — other_cnt is off (pickers/nuget.lua:246)

local other_cnt = #projs -- already the full count
...
other_cnt = other_cnt + 1 -- then keeps adding

Say a package is in 3 projects and you're targeting 1 of them — the badge ends up showing (5) instead of (2). Starting other_cnt at 0 fixes it.


Bug 4 — build_project_map always calls bare dotnet (dotnet.lua:516)

vim.fn.systemlist("dotnet sln " .. vim.fn.shellescape(...) .. " list")

Whatever the user set for dotnet_bin gets ignored here. Also worth noting that this function has a hard dependency on fd with no fallback — if it's not installed the
picker just silently shows nothing.


Bug 5 — is_sln never actually set (pickers/projects.lua:54)

The display function checks et.is_sln to pick the highlight, but nothing ever sets it on the entry. Adding is_sln = filetype == "sln" to the entry table is all it needs.


Smaller things I noticed:

  • vim.loop is deprecated since Neovim 0.10, vim.uv is the way to go now (async_finder.lua:14)
  • Remove only works on individual .csproj files right now — remove.lua hardcodes opts.filter = "csproj" so there's no solution-wide remove yet
  • dotnet package search needs .NET 8+ — probably worth a line in the README so people on older SDKs aren't confused

Bugs 1–5 are the ones I'd want fixed before merging, the rest can be follow-ups. Let me know if anything's unclear
and sorry for the late reply, was on holiday!

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.

2 participants