hanchenye-llvm-project/clang-tools-extra
Johan Vikstrom f497da3041 [clangd] Added highlighting for tokens that are macro arguments.
Summary:
Adds semantic highlighting for tokens that are a macro argument.
Example:
```
D_V(SomeVar);
```
The "SomeVar" inside the macro is highlighted as a variable now.

Tokens that are in a macro body expansion are ignored in this patch for three reasons.
* The spelling loc is inside the macro "definition" meaning it would highlight inside the macro definition (could probably easily be fixed by using getExpansionLoc instead of getSpellingLoc?)
* If wanting to highlight the macro definition this could create duplicate tokens. And if the tokens are of different types there would be conflicts (tokens in the same range but with different types). Say a macro defines some name and both a variable declaration and a function use this, there would be two tokens in the macro definition but one with Kind "Variable" and the other with Kind "Function".
* Thirdly, macro body expansions could come from a file that is not the main file (easily fixed, just check that the Loc is in the main file and not even a problem if we wanted to highlight the actual macro "invocation")

Reviewers: hokein, sammccall, ilya-biryukov

Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 369275
2019-08-19 16:27:49 +00:00
..
clang-apply-replacements Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFC 2019-08-05 05:43:48 +00:00
clang-change-namespace [clang-tools-extra] Migrate llvm::make_unique to std::make_unique 2019-08-14 23:52:23 +00:00
clang-doc [clang-doc] Fix casting not working in gcc 5.4.0 2019-08-17 01:45:03 +00:00
clang-include-fixer [clang-tools-extra] Migrate llvm::make_unique to std::make_unique 2019-08-14 23:52:23 +00:00
clang-move [clang-tools-extra] Migrate llvm::make_unique to std::make_unique 2019-08-14 23:52:23 +00:00
clang-query gn build: Add build files for some clang-tools-extra 2019-03-20 16:14:16 +00:00
clang-reorder-fields [clang-tools-extra] Migrate llvm::make_unique to std::make_unique 2019-08-14 23:52:23 +00:00
clang-tidy [clang-tidy] Migrate objc-super-self to use isDerivedFrom 🚛 2019-08-16 02:27:58 +00:00
clang-tidy-vs Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
clangd [clangd] Added highlighting for tokens that are macro arguments. 2019-08-19 16:27:49 +00:00
docs [clangd] Update features table in the docs with links to LSP extension proposals 2019-08-19 05:11:15 +00:00
modularize [clang-tools-extra] Migrate llvm::make_unique to std::make_unique 2019-08-14 23:52:23 +00:00
pp-trace [clang-tools-extra] Migrate llvm::make_unique to std::make_unique 2019-08-14 23:52:23 +00:00
test [clang-doc] Fix records in global namespace 2019-08-16 16:10:32 +00:00
tool-template Rename clangToolingRefactor to clangToolingRefactoring for consistency with its directory 2019-05-25 00:27:19 +00:00
unittests [clang-doc] Redesign of generated HTML files 2019-08-16 18:38:11 +00:00
.arcconfig
.gitignore
CMakeLists.txt [clangd] add CLANG_ENABLE_CLANGD option to build clangd. Require threads. 2019-05-07 07:05:47 +00:00
CODE_OWNERS.TXT Update CODE_OWNERS.txt for clang-doc 2019-06-28 17:32:26 +00:00
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
README.txt

README.txt

//===----------------------------------------------------------------------===//
// Clang Tools repository
//===----------------------------------------------------------------------===//

Welcome to the repository of extra Clang Tools.  This repository holds tools
that are developed as part of the LLVM compiler infrastructure project and the
Clang frontend.  These tools are kept in a separate "extra" repository to
allow lighter weight checkouts of the core Clang codebase.

This repository is only intended to be checked out inside of a full LLVM+Clang
tree, and in the 'tools/extra' subdirectory of the Clang checkout.

All discussion regarding Clang, Clang-based tools, and code in this repository
should be held using the standard Clang mailing lists:
  http://lists.llvm.org/mailman/listinfo/cfe-dev

Code review for this tree should take place on the standard Clang patch and
commit lists:
  http://lists.llvm.org/mailman/listinfo/cfe-commits

If you find a bug in these tools, please file it in the LLVM bug tracker:
  http://llvm.org/bugs/