summaryrefslogtreecommitdiff
path: root/test/Index/code-completion.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix templated type alias completion when using global completion cacheErik Verbruggen2017-09-081-0/+12
| | | | | | | | | | | | | | | | | | | | | | | When we have enabled cache for global completions we did not have diagnostics for Bar and could not complete Ba as in provided code example. template <typename T> struct Foo { T member; }; template<typename T> using Bar = Foo<T>; int main() { Ba } (This is the fixed version of r 311442, which was reverted in r311445.) Patch by Ivan Donchevskii! Differential Revision: https://reviews.llvm.org/D35355 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312780 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r311442 (Fix templated type alias completion when using global ↵Erik Verbruggen2017-08-221-12/+0
| | | | | | | | | | | | completion cache) Failing Tests (2): Clang :: CXX/dcl.dcl/dcl.spec/dcl.type/p3-0x.cpp Clang :: SemaCXX/alias-template.cpp git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311445 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix templated type alias completion when using global completion cacheErik Verbruggen2017-08-221-0/+12
| | | | | | | | | | | | | | | | | | | | | | | When we have enabled cache for global completions we did not have diagnostics for Bar and could not complete Ba as in provided code example. template <typename T> struct Foo { T member; }; template<typename T> using Bar = Foo<T>; int main() { Ba } Patch by Ivan Donchevskii! Differential Revision: https://reviews.llvm.org/D35355 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311442 91177308-0d34-0410-b5e6-96231b3b80d8
* Add default values for function parameter chunksErik Verbruggen2017-07-191-2/+2
| | | | | | | | | | | | | Append optional chunks with their default values. For example: before - "int i", after - "int i = 10" Patch by Ivan Donchevskii! Differential Revision: https://reviews.llvm.org/D33644 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@308433 91177308-0d34-0410-b5e6-96231b3b80d8
* Improves overload completion result chunks.Francisco Lopes da Silva2015-01-281-3/+3
| | | | | | | | | | | | | | | | | | | | | The code building the code completion string for overloads was providing less detail compared to the one building completion strings for function declarations. There was no information about optionals and no information about what's a parameter and what's a function identifier, everything besides ResultType, CurrentParameter and special characters was classified as Text. This makes code completion strings for overload candidates to follow a pattern very similar, but not identical, to the one in use for function declarations: - return type chunk: ResultType - function identifier chunk: Text - parameter chunks: Placeholder - optional parameter chunks: Optional - current parameter chunk: CurrentParameter git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227309 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial support for C++ parameter completionFrancisco Lopes da Silva2015-01-211-3/+3
| | | | | | | | | | | | | | | | | | | | The improved completion in call context now works with: - Functions. - Member functions. - Constructors. - New expressions. - Function call expressions. - Template variants of the previous. There are still rough edges to be fixed: - Provide support for optional parameters. (fix known) - Provide support for member initializers. (fix known) - Provide support for variadic template functions. (fix unknown) - Others? git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@226670 91177308-0d34-0410-b5e6-96231b3b80d8
* New libclang API to expose container type for code completion, fromDouglas Gregor2011-07-211-0/+3
| | | | | | | Connor Wakamo! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135651 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce a new libclang aPI function,Douglas Gregor2011-07-071-0/+20
| | | | | | | | | | clang_codeCompleteGetContexts(), that provides the client with information about the context in which code completion has occurred and what kinds of entities make sense as completions at that point. Patch by Connor Wakamo! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134615 91177308-0d34-0410-b5e6-96231b3b80d8
* Tweak code-completion result priorities, so that exact and similarDouglas Gregor2010-10-191-4/+4
| | | | | | | | | | type matches have a bigger impact. The impetus for this change was that, when initializing an enumeration value, we want enumerators of that enumeration type to have a higher priority than, e.g., unrelated local variables. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116774 91177308-0d34-0410-b5e6-96231b3b80d8
* Add code completion for C++ constructors wherever we see the class (orDouglas Gregor2010-09-211-1/+1
| | | | | | | class template) and are in a context where we can have a value. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114441 91177308-0d34-0410-b5e6-96231b3b80d8
* Code completion has no reason to prefer values over types, especiallyDouglas Gregor2010-09-201-2/+2
| | | | | | | | | at the statement level or in Objective-C message receivers. Therefore, just give types and declarations the same basic priority, and adjust from there. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114374 91177308-0d34-0410-b5e6-96231b3b80d8
* Swap the priorities of constants and types, so that we prefer types.Douglas Gregor2010-09-161-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114086 91177308-0d34-0410-b5e6-96231b3b80d8
* 'const std::type_info*' instead of 'std::type_info const*'Chris Lattner2010-09-051-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113092 91177308-0d34-0410-b5e6-96231b3b80d8
* Synchronize code-completion cursor kinds with indexing cursorDouglas Gregor2010-09-031-10/+10
| | | | | | | kinds. How shameful that this code was duplicated! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113033 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Move the sorting of code-completion results out of the main path andDouglas Gregor2010-08-261-1/+1
| | | | | | | | into the clients", because the C standard library sucks. Where's my stable sort, huh? git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112121 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the sorting of code-completion results out of the main path andDouglas Gregor2010-08-251-1/+1
| | | | | | | | into the clients, e.g., the printing code-completion consumer and c-index-test. Clients may want to re-sort the results anyway. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112095 91177308-0d34-0410-b5e6-96231b3b80d8
* In code-completion contexts where both types and other values areDouglas Gregor2010-08-241-2/+2
| | | | | | | | | | | present, prefer values to types, since it's more common to compute with values than it is to declare new entities or perform type casts. So, tweak the ranking of types vs. other declarations and constants accordingly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111998 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement support for cached code completions forDouglas Gregor2010-08-161-3/+3
| | | | | | | | | | | | nested-name-specifiers. Also includes fixes to the generation of nested-name-specifier result in the non-cached case; we were producing lame results for namespaces and namespace aliases, which (1) didn't always have nested-name-specifiers when we want them, and (2) did not have the necessary "::" as part of the completion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111203 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach code completion not to ignore data members when performing codeDouglas Gregor2010-06-151-0/+13
| | | | | | | completion for expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106037 91177308-0d34-0410-b5e6-96231b3b80d8
* When pretty-printing tag types, only print the tag if we're in C (andJohn McCall2010-03-101-5/+5
| | | | | | | | | | | | therefore not creating ElaboratedTypes, which are still pretty-printed with the written tag). Most of these testcase changes were done by script, so don't feel too sorry for my fingers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98149 91177308-0d34-0410-b5e6-96231b3b80d8
* De-XFAIL some win32 tests that are now passingDouglas Gregor2010-02-211-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96759 91177308-0d34-0410-b5e6-96231b3b80d8
* XFAIL some of the c-index-test tests on Windows, where they are failing ↵Douglas Gregor2010-02-191-0/+1
| | | | | | inexplicably git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96644 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve the sorting of code-completion results. We now always sort byDouglas Gregor2010-01-131-6/+6
| | | | | | | | | | the "typed" text, first, then take into account nested-name-specifiers, name hiding, etc. This means that the resulting sort is actually alphabetical :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93370 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend code-completion results with the type of each resultDouglas Gregor2009-12-181-13/+15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91702 91177308-0d34-0410-b5e6-96231b3b80d8
* Tweak code-completion results by suppressing class templateDouglas Gregor2009-12-111-4/+3
| | | | | | | | | | | specializations and class template partial specializations (they're never named directly). Also, member access expressions only refer to value declarations (fields, functions, enumerators, etc.) and Objective-C property declarations; filter out everything else. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91133 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure that we look into nested, transparent declaration contextsDouglas Gregor2009-11-091-2/+6
| | | | | | | | when looking for a name within a given DeclContext. Now enumerators will show up in code-completion results. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86591 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify test to deal with type-based ordering variationsDouglas Gregor2009-11-091-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86552 91177308-0d34-0410-b5e6-96231b3b80d8
* Verify that code-completion is at least a little bit robust against ↵Douglas Gregor2009-11-091-1/+1
| | | | | | inclusion of missing headers git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86551 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor cleanup for CIndex-based code-completion:Douglas Gregor2009-11-091-0/+51
- Provide an actual test for code-completion via CIndex. - Actually print optional strings in c-index-test - Export clang_getCompletionChunkCompletionString from CIndex git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86550 91177308-0d34-0410-b5e6-96231b3b80d8