[clang-tools-extra] [clangd] Store full decl/def range with symbol locations (PR #118102)

kadir çetinkaya via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 17 04:20:58 PST 2025


kadircet wrote:

> My main motivation is to get DefineOutline

I think if we're solely aiming for improvements to DefineOutline, I'd say the resource trade-off here isn't worth it.

> I don't see how bracket matching can help us get from the name of the function to the actual start of the declaration.

so let's say we've got the location for `foo::bar` from the index, as the declaration to insert after:
```cpp
...
void foo::^bar() {}
...
```

WDYT about an approach that just looks for first trailing `{}` (at the same level of indentation, i.e. ignoring anything in the function prototype) ? this might surely have false positives in cases with returning auto-types/concepts etc. but I think it's still a big enough increment without incurring any costs.

https://github.com/llvm/llvm-project/pull/118102


More information about the cfe-commits mailing list