summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaCodeComplete.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Code completion has no reason to prefer values over types, especiallyDouglas Gregor2010-09-201-1/+1
| | | | | | | | at the statement level or in Objective-C message receivers. Therefore, just give types and declarations the same basic priority, and adjust from there. llvm-svn: 114374
* Slight refactoring in code-completion results generation, placing theDouglas Gregor2010-09-201-38/+50
| | | | | | | various priority adjustments for preferences (based on selectors, types) in a single function to make extension easier. llvm-svn: 114370
* Get rid of the lame attempt to prioritize "void" functions atDouglas Gregor2010-09-201-12/+3
| | | | | | | statement context; it really isn't helpful in practice (remember printf!) and we'll be doing other adjustments for statements very soon. llvm-svn: 114358
* Tweak priorities for some types and macros:Douglas Gregor2010-09-201-4/+16
| | | | | | | | | | - In Objective-C, we prefer BOOL to bool for historic reasons; slightly penalize "bool". - Treat Nil macro as a NULL pointer constant. - Treat YES, NO, true, and false macros as constants. - Treat the bool macro as a type. llvm-svn: 114356
* Continue parsing more postfix expressions, even after semanticDouglas Gregor2010-09-181-3/+5
| | | | | | errors. Improves code completion in yet another case. llvm-svn: 114255
* Don't add two code-completion results for the same selector; itDouglas Gregor2010-09-161-16/+42
| | | | | | | doesn't add any value. Instead, we'll just take the first method with that selector that we find and create a completion for it. llvm-svn: 114082
* When collecting Objective-C methods for message send completions, beDouglas Gregor2010-09-161-0/+11
| | | | | | sure to visit the protocols of protocols. llvm-svn: 114079
* Implement code completion for Objective-C class message sends that areDouglas Gregor2010-09-161-32/+71
| | | | | | | | | | | | | | | | | | | | | | | | | missing the opening bracket '[', e.g., NSArray <CC> at function scope. Previously, we would only give trivial completions (const, volatile, etc.), because we're in a "declaration name" scope. Now, we also provide completions for class methods of NSArray, e.g., alloc Note that we already had support for this after the first argument, e.g., NSArray method:x <CC> would get code completion for class methods of NSArray whose selector starts with "method:". This was already present because we recover as if NSArray method:x were a class message send missing the opening bracket (which was committed in r114057). llvm-svn: 114078
* Improve code completion for Objective-C message sends when the openingDouglas Gregor2010-09-151-15/+8
| | | | | | | | | | | | | | | | | | | | | | | '[' is missing. Prior commits improving recovery also improved code completion beyond the first selector, e.g., at or after the "to" in calculator add:x to:y but not after "calculator". We now provide the same completions for calculator <CC> that we would for [calculator <CC> if "calculator" is an expression whose type is something that can receive Objective-C messages. This code completion works for instance and super message sends, but not class message sends. llvm-svn: 113976
* Introduce a new code-completion context for a parenthesizedDouglas Gregor2010-09-141-6/+13
| | | | | | | | expression, e.g., after the '(' that could also be a type cast. Here, we provide types as code-completion results in C/Objective-C (C++ already had them), although we wouldn't in a normal expression context. llvm-svn: 113904
* Teach libclang to walk the base and member initializers of aDouglas Gregor2010-09-091-1/+2
| | | | | | | | constructor, in source order. Also introduces a new reference kind for class members, which is used here (for member initializers) and will also be used for designated initializers and offsetof. llvm-svn: 113545
* When providing a completion for a function/method parameter of blockDouglas Gregor2010-09-081-16/+21
| | | | | | pointer type, actually provide a usable block literal expression. llvm-svn: 113431
* zap dead code.Chris Lattner2010-09-041-6/+2
| | | | llvm-svn: 113074
* Synchronize code-completion cursor kinds with indexing cursorDouglas Gregor2010-09-031-0/+63
| | | | | | kinds. How shameful that this code was duplicated! llvm-svn: 113033
* Split ObjCInterfaceDecl::ReferencedProtocols into two lists: ↵Ted Kremenek2010-09-011-5/+5
| | | | | | | | | | | | | ReferencedProtocols and AllReferencedProtocols. ReferencedProtocols (and thus protocol_begin(), protocol_end()) now only contains the list of protocols that were directly referenced in an @interface declaration. 'all_referenced_protocol_[begin,end]()' now returns the set of protocols that were referenced in both the @interface and class extensions. The latter is needed for semantic analysis/codegen, while the former is needed to maintain the lexical information of the original source. Fixes <rdar://problem/8380046>. llvm-svn: 112691
* When provide code completions for a variadic Objective-C methodDouglas Gregor2010-08-311-15/+24
| | | | | | | | declaration send or a variadic function call, collapse the ", ..." into the parameter before it, so that we don't get a second placeholder. llvm-svn: 112579
* Rename DeclContext::getLookupContext to getRedeclContext and change its ↵Sebastian Redl2010-08-311-3/+3
| | | | | | semantics slightly. No functionality change in the absence of inline namespaces. Also, change a few places where inline namespaces actually make a difference to be prepared for them. llvm-svn: 112563
* When providing a code completion for an Objective-C message send, dropDouglas Gregor2010-08-291-5/+7
| | | | | | | | | | | | | | | | the parameter names from the completions, e.g., provide withString:(NSString *) instead of withString:(NSString *)string since the parameter name is, by convention, redundant with the selector piece that precedes it and the completions can get unnecessarily long. llvm-svn: 112456
* Improve code completion for initializer lists in constructors. InsteadDouglas Gregor2010-08-291-7/+33
| | | | | | | | | | of prioritizing just by initialization order, we bump the priority of just the *next* initializer in the list, and leave everything else at the normal priority. That way, if one intentionally skips the initialization of a base or member (to get default initialization), we'll still get ordered completion for the rest. llvm-svn: 112454
* Basic code completion support for the base and member initializers inDouglas Gregor2010-08-281-0/+80
| | | | | | a constructor. llvm-svn: 112330
* Implement the "call super" code completion for C++. If the virtualDouglas Gregor2010-08-271-5/+92
| | | | | | | | member function you're typing in overrides another virtual function, this fills in a (qualified!) call to that virtual function to make such delegation easy. llvm-svn: 112294
* Suggest "const" and "volatile" code completions after a functionDouglas Gregor2010-08-271-0/+16
| | | | | | declarator, the very definition of "low-hanging fruit". llvm-svn: 112274
* When code-completing inside an Objective-C method, give a slightDouglas Gregor2010-08-271-2/+38
| | | | | | priority boost to methods with the same selector. llvm-svn: 112268
* Add a super-cool code completion for send-to-super. When we're typingDouglas Gregor2010-08-271-4/+144
| | | | | | | | | a message send to "super" from a method that appears to be meant to override a superclass method (same kind, same selector, same argument types), provide a "super" completion that fills in the selector along with forwarding the method's arguments (as placeholders). llvm-svn: 112263
* One who seeks knowledge learns something new every day.John McCall2010-08-261-62/+62
| | | | | | | | | One who seeks the Tao unlearns something new every day. Less and less remains until you arrive at non-action. When you arrive at non-action, nothing will be left undone. llvm-svn: 112244
* Tweak the @selector completion to collapse multiple informative andDouglas Gregor2010-08-261-8/+11
| | | | | | typed-text blocks into one of each. llvm-svn: 112194
* When code-completing a potential call to a C++ non-static memberDouglas Gregor2010-08-261-2/+47
| | | | | | | | | function, take into account the qualifiers on the object argument (e.g., what will become "this"), filtering around uncallable member functions and giving a slight priority boost to those with exactly-matching qualifiers. llvm-svn: 112193
* Implement code completion for @selector expressionsDouglas Gregor2010-08-261-11/+70
| | | | llvm-svn: 112186
* Move the sorting of code-completion results out of the main path andDouglas Gregor2010-08-261-2/+0
| | | | | | | | | | | into the clients, e.g., the printing code-completion consumer and c-index-test. Clients may want to re-sort the results anyway. Provide a libclang function that sorts the results. 3rd try. How embarrassing. llvm-svn: 112180
* Revert r112149, "Move the sorting of code-completion results out of the mainDaniel Dunbar2010-08-261-0/+2
| | | | | | path and ...", it is failing tests. llvm-svn: 112161
* Move the sorting of code-completion results out of the main path andDouglas Gregor2010-08-261-2/+0
| | | | | | | | | into the clients, e.g., the printing code-completion consumer and c-index-test. Clients may want to re-sort the results anyway. Provide a libclang function that sorts the results. llvm-svn: 112149
* Revert "Move the sorting of code-completion results out of the main path andDouglas Gregor2010-08-261-0/+2
| | | | | | | into the clients", because the C standard library sucks. Where's my stable sort, huh? llvm-svn: 112121
* Move the sorting of code-completion results out of the main path andDouglas Gregor2010-08-251-2/+0
| | | | | | | into the clients, e.g., the printing code-completion consumer and c-index-test. Clients may want to re-sort the results anyway. llvm-svn: 112095
* Split out a header to hold APIs meant for the Sema implementation from Sema.h.John McCall2010-08-251-1/+1
| | | | | | | Clients of Sema don't need to know (for example) the list of diagnostics we support. llvm-svn: 112093
* When combining the code-completion results from Sema long with theDouglas Gregor2010-08-251-64/+2
| | | | | | | | code-completion results cached by ASTUnit, sort the resulting result set. This makes testing far, far easier, so this commit also includes tests for the previous few fixes. llvm-svn: 112070
* Add a code-completion context for "natural language" completions, soDouglas Gregor2010-08-251-2/+1
| | | | | | that ASTUnit knows not to try to provide completions there. llvm-svn: 112057
* Introduce a preprocessor code-completion hook for contexts where weDouglas Gregor2010-08-251-0/+7
| | | | | | | expect "natural" language and should not provide any completions, e.g., comments, string literals, #error. llvm-svn: 112054
* Split FunctionScopeInfo and BlockScopeInfo into their own header.John McCall2010-08-251-3/+5
| | | | llvm-svn: 112038
* Teach Sema to live without CodeCompleteConsumer.h.John McCall2010-08-251-53/+53
| | | | llvm-svn: 112028
* When performing completions involving Objective-C method declarationsDouglas Gregor2010-08-251-17/+32
| | | | | | | (e.g., for message sends or method declaration/definition completions), adjust methods that come from a base class. llvm-svn: 112013
* Give a slight preference to functions returning "void" when we'reDouglas Gregor2010-08-241-4/+13
| | | | | | | performing code completion at the statement level (rather than in an arbitrary expression). llvm-svn: 112001
* Implement code completion for preprocessor expressions and in macroDouglas Gregor2010-08-241-4/+39
| | | | | | arguments. llvm-svn: 111976
* Move some of SemaOverload's API to various places in Overload.h, and killJohn McCall2010-08-241-1/+2
| | | | | | some of it off completely. llvm-svn: 111957
* Implement preprocessor code completion where a macro name is expected,Douglas Gregor2010-08-241-0/+24
| | | | | | | e.g., after #ifdef/#ifndef or #undef, or inside a defined <macroname> expression in a preprocessor conditional. llvm-svn: 111954
* Introduce basic code-completion support for preprocessor directives,Douglas Gregor2010-08-241-0/+180
| | | | | | e.g., after a "#" we'll suggest #if, #ifdef, etc. llvm-svn: 111943
* When providing completions for a function or method argument thatDouglas Gregor2010-08-241-11/+108
| | | | | | | corresponds to a block pointer, provide the skeleton of a block literal. llvm-svn: 111918
* More header elimination. The goal of all this is to allow Parser toJohn McCall2010-08-241-0/+1
| | | | | | | #include Sema.h while keeping all the AST declarations opaque. That may not be reasonably attainable, though. llvm-svn: 111907
* Struggle mightily against header inclusion in Sema.h.John McCall2010-08-241-0/+1
| | | | llvm-svn: 111904
* OwningExprResult -> ExprResult. This patch brought to you byJohn McCall2010-08-241-2/+2
| | | | | | | M-x query-replace-regexp \(Sema::\|Action::\|Parser::\|\)Owning\(Expr\|Stmt\)Result -> \2Result llvm-svn: 111903
* Abstract out passing around types and kill off ActionBase.John McCall2010-08-241-5/+5
| | | | llvm-svn: 111901
OpenPOWER on IntegriCloud