copilot.el icon indicating copy to clipboard operation
copilot.el copied to clipboard

`global-copilot-mode` Opens too many files

Open djhunter67 opened this issue 1 year ago • 1 comments

Too many files open

  • I have recompiled emacs with the relevant compile flags and increased my Arch Linux max number of open files
  • Spent many hours investigating after spending months activating copilot using copilot-diagnose instead of global-copilot-mode

Problem

  • Read the elisp source code and learned that global-copilot-mode enables copilot in all open buffers.

Suspicion

  • global-copilot-mode actually enables copilot for every file ever previously opened.

Rust

  • Over the past 12 months or so I have started every project in Rust and everytime global-copilot-mode is executed emacs runs into the Too many open files error.
  • Using global-copilot-mode appears to enable copilot in every single file I have ever used with my LSP simultaneously. Hence, not encountering this issue when I first started working and using copilot at work. I do not know how to rationalize copilot being immediately available in files that I open for the first time in a instance of work but have opened previously in the life of the project. Even other projects I open, while developing on a particular project, have copilot immediately available for them with any indication copilot was enabled for them.

Proposed solution

  • projectile-copilot-mode
  • Only enable copilot in project-specific buffers.

P.S.

If I have completely missed the mark please take away the following:

  • On two different Arch development machines (work and home) emacs soft locks with 'Too many open files' error after enabling global-copilot-mode.

djhunter67 avatar Sep 02 '24 16:09 djhunter67