Clangd does not find references of designated iniitializers yet and, as a
result, is unable to rename such references. This patch addresses this issue.
Details
- Reviewers
sammccall - Commits
- rG9f6d8de28ab6: [clangd] Support renaming designated initializers
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Unit tests: fail. 61928 tests passed, 1 failed and 783 were skipped.
failed: libc++.std/thread/thread_mutex/thread_mutex_requirements/thread_sharedtimedmutex_requirements/thread_sharedtimedmutex_class/try_lock.pass.cpp
clang-tidy: unknown.
clang-format: pass.
Build artifacts: diff.json, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml
Unit tests: pass. 61929 tests passed, 0 failed and 783 were skipped.
clang-tidy: unknown.
clang-format: pass.
Build artifacts: diff.json, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml
Unit tests: pass. 61929 tests passed, 0 failed and 783 were skipped.
clang-tidy: unknown.
clang-format: pass.
Build artifacts: diff.json, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml
clang-tools-extra/clangd/FindTarget.cpp | ||
---|---|---|
639 | you're breaking after the first one - I think you'd like to report every one instead? (targetDecl only reports the *last* one, because the Designator can't be a DynTypedNode, but we don't care about that here) | |
clang-tools-extra/clangd/unittests/FindTargetTests.cpp | ||
566 | isn't this spelled c++20 yet? |
clang-tools-extra/clangd/unittests/FindTargetTests.cpp | ||
---|---|---|
566 | (No, it's not) |
Add tests for nested designated initializers.
clang-tools-extra/clangd/FindTarget.cpp | ||
---|---|---|
639 | Sorry, I tried to understand this comment but I wasn't able to in the end. Could you please elaborate on this? I'm adding the test cases that I originally thought you meant, but those work correctly so I assume I didn't understand what case you were referring to. |
Unit tests: pass. 62405 tests passed, 0 failed and 839 were skipped.
clang-tidy: pass.
clang-format: pass.
Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml
Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.
clang-tools-extra/clangd/FindTarget.cpp | ||
---|---|---|
639 | Sorry, I'm not sure what I was thinking here - code LG. |
you're breaking after the first one - I think you'd like to report every one instead?
You'd test this with a DIE like { .Foo.Bar = 2 } where Foo has struct type.
(targetDecl only reports the *last* one, because the Designator can't be a DynTypedNode, but we don't care about that here)