[Support] Add support for attaching payloads to points and ranges
authorTom Praschan <13141438+tom-anders@users.noreply.github.com>
Wed, 16 Nov 2022 23:20:37 +0000 (00:20 +0100)
committerTom Praschan <13141438+tom-anders@users.noreply.github.com>
Fri, 18 Nov 2022 14:00:23 +0000 (15:00 +0100)
commit3cf14a7bdce08f8fe03d987a2d99c6ea47c58c03
treedb3c142812953ac172c802fcbc879a8567fc94d9
parent0cf888514454350cd97ab79cdb4a73e7f189eea0
[Support] Add support for attaching payloads to points and ranges

This is useful where tests previously encoded information in the name
names of ranges and points. Currently, this is pretty limited because
names consist of only alphanumeric characters and '_'.

With this patch, we can keep the names simple and attach optional
payloads to ranges and points instead.

The new syntax should be fully backwards compatible (if I haven't missed
anything). I tested this against clangd unit tests and everything still passes.

Differential Revision: https://reviews.llvm.org/D137909
clang-tools-extra/clangd/unittests/Annotations.cpp
clang-tools-extra/clangd/unittests/Annotations.h
llvm/include/llvm/Testing/Support/Annotations.h
llvm/lib/Testing/Support/Annotations.cpp
llvm/unittests/Support/AnnotationsTest.cpp