Repository navigation
cpp: index C++ via tree-sitter-cpp, keep .h on C - #100
SquisherDerHeld wants to merge 1 commit into
Conversation
|
Hi @SquisherDerHeld! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
@facebook-github-bot recheck |
6d48149 to
0cd443b
Compare
|
This PR is purely AI, all changes look reasonable but I did not look into it too deeply. It just enabled me to index a cpp project |
0cd443b to
56c6b10
Compare
cpp, cc, cxx, hpp and similar extensions use the C++ grammar; .h stays on C. Methods store under one lookup key whether defined in class or out of class (~E and E::~E both store as E::~E), template arguments are dropped from keys (Box<T>::get stores as Box::get), and macro values are re-parsed with the file's own grammar so calls like ns::helper() inside a #define are recorded. C++ is not on by default; index it with --extensions cpp,h. Tests in tests/cpp_indexing.rs.
56c6b10 to
cf08271
Compare
|
I'm still in the middle of adding proper object oriented language support to the semcode database, so we can handle things like building a call chain through a code base that has multiple functions of the same name, but in different classes. I'll take a look at whether your approach on how to add C++ can handle the different corner cases that are needed for full support, or whether we need something else. If we merely need "more", but we do not need to fundamentally change what you did, I'll try to merge this soon. If it turns out we need a different approach for some corner case reason, I'll get to that over time. |
Indexes C++ sources with tree-sitter-cpp. Files with
cpp,cc,cxx,hppand similar extensions use the C++ grammar;.hstays on C.Methods store under one lookup key whether defined in class or out of class (
~EandE::~Eboth store asE::~E), template arguments are dropped from keys (Box<T>::get→Box::get), and macro values are re-parsed with the file's own grammar so calls likens::helper()inside a#defineare recorded.C++ is not on by default; index it with
--extensions cpp,h.Tests:
tests/cpp_indexing.rs.