VidocqH / lsp-lens.nvim

Neovim plugin for displaying references and difinition infos upon functions like JB's IDEA.
MIT License
252 stars 15 forks source link

bugs. Too many open files #41

Open cxwx opened 1 month ago

cxwx commented 1 month ago

when using nvim-lspconfig clangd, lsp-lens together go to definition jump to another file after lspconfig jump to the right one. then press to go back, cause.

Error detected while processing BufEnter Autocommands for "*"..BufReadPost Autocommands for
 "*":
Error executing lua callback: ...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:2
4: Error executing lua: ...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:25: Buf
Enter Autocommands for "*"..BufReadPost Autocommands for "*"..FileType Autocommands for "*"
..function <SNR>1_LoadFTPlugin[19]..script /Users/chenxu/cx_rc/config/nvim/after/ftplugin/c
pp.lua: Vim(runtime):E5112: Error while creating lua chunk: cannot open 
~/.config/nvim/after/ftplugin/cpp.lua: Too many open files
stack traceback:
        [C]: in function 'nvim_cmd'
        ...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:25: in function <...bre
w/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:24>
        [C]: in function 'nvim_buf_call'
        ...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:24: in function <...bre
w/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:10>
stack traceback:
        [C]: in function 'nvim_buf_call'
        ...brew/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:24: in function <...bre
w/Cellar/neovim/0.9.5/share/nvim/runtime/filetype.lua:10>

remove lsp-lens, lspconfig works fine

Is anyone has the same issues?

mortymacs commented 1 month ago

What's your current limits? I'm uncertain if it pertains specifically to this plugin. I encountered similar issues with other plugins, such as git-integrated, but resolved them by increasing my limits in my NixOS config: https://github.com/mortymacs/dotfiles/blob/main/nixos/common/misc.nix#L12

kyu08 commented 1 month ago

I'v got a error like Process failed to start: too many open files: "/opt/homebrew/bin/git" too in few days ago. In my macOS environment, following instruction fixed that error.

  1. sudo vi /Library/LaunchDaemons/limit.maxfiles.plist.

  2. Write following code to the files.

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
      <dict>
        <key>Label</key>
        <string>limit.maxfiles</string>
        <key>ProgramArguments</key>
        <array>
          <string>launchctl</string>
          <string>limit</string>
          <string>maxfiles</string>
          <string>524288</string>
          <string>524288</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
        <key>ServiceIPC</key>
        <false/>
      </dict>
    </plist>
  3. Reboot your mac.