[clangd] Fix division by zero when computing scores
NameMatch could be a float close to zero, in such cases we were dividing by zero and moreover propogating a "NaN" to clients, which is invalid per JSON. This fixes the issue by only using Quality scores whenever the NameMatch is low, as we do in CodeCompletion ranking. Fixes https://github.com/clangd/clangd/issues/648. Differential Revision: https://reviews.llvm.org/D94755
Loading
Please sign in to comment