[all-commits] [llvm/llvm-project] 05b173: [clangd] findNearbyIdentifier(): fix the word sear...

Aleksandr Platonov via All-commits all-commits at lists.llvm.org
Thu Jul 30 02:47:51 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 05b173466142596b3297ab02e423574cb74b3799
      https://github.com/llvm/llvm-project/commit/05b173466142596b3297ab02e423574cb74b3799
  Author: Aleksandr Platonov <platonov.aleksandr at huawei.com>
  Date:   2020-07-30 (Thu, 30 Jul 2020)

  Changed paths:
    M clang-tools-extra/clangd/XRefs.cpp
    M clang-tools-extra/clangd/unittests/XRefsTests.cpp

  Log Message:
  -----------
  [clangd] findNearbyIdentifier(): fix the word search in the token stream.

Without this patch the word occurrence search always returns the first token of the file.
Despite of that, `findNeardyIdentifier()` returns the correct result (but inefficently) until there are several matched tokens with the same value `floor(log2(<token line> - <word line>))` (e.g. several matched tokens on the same line).

Reviewed By: kadircet

Differential Revision: https://reviews.llvm.org/D84912




More information about the All-commits mailing list