LanguageClient-neovim icon indicating copy to clipboard operation
LanguageClient-neovim copied to clipboard

Infinite recursion on recursed directory structure

Open htfy96 opened this issue 5 years ago • 3 comments

  • Did you upgrade to latest plugin version?: Yes
  • Did you upgrade to/compile latest binary? Run shell command bin/languageclient --version to get its version number. languageclient 0.1.160
  • (Neovim users only) Did you check output of :checkhealth LanguageClient?
   - OK: binary found: /mnt/harmonix_vol2/soporifix_vol3/user/home/vic/.local/share/nvim/plugged/LanguageClient-neovim/bin/languageclient
   - OK: languageclient 0.1.160
   - OK: Floating window is supported and will be used for hover                                                                                                                                                             

Describe the bug

When the directory structure of current working directory containing recursive structure via symlinks, LanguageClient-neovim will get stuck into an infinite loop:

09:57:19 INFO unnamed src/language_server_protocol.rs:2818 Start watching path "last/bin/parent/bin/parent/bin/parent/bin/parent/bin/parent/bin/parent/bin/parent/bin/parent/bin/parent/ActualFile"

Here parent is a symlink to its parent, creating a recursive structure.

htfy96 avatar Nov 23 '20 14:11 htfy96

Could you provide an example tree of the directories you have in your project so that I can try and reproduce this?

EDIT: Never mind, just managed to reproduce.

martskins avatar Nov 25 '20 18:11 martskins

I'm actually not sure what the proper solution to this would be. Not following symlinks would probably cause unexpected behaviour for other users, so I guess we have to follow them. But we'd probably have to try and detect if they are recursive somehow.

martskins avatar Nov 26 '20 00:11 martskins

Hi, sorry for the late response. Glad you can reproduce this on your end.

Regarding the best way to fix this issue, I feel like we can follow vscode's approach by just watching all events from the project root, and filter incoming events based on the glob. In this way we can avoid the recursive structure problem.

htfy96 avatar Nov 27 '20 23:11 htfy96