summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaCodeComplete.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Determinism is for wimps. <Wimper>Douglas Gregor2009-09-281-1/+11
| | | | llvm-svn: 82962
* For code completion, note that injected-class-names found as part ofDouglas Gregor2009-09-231-8/+25
| | | | | | | | lookup in a member access expression always start a nested-name-specifier. Additionally, rank names that start nested-name-specifiers after other names. llvm-svn: 82663
* Print the results of code-completion for overloading by displaying theDouglas Gregor2009-09-231-0/+62
| | | | | | | signature of the function with the current parameter highlighted as a placeholder. llvm-svn: 82593
* Separate the code-completion results for call completion from theDouglas Gregor2009-09-231-7/+5
| | | | | | | | results for other, textual completion. For call completion, we now produce enough information to show the function call argument that we are currently on. llvm-svn: 82592
* Make sure we don't try to add code-completion results without anDouglas Gregor2009-09-221-0/+10
| | | | | | active shadow map. llvm-svn: 82588
* When code-completion finds a declaration only because it is usable asDouglas Gregor2009-09-221-1/+8
| | | | | | | the start of a nested-name-specifier, add the "::" after the nested-name-specifier to the code-completion string. llvm-svn: 82587
* Tweak the code-completion results ranking and formation, so thatDouglas Gregor2009-09-221-23/+40
| | | | | | | | | | | members found in base classes have the same ranking as members found in derived classes. However, we will introduce an informative note for members found in base classes, showing (as a nested-name-specifier) the qualification to name the base class, to make it clear which members are from bases. llvm-svn: 82586
* Teach code-completion to introduce a ", ..." placeholder for variadic functionsDouglas Gregor2009-09-221-0/+5
| | | | llvm-svn: 82577
* (With Doug's help) fix a crash in the code completion code that lead to a ↵Anders Carlsson2009-09-221-0/+3
| | | | | | test failure. llvm-svn: 82558
* Implement code completion within a function call, triggered after theDouglas Gregor2009-09-221-0/+72
| | | | | | | | | | | | | | | | | | | | | opening parentheses and after each comma. We gather the set of visible overloaded functions, perform "partial" overloading based on the set of arguments that we have thus far, and return the still-viable results sorted by the likelihood that they will be the best candidate. Most of the changes in this patch are a refactoring of the overloading routines for a function call, since we needed to separate out the notion of building an overload set (common to code-completion and normal semantic analysis) and then what to do with that overload set. As part of this change, I've pushed explicit template arguments into a few more subroutines. There is still much more work to do in this area. Function templates won't be handled well (unless we happen to deduce all of the template arguments before we hit the completion point), nor will overloaded function-call operators or calls to member functions. llvm-svn: 82549
* Code completion for ordinary names when we're starting a declaration, ↵Douglas Gregor2009-09-211-0/+18
| | | | | | expression, or statement llvm-svn: 82481
* When providing a code-completion suggestion for a hidden name, includeDouglas Gregor2009-09-211-73/+94
| | | | | | | | | | | | | | a nested-name-specifier that describes how to refer to that name. For example, given: struct Base { int member; }; struct Derived : Base { int member; }; the code-completion result for a member access into "Derived" will provide both "member" to refer to Derived::member (no qualification needed) and "Base::member" to refer to Base::member (qualification included). llvm-svn: 82476
* Enhance "case" code completion in C++ to suggest qualified names forDouglas Gregor2009-09-211-12/+91
| | | | | | | | | enumerators when either the user intentionally wrote a qualified name (in which case we just use that nested-name-specifier to match the user's code) or when this is the first "case" statement and we need a qualified name to refer to an enumerator in a different scope. llvm-svn: 82474
* Code completion for "case" statements within a switch on an expressionDouglas Gregor2009-09-211-0/+73
| | | | | | of enumeration type, providing the various unused enumerators as options. llvm-svn: 82467
* Refactor and simplify the CodeCompleteConsumer, so that all of theDouglas Gregor2009-09-211-18/+911
| | | | | | | real work is performed within Sema. Addresses Chris's comments, but still retains the heavyweight list-of-multimaps data structure. llvm-svn: 82459
* C++ code completion after the "operator" keyword. Provide overloadedDouglas Gregor2009-09-181-0/+6
| | | | | | operators, type specifiers, type names, and nested-name-specifiers. llvm-svn: 82264
* Introduce four new code-completion hooks for C++:Douglas Gregor2009-09-181-0/+30
| | | | | | | | | | - after "using", show anything that can be a nested-name-specifier. - after "using namespace", show any visible namespaces or namespace aliases - after "namespace", show any namespace definitions in the current scope - after "namespace identifier = ", show any visible namespaces or namespace aliases llvm-svn: 82251
* Implement code completion for tags, e.g., code completion after "enum"Douglas Gregor2009-09-181-0/+29
| | | | | | | | | | | | | will provide the names of various enumerations currently visible. Introduced filtering of code-completion results when we build the result set, so that we can identify just the kinds of declarations we want. This implementation is incomplete for C++, since we don't consider that the token after the tag keyword could start a nested-name-specifier. llvm-svn: 82222
* Initial implementation of a code-completion interface in Clang. InDouglas Gregor2009-09-171-0/+45
essence, code completion is triggered by a magic "code completion" token produced by the lexer [*], which the parser recognizes at certain points in the grammar. The parser then calls into the Action object with the appropriate CodeCompletionXXX action. Sema implements the CodeCompletionXXX callbacks by performing minimal translation, then forwarding them to a CodeCompletionConsumer subclass, which uses the results of semantic analysis to provide code-completion results. At present, only a single, "printing" code completion consumer is available, for regression testing and debugging. However, the design is meant to permit other code-completion consumers. This initial commit contains two code-completion actions: one for member access, e.g., "x." or "p->", and one for nested-name-specifiers, e.g., "std::". More code-completion actions will follow, along with improved gathering of code-completion results for the various contexts. [*] In the current -code-completion-dump testing/debugging mode, the file is truncated at the completion point and EOF is translated into "code completion". llvm-svn: 82166
OpenPOWER on IntegriCloud