mattn / efm-langserver

General purpose Language Server
MIT License
1.35k stars 61 forks source link

Fix infinite loop in matchRootPath #169

Closed xuanduc987 closed 2 years ago

xuanduc987 commented 2 years ago

When file path contains non-existed folder, ioutil.ReadDir returns non-nil err, and the loop become infinite loop because dir, prev did not get updated.

When err != nil, files = [] so we don't need to specially handle this error.

mattn commented 2 years ago

Good catch. Thank you.