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

Aleksandr Platonov via All-commits all-commits at lists.llvm.org
Mon Aug 3 06:46:05 PDT 2020


  Branch: refs/heads/release/11.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 3ae25b7a09ded12ff63acec0efcf8c7d715114fe
      https://github.com/llvm/llvm-project/commit/3ae25b7a09ded12ff63acec0efcf8c7d715114fe
  Author: Aleksandr Platonov <platonov.aleksandr at huawei.com>
  Date:   2020-08-03 (Mon, 03 Aug 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

(cherry picked from commit 05b173466142596b3297ab02e423574cb74b3799)




More information about the All-commits mailing list