[all-commits] [llvm/llvm-project] 512aa8: [clangd] Handle members of anon structs in Selecti...

kadir çetinkaya via All-commits all-commits at lists.llvm.org
Fri Oct 1 03:45:38 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 512aa8485010009f6ec1b8d9deea3effe67e0106
      https://github.com/llvm/llvm-project/commit/512aa8485010009f6ec1b8d9deea3effe67e0106
  Author: Kadir Cetinkaya <kadircet at google.com>
  Date:   2021-10-01 (Fri, 01 Oct 2021)

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

  Log Message:
  -----------
  [clangd] Handle members of anon structs in SelectionTree

References to fields inside anon structs contain an implicit children
for the container, which has the same SourceLocation with the field.
This was resulting in SelectionTree always picking the anon-struct rather than
the field as the selection.

This patch prevents that by claiming the range for the field early.

https://github.com/clangd/clangd/issues/877.

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




More information about the All-commits mailing list