fix: move plenary import into function#1162
Merged
deathbeam merged 1 commit intoCopilotC-Nvim:mainfrom Jun 16, 2025
Merged
Conversation
Commit cf02033 broke test detection in Neotest. When another plugin calls `require("plenary.filetype")` before Neotest does, it seems that Neotest cannot successfully complete the call to `require("neotest.lib").treesitter.parse_positions` and does not find any tests. This seem like a bug in either plenary or Neotest and this commit is merely a workaround. Related issues: - nvim-neotest/neotest#502 - CopilotC-Nvim#1099
There was a problem hiding this comment.
Pull Request Overview
This PR provides a workaround for a test detection issue in Neotest by moving the plenary filetype import into the function call.
- Removed the global import of plenary.filetype.
- Added a local require in the M.filetype function to work around the bug.
Comments suppressed due to low confidence (1)
lua/CopilotChat/utils.lua:238
- Consider adding an inline comment to explain why the require call was moved inside the function, referencing the Neotest issue. This helps future maintainers understand the context and rationale.
local filetype = require('plenary.filetype')
deathbeam
approved these changes
Jun 16, 2025
Collaborator
|
@all-contributors add @fredrikaverpil for code |
Contributor
|
I've put up a pull request to add @fredrikaverpil! 🎉 |
deathbeam
added a commit
to deathbeam/CopilotChat.nvim
that referenced
this pull request
Jul 10, 2025
* main: chore(doc): auto generate docs Properly null check opts.glob when rigpgrep is not available (CopilotC-Nvim#1183) docs: add adborden as a contributor for code (CopilotC-Nvim#1171) fix: CopilotC-Nvim#1153 use filepath on accept (CopilotC-Nvim#1170) chore(doc): auto generate docs chore(main): release 3.12.1 (CopilotC-Nvim#1164) docs: add fredrikaverpil as a contributor for code (CopilotC-Nvim#1165) chore(doc): auto generate docs fix: move plenary import into function (CopilotC-Nvim#1162) chore(doc): auto generate docs chore(main): release 3.12.0 (CopilotC-Nvim#1131) docs: add azdanov as a contributor for doc, and code (CopilotC-Nvim#1130) chore(doc): auto generate docs docs: update mentions of default model to gpt-4.1 feat: switch to new default model gpt-4.1 chore(doc): auto generate docs chore(main): release 3.11.1 (CopilotC-Nvim#1116) chore(doc): auto generate docs [pre-commit.ci] pre-commit autoupdate
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.
Commit cf02033 broke test detection in Neotest. When another plugin calls
require("plenary.filetype")before Neotest does, it seems that Neotest cannot successfully complete the call torequire("neotest.lib").treesitter.parse_positionsand does not find any tests.This seem like a bug in either plenary or Neotest and this commit is merely a workaround.
Related issues: