Skip to content

feat: add mini.files support #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 30, 2025
Merged

Conversation

jdurand
Copy link
Contributor

@jdurand jdurand commented Jul 29, 2025

Summary

  • Extends file manager integration to support mini.files
  • Support both visual selection and single file under cursor

Changes Made

  • Added _get_mini_files_selection() function to integrations.lua
  • Added mini.files filetype detection in get_selected_files_from_tree()

Builds on the netrw support PR and extends claudecode.nvim to work with the mini.files file explorer.

Bonus

Fix openDiff blocking operations failing in test environment due to
incorrect coroutine context detection. In Lua 5.4, coroutine.running()
returns (thread, is_main) where is_main indicates if running in main
thread vs coroutine.

Changes:

  • Update diff.lua: Fix open_diff_blocking coroutine check
  • Update tools/open_diff.lua: Fix handler coroutine validation
  • Update tests: Add proper mocking and expected error messages

@jdurand jdurand force-pushed the feat/mini-files-support branch 12 times, most recently from a1403a6 to 07459d5 Compare July 29, 2025 05:57
@jdurand jdurand marked this pull request as ready for review July 29, 2025 06:13
@ThomasK33
Copy link
Member

Hey @jdurand, thanks for the PR.

Could you please format the code with make format?

Could you also add a test fixture for mini.files in the fixtures folder?

@jdurand jdurand force-pushed the feat/mini-files-support branch from 6dff4c8 to 7d52381 Compare July 29, 2025 13:35
jdurand added 4 commits July 29, 2025 10:04
Fix openDiff blocking operations failing in test environment due to
incorrect coroutine context detection. In Lua 5.4, coroutine.running()
returns (thread, is_main) where is_main indicates if running in main
thread vs coroutine.

Changes:
- Update diff.lua: Fix open_diff_blocking coroutine check
- Update tools/open_diff.lua: Fix handler coroutine validation
- Update tests: Add proper mocking and expected error messages
Add mini.files integration following the same pattern as netrw support.
- Add _get_mini_files_selection() function to integrations.lua
- Support both visual selection and single file under cursor
- Add comprehensive test suite with 12 test cases
- Handle error cases and edge conditions gracefully
This update introduces support for visual mode multi-file selection in
mini.files integration. Users can now select multiple files in visual
mode and send them all to Claude Code at once.
@jdurand jdurand force-pushed the feat/mini-files-support branch from 7d52381 to 6e99e19 Compare July 29, 2025 14:04
@jdurand
Copy link
Contributor Author

jdurand commented Jul 29, 2025

@ThomasK33 I added the fixtures based on the structure you set up, but I wasn’t able to use them on my local env. Let me know if that works for you.

…d variable

Change-Id: I277a88d244cb84f517a4b899293a00408293041f
Signed-off-by: Thomas Kosiewski <[email protected]>
Copy link
Member

@ThomasK33 ThomasK33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from some dead or unfinished code, LGTM.

@proofer
Copy link
Contributor

proofer commented Jul 30, 2025

Heh. I just opened this repo to do a search on "fixtures" and found, along with the dev info I was seeking, this PR. I'm within a day or two of submitting the same PR to accommodate my being a longtime user of mini.files, which I'm now using with claudecode.nvim. I'll take this opportunity to say that I've been amazed by the engineering skills of @ThomasK33 et al. on display in this plugin -- I've learned a lot. And also, just as a user of Claude Code, thanks for the plugin!
Edit for P.S.: Thought maybe I should be explicit: I won't be submitting my mini.files support PR, but if there's anything I can do please let me know!

@ThomasK33 ThomasK33 added this pull request to the merge queue Jul 30, 2025
Merged via the queue into coder:main with commit b8e5e54 Jul 30, 2025
7 checks passed
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.

3 participants