Skip to content

refactor(files): simplify file filtering and default to text#1541

Merged
deathbeam merged 1 commit intoCopilotC-Nvim:mainfrom
deathbeam:remove-filetype
Mar 29, 2026
Merged

refactor(files): simplify file filtering and default to text#1541
deathbeam merged 1 commit intoCopilotC-Nvim:mainfrom
deathbeam:remove-filetype

Conversation

@deathbeam
Copy link
Copy Markdown
Collaborator

  • Remove filetype-based filtering from file list, now only filters out
    empty entries.
  • Add simple binary detection in get_file by rejecting files with null
    bytes.
  • filetype() now defaults to 'text' if detection fails, letting content
    validation handle unreadable files.

This improves robustness and performance by avoiding unnecessary
filetype checks and handling binary files more gracefully.

Closes #1533

- Remove filetype-based filtering from file list, now only filters out
  empty entries.
- Add simple binary detection in get_file by rejecting files with null
  bytes.
- filetype() now defaults to 'text' if detection fails, letting content
  validation handle unreadable files.

This improves robustness and performance by avoiding unnecessary
filetype checks and handling binary files more gracefully.

Closes CopilotC-Nvim#1533
@deathbeam deathbeam merged commit d2d2574 into CopilotC-Nvim:main Mar 29, 2026
4 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.

Better handling of unknown file types - late reject

1 participant