summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/unittests/TweakTests.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clangd] Make use of SourceOrder to find first initializer in DefineOutlineKadir Cetinkaya2020-06-101-5/+41
| | | | | | | | | | | | | | | | | | | | | Summary: Constructors can have implicit initializers, this was crashing define outline. Make sure we find the first "written" ctor initializer to figure out `:` location. Fixes https://github.com/clangd/clangd/issues/400 Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D80521 (cherry picked from commit eeedbd033612e105755156023bdeec2fba4eca21) Fixes https://github.com/clangd/clangd/issues/418
* [clangd] DefineOutline won't copy virtual specifiers on methodsNathan James2020-03-041-0/+161
| | | | | | | | | | | | | | | | | | Summary: The define out of line refactor tool previously would copy the `virtual`, `override` and `final` specifier into the out of line method definition. This results in malformed code as those specifiers aren't allowed outside the class definition. Reviewers: hokein, kadircet Reviewed By: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang, #clang-tools-extra Differential Revision: https://reviews.llvm.org/D75429 (cherry picked from commit b2666ccca0277371a09e43a0a5a0f78029ba81e5)
* NFC: Fix trivial typos in commentsKazuaki Ishizaki2020-01-041-1/+1
|
* Fix trivial typos in comments; NFCKazuaki Ishizaki2020-01-021-1/+1
|
* Revert "[clangd] Reapply b60896fad926 Fall back to selecting ↵Sam McCall2019-12-161-1/+1
| | | | | | | token-before-cursor if token-after-cursor fails." This reverts commit a0ff8cd631add513423fc2d8afa49e9650d01fe3. Buildbot failures I can't chase further tonight.
* [clangd] Reapply b60896fad926 Fall back to selecting token-before-cursor if ↵Sam McCall2019-12-161-1/+1
| | | | | | token-after-cursor fails. This reverts commit 8f876d5105507f874c0fb86bc779c9853eab3fe2.
* Revert "[clangd] Reapply b60896fad926 Fall back to selecting ↵Sam McCall2019-12-161-1/+1
| | | | | | token-before-cursor if token-after-cursor fails." This reverts commit 2500a8d5d8813a3e31fc9ba8dd45e211439a1e3d.
* [clangd] Reapply b60896fad926 Fall back to selecting token-before-cursor if ↵Sam McCall2019-12-161-1/+1
| | | | | | | token-after-cursor fails. This reverts commit f0604e73a4daa35a10eb17a998657d6c4bd0e971 The issue with movability of Tweak::Selection was addressed in 7dc388bd9596bbf42633f8a8e450224e39740b60
* Revert "[clangd] Fall back to selecting token-before-cursor if ↵Nico Weber2019-12-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | token-after-cursor fails." This reverts commit b60896fad926754f715acc5d771555aaaa577e0f. Breaks building with gcc: /usr/include/c++/7/bits/stl_construct.h:75:7: error: use of deleted function ‘clang::clangd::Tweak::Selection::Selection(const clang::clangd::Tweak::Selection&)’ { ::new(static_cast<void*>(__p)) _T1(std::forward<_Args>(__args)...); } ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /home/buildslave/buildslave/clang-cmake-armv7-selfhost-neon/llvm/clang-tools-extra/clangd/ClangdServer.h:28:0, from /home/buildslave/buildslave/clang-cmake-armv7-selfhost-neon/llvm/clang-tools-extra/clangd/ClangdServer.cpp:9: /home/buildslave/buildslave/clang-cmake-armv7-selfhost-neon/llvm/clang-tools-extra/clangd/refactor/Tweak.h:49:10: note: ‘clang::clangd::Tweak::Selection::Selection(const clang::clangd::Tweak::Selection&)’ is implicitly deleted because the default definition would be ill-formed: struct Selection { ^~~~~~~~~ /home/buildslave/buildslave/clang-cmake-armv7-selfhost-neon/llvm/clang-tools-extra/clangd/refactor/Tweak.h:49:10: error: use of deleted function ‘clang::clangd::SelectionTree::SelectionTree(const clang::clangd::SelectionTree&)’ In file included from /home/buildslave/buildslave/clang-cmake-armv7-selfhost-neon/llvm/clang-tools-extra/clangd/refactor/Tweak.h:25:0, from /home/buildslave/buildslave/clang-cmake-armv7-selfhost-neon/llvm/clang-tools-extra/clangd/ClangdServer.h:28, from /home/buildslave/buildslave/clang-cmake-armv7-selfhost-neon/llvm/clang-tools-extra/clangd/ClangdServer.cpp:9: /home/buildslave/buildslave/clang-cmake-armv7-selfhost-neon/llvm/clang-tools-extra/clangd/Selection.h:96:3: note: declared here SelectionTree(const SelectionTree &) = delete; ^~~~~~~~~~~~~ e.g. here: http://lab.llvm.org:8011/builders/clang-cmake-armv7-selfhost-neon/builds/2714 http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/41866
* [clangd] Fall back to selecting token-before-cursor if token-after-cursor fails.Sam McCall2019-12-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The problem: LSP specifies that Positions are between characters. Therefore when a position (or an empty range) is used to target elements of the source code, there is an ambiguity - should we look left or right of the cursor? Until now, SelectionTree resolved this to the right except in trivial cases (where there's whitespace, semicolon, or eof on the right). This meant that it's unable to e.g. out-line `int foo^()` today. Complicating this, LSP notwithstanding the cursor is *on* a character in many editors (mostly terminal-based). In these cases there's no ambiguity - we must "look right" - but there's also no way to tell in LSP. (Several features currently resolve this by using getBeginningOfIdentifier, which tries to rewind and supports end-of-identifier. But this relies on raw lexing and is limited and buggy). Precedent: well - most other languages aren't so full of densely packed symbols that we might want to target. Bias-towards-identifier works well enough. MS C++ for vscode seems to mostly use bias-toward-identifier too. The problem with this solution is it doesn't provide any way to target some things such as the constructor call in Foo^(bar()); Presented solution: When an ambiguous selection is found, we generate *both* possible selection trees. We try to run the feature on the rightward tree first, and then on the leftward tree if it fails. This is basically do-what-I-mean, the main downside is the need to do this on a feature-by-feature basis (because each feature knows what "fail" means). The most complicated instance of this is Tweaks, where the preferred selection may vary tweak-by-tweak. Wrinkles: While production behavior is pretty consistent, this introduces some inconsistency in testing, depending whether the interface we're testing is inside or outside the "retry" wrapper. In particular, for many features like Hover, the unit tests will show production behavior, while for Tweaks the harness would have to run the loop itself if we want this. Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71345
* [clangd] Fix windows buildsKadir Cetinkaya2019-12-131-7/+15
|
* [clangd] Add "inline" keyword to prevent ODR-violations in DefineInlineKadir Cetinkaya2019-12-131-0/+60
| | | | | | | | | | Reviewers: ilya-biryukov, hokein Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68261
* [clangd] Delete ctor initializers while moving functions out-of-lineKadir Cetinkaya2019-12-091-0/+18
| | | | | | | | | | | | | | | | | | | | Summary: Currently we only delete function body from declaration, in addition to that we should also drop ctor initializers. Unfortunately CXXConstructorDecl doesn't store the location of `:` before initializers, therefore we make use of token buffer to figure out where to start deletion. Fixes https://github.com/clangd/clangd/issues/220 Reviewers: hokein, ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71188
* [clangd] Delete default arguments while moving functions out-of-lineKadir Cetinkaya2019-12-091-0/+6
| | | | | | | | | | | | | | | | | | Summary: Only function declarations should have the default arguments. This patch makes sure we don't propogate those arguments to out-of-line definitions. Fixes https://github.com/clangd/clangd/issues/221 Reviewers: hokein Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D71187
* [clangd] Allow extract-to-function on regions that always return.Sam McCall2019-12-091-2/+40
| | | | | | | | | | | | | | Summary: We only do a trivial check whether the region always returns - it has to end with a return statement. Reviewers: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70569
* [clangd] Add a tweak refactoring to wrap Objective-C string literals in ↵Alex Lorenz2019-12-041-0/+19
| | | | | | | | `NSLocalizedString` macros The commit adds a refactoring to Clangd that mimics the existing refactoring action in Xcode that wraps around an Objective-C string literal in an NSLocalizedString macro. Differential Revision: https://reviews.llvm.org/D69543
* [clangd] Add no delayed templates to outline testsKadir Cetinkaya2019-12-041-0/+3
|
* [clangd] Define out-of-line qualify function nameKadir Cetinkaya2019-12-041-1/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When moving function definitions to a different context, the function name might need a different spelling, for example in the header it might be: ``` namespace a { void foo() {} } ``` And we might want to move it into a context which doesn't have `namespace a` as a parent, then we must re-spell the function name, i.e: ``` void a::foo() {} ``` This patch implements a version of this which ignores using namespace declarations in the source file. Reviewers: hokein Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70656
* [clangd] Define out-of-line qualify return valueKadir Cetinkaya2019-12-041-0/+50
| | | | | | | | | | | | | | | | Summary: Return type might need qualification if insertion context doesn't have the same decls visible as the source context. This patch adds qualification for return value to cover such cases. Reviewers: hokein Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70535
* [clangd] Define out-of-line initial apply logicKadir Cetinkaya2019-12-041-0/+104
| | | | | | | | | | | | | | | | | | Summary: Initial implementation for apply logic, replaces function body with a semicolon in source location and copies the full function definition into target location. Will handle qualification of return type and function name in following patches to keep the changes small. Reviewers: hokein Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69298
* [clangd] Define out-of-line availability checksKadir Cetinkaya2019-12-041-0/+61
| | | | | | | | | | | | | | | | | | Summary: Initial availability checks for performing define out-of-line code action, which is a refactoring that will help users move function/method definitions from headers to implementation files. Proposed implementation only checks whether we have an interesting selection, namely function name or full function definition/body. Reviewers: hokein Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69266
* Reland [clangd] Rethink how SelectionTree deals with macros and #includes.Sam McCall2019-12-031-14/+12
| | | | | | This reverts commit 905b002c139f039a32ab9bf1fad63d745d12423f. Avoid tricky (and invalid) comparator for std::set.
* Revert "[clangd] Rethink how SelectionTree deals with macros and #includes."Sam McCall2019-11-291-12/+14
| | | | | | | | This reverts commit 19daa21f841ad45290c923689ee3d25198651a4c. It causes a bunch of failures on a bot that I've been unable to reproduce so far: http://45.33.8.238/mac/3308/step_7.txt
* [clangd] Rethink how SelectionTree deals with macros and #includes.Sam McCall2019-11-291-14/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The exclusive-claim model is successful at resolving conflicts over tokens between parent/child or siblings. However claims at the spelled-token level do the wrong thing for macro expansions, where siblings can be equally associated with the macro invocation. Moreover, any model that only uses the endpoints in a range can fail when a macro invocation occurs inside the node. To address this, we use the existing TokenBuffer in more depth. Claims are expressed in terms of expanded tokens, so there is no need to worry about macros, includes etc. Once we know which expanded tokens were claimed, they are mapped onto spelled tokens for hit-testing. This mapping is fairly flexible, currently the handling of macros is pretty simple (map macro args onto spellings, other macro expansions onto the macro name token). This mapping is in principle token-by-token for correctness (though there's some batching for performance). The aggregation of the selection enum is now more principled as we need to be able to aggregate several hit-test results together. For simplicity i removed the ability to determine selectedness of TUDecl. (That was originally implemented in 90a5bf92ff97b1, but doesn't seem to be very important or worth the complexity any longer). The expandedTokens(SourceLocation) helper could be added locally, but seems to make sense on TokenBuffer. Fixes https://github.com/clangd/clangd/issues/202 Fixes https://github.com/clangd/clangd/issues/126 Reviewers: hokein Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits, ilya-biryukov Tags: #clang Differential Revision: https://reviews.llvm.org/D70512
* [clangd] Improve symbol qualification in DefineInline code actionKadir Cetinkaya2019-11-251-0/+142
| | | | | | | | | | | | | | | | | | | | | | Summary: Currently define inline action fully qualifies any names in the function body, which is not optimal and definitely natural. This patch tries to improve the situation by dropping any name specifiers shared by function and names spelled in the body. For example if you are moving definition of a function in namespace clang::clangd, and body has any decl's coming from clang or clang::clangd namespace, those qualifications won't be added since they are redundant. It also drops any qualifiers that are visible in target context. Reviewers: ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69033
* [clangd] Fix crash in DefineInline::prepare()Sam McCall2019-11-111-0/+3
|
* [clangd] Add fno-delayed-parsing to new define inline testsKadir Cetinkaya2019-10-311-0/+2
| | | | To unbreak windows buildbots.
* [clangd] Add parameter renaming to define-inline code actionKadir Cetinkaya2019-10-311-5/+69
| | | | | | | | | | | | | | | | | Summary: When moving a function definition to declaration location we also need to handle renaming of the both function and template parameters. This patch achives that by making sure every parameter name and dependent type in destination is renamed to their respective name in the source. Reviewers: ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68937
* [clangd] Add a hidden tweak to dump symbol under the cursor.Haojian Wu2019-10-291-0/+9
| | | | | | | | | | | | | | Summary: This provides a convenient way to see the SymbolID/USR of the symbol, mainly for debugging purpose. Reviewers: ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69517
* [clangd] Do not highlight keywords in semantic highlightingIlya Biryukov2019-10-281-9/+4
| | | | | | | | | | | | | | | | | | Summary: Editors are good at highlightings the keywords themselves. Note that this only affects highlightings of builtin types spelled out as keywords in the source code. Highlightings of typedefs to builtin types are unchanged. Reviewers: hokein Reviewed By: hokein Subscribers: merge_guards_bot, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69431
* [clangd] Reland DefineInline action apply logic with fully qualified namesKadir Cetinkaya2019-10-281-0/+544
| | | | | | | | | | | | Summary: Initial version of DefineInline action that will fully qualify every name inside function body. Reviewers: sammccall, ilya-biryukov, hokein Tags: #clang Differential Revision: https://reviews.llvm.org/D66647
* [clangd] Reland DefineInline action availability checksKadir Cetinkaya2019-10-281-0/+170
| | | | | | | | | | | | | | | | Summary: Introduces DefineInline action and initial version of availability checks. Reviewers: sammccall, ilya-biryukov, hokein Reviewed By: hokein Subscribers: thakis, usaxena95, mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65433
* [clangd] Revert define-inline action changes to un-break windows build-botsKadir Cetinkaya2019-10-251-704/+0
|
* [clangd][NFC] Get rid of raw string literals in macros to make stage1 ↵Kadir Cetinkaya2019-10-251-388/+413
| | | | compiler happy
* [clangd] DefineInline action apply logic with fully qualified namesKadir Cetinkaya2019-10-251-0/+512
| | | | | | | | | | | | Summary: Initial version of DefineInline action that will fully qualify every name inside function body. Reviewers: sammccall, ilya-biryukov, hokein Tags: #clang Differential Revision: https://reviews.llvm.org/D66647
* [clangd] DefineInline action availability checksKadir Cetinkaya2019-10-251-0/+167
| | | | | | | | | | | | Summary: Introduces DefineInline action and initial version of availability checks. Reviewers: sammccall, ilya-biryukov, hokein Tags: #clang Differential Revision: https://reviews.llvm.org/D65433
* [clangd] Add RemoveUsingNamespace tweak.Utkarsh Saxena2019-10-161-17/+234
| | | | | | | | | | | | | | | | | | Summary: Removes the 'using namespace' under the cursor and qualifies all accesses in the current file. E.g.: using namespace std; vector<int> foo(std::map<int, int>); Would become: std::vector<int> foo(std::map<int, int>); Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, mgrang, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68562 llvm-svn: 374982
* Make most clangd unittests pass on WindowsNico Weber2019-10-131-3/+8
| | | | | | | | | | | | | | | | | | | | The Windows triple currently turns on delayed template parsing, which confuses several unit tests that use templates. For now, just explicitly disable delayed template parsing. This isn't ideal, but: - the Windows triple will soon no longer use delayed template parsing by default - there's precedent for this in the clangd unit tests already - let's get the clangd tests pass on Windows first before making behavioral changes Part of PR43592. llvm-svn: 374718
* [clangd] Disable expand auto on decltype(auto)Ilya Biryukov2019-10-081-0/+2
| | | | | | | | | | | | | | | | Summary: Applying it produces incorrect code at the moment. Reviewers: sammccall Reviewed By: sammccall Subscribers: kuhnel, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68630 llvm-svn: 374048
* [Clangd] ExtractFunction: Don't extract body of enclosing function.Shaurya Gupta2019-10-021-0/+7
| | | | | | | | | | | | | | | | | | | Summary: This patch disable extraction of the body of the enclosing function. `void f() [[{}]]` Extracting this CompoundStmt would leave the enclosing function without a body. Reviewers: sammccall, kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68245 llvm-svn: 373472
* [Clangd] Ensure children are always RootStmt in ExtractFunction (Fixes #153)Shaurya Gupta2019-10-021-0/+3
| | | | | | | | | | | | | | | | | | Summary: We weren't always checking if children are RootStmts in ExtractFunction. For `void f([[int a]]);`, the ParmVarDecl appeared as a RootStmt since we didn't perform the check and ended up being casted to a (null) Stmt. Reviewers: sammccall, kadircet Subscribers: kristof.beyls, ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68182 llvm-svn: 373471
* [clangd] SelectionTree should mark a node as fully-selected if the only ↵Sam McCall2019-10-021-4/+2
| | | | | | | | | | | | | | | | | | | claimed tokens were early-claimed. Summary: Previously they would be marked as partially-selected based on the early claim, and never updated as no more tokens were claimed. This affects simple VarDecls like "int x". Reviewers: SureYeaah Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66872 llvm-svn: 373442
* [clangd] Support multifile edits as output of TweaksKadir Cetinkaya2019-09-091-0/+32
| | | | | | | | | | | | | | | | | | | | Summary: First patch for propogating multifile changes from tweak outputs to LSP WorkspaceEdits. Uses SM to convert tooling::Replacements to TextEdits. Errors out if there are any inconsistencies between the draft version and the version generated the edits. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66637 llvm-svn: 371392
* [Clangd] ExtractFunction Added checks for broken control flowShaurya Gupta2019-08-301-4/+16
| | | | | | | | | | | | | | | | Summary: - Added checks for broken control flow - Added unittests Reviewers: sammccall, kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66732 llvm-svn: 370455
* Reland "[clangd] Migrate last tweak tests to TweakTesting.h and remove old ↵Sam McCall2019-08-291-134/+33
| | | | | | | | | helpers. NFC" This reverts commit 3dcf55aa45bad800533b36b70a14ebeb2b84e219, and avoids use of multiline raw strings in macro calls. llvm-svn: 370304
* Revert "[clangd] Migrate last tweak tests to TweakTesting.h and remove old ↵Sam McCall2019-08-281-31/+130
| | | | | | | | | helpers. NFC" This reverts commit 8f85685b5cf57eddea11fa444503ade220c724e4, which breaks on old gcc that have the macro + raw strings bug. llvm-svn: 370262
* [Clangd] Initial version of ExtractFunctionShaurya Gupta2019-08-281-0/+106
| | | | | | | | | | | | | | | | | | | Summary: - Only works for extraction from free functions - Basic analysis of the code being extracted. - Extract to void function - Bail out if extracting a return, continue or break. - Doesn't hoist decls yet Reviewers: kadircet, sammccall Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65526 llvm-svn: 370249
* [clangd] Migrate last tweak tests to TweakTesting.h and remove old helpers. NFCSam McCall2019-08-281-129/+30
| | | | llvm-svn: 370229
* [clangd] Disallow extraction of expression-statements.Sam McCall2019-08-091-6/+9
| | | | | | | | | | | | | | | | | | | | | Summary: I split out the "extract parent instead of this" logic from the "this isn't worth extracting" logic (now in eligibleForExtraction()), because I found it hard to reason about. While here, handle overloaded as well as builtin assignment operators. Also this uncovered a bug in getCallExpr() which I fixed. Reviewers: SureYeaah Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65337 llvm-svn: 368500
* [clangd] Added semantic highlighting support for primitives.Johan Vikstrom2019-08-081-4/+4
| | | | | | | | | | | | | | | | Summary: Adds a new HighlightingKind "Primitive". Adds a special case for TypeLocs that have an underlying TypePtr that is are builtin types, adding them as primitives. The primary reason for this change is because otherwise typedefs that typedef primitives `typedef int A` would not get highlighted (so in the example `A` would not get any highlightings.) Reviewers: hokein, ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65943 llvm-svn: 368291
OpenPOWER on IntegriCloud