[clangd] Improvements to header mapping: more precise parsing of cppreference symbol...
authorSam McCall <sam.mccall@gmail.com>
Thu, 2 May 2019 09:34:30 +0000 (09:34 +0000)
committerSam McCall <sam.mccall@gmail.com>
Thu, 2 May 2019 09:34:30 +0000 (09:34 +0000)
commit15b89df9daf950431f213ee864e7989879802103
tree2a2ac9ef36af25a87fcedd2b8b9e0ddc137cbb4a
parent553c139fc35a33691db368fa7d8352da77989e08
[clangd] Improvements to header mapping: more precise parsing of cppreference symbol pages.

Summary:
Previously we were just jumping from the symbol index to the symbol page, and
grabbing all the headers mentioned there. But the page often lists multiple
symbols, and so we got false positives and thus ambiguities (which were dropped).

Now we look at which declarations are for the symbol we want, and prefer headers
listed above that symbol. If there are none, we fall back to the old behavior.

Reviewers: kadircet

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits

Tags: #clang

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

llvm-svn: 359771
clang-tools-extra/clangd/StdSymbolMap.inc
clang-tools-extra/clangd/include-mapping/gen_std.py
clang-tools-extra/clangd/include-mapping/test.py