summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/CodeCompleteConsumer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [CodeComplete] Set preferred type to bool on conditionsIlya Biryukov2018-12-131-2/+5
| | | | | | | | | | | | Reviewers: kadircet Reviewed By: kadircet Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55431 llvm-svn: 349050
* [CodeComplete] Cleanup access checking in code completionIlya Biryukov2018-12-031-0/+3
| | | | | | | | | | | | | | Summary: Also fixes a crash (see the added 'accessibility-crash.cpp' test). Reviewers: ioeric, kadircet Reviewed By: kadircet Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55124 llvm-svn: 348135
* [CodeComplete] Simplify CodeCompleteConsumer.cpp, NFCFangrui Song2018-11-251-77/+69
| | | | | | | | Use range-based for loops Use XStr.compare(YStr) < 0 Format misaligned code llvm-svn: 347529
* [clang] Introduce new completion context typesKadir Cetinkaya2018-10-241-6/+9
| | | | | | | | | | | | | | Summary: New name suggestions were being used in places where existing names should have been used, this patch tries to fix some of those situations. Reviewers: sammccall Reviewed By: sammccall Subscribers: arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D53191 llvm-svn: 345152
* [CodeComplete] Expose InBaseClass signal in code completion results.Eric Liu2018-10-241-7/+12
| | | | | | | | | | | | | | | | | Summary: No new tests as the existing tests for result priority should give us coverage. Also as the new flag is trivial enough, I'm reluctant to plumb the flag to c-index-test output. Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D53635 llvm-svn: 345135
* [CodeComplete] Add completions for filenames in #include directives.Sam McCall2018-09-181-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: The dir component ("somedir" in #include <somedir/fo...>) is considered fixed. We append "foo" to each directory on the include path, and then list its files. Completions are of the forms: #include <somedir/fo^ foo.h> fox/ The filter is set to the filename part ("fo"), so fuzzy matching can be applied to the filename only. No fancy scoring/priorities are set, and no information is added to CodeCompleteResult to make smart scoring possible. Could be in future. Reviewers: ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52076 llvm-svn: 342449
* [clang] Make sure codecompletion is called for calls even when inside a token.Kadir Cetinkaya2018-09-101-0/+4
| | | | | | | | | | | | | | | | | Summary: Currently CodeCompleteCall only gets called after a comma or parantheses. This patch makes sure it is called even at the cases like: ```foo(1^);``` Reviewers: ilya-biryukov, ioeric, hokein Reviewed By: ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D51038 llvm-svn: 341824
* [CodeComplete] Report location of opening parens for signature helpIlya Biryukov2018-08-301-10/+12
| | | | | | | | | | | | | | Summary: Used in clangd. Reviewers: sammccall Reviewed By: sammccall Subscribers: ioeric, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D51436 llvm-svn: 341063
* Remove trailing spaceFangrui Song2018-07-301-55/+55
| | | | | | sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h} llvm-svn: 338291
* Optionally add code completion results for arrow instead of dotIvan Donchevskii2018-05-251-0/+18
| | | | | | | | | | | | | Currently getting such completions requires source correction, reparsing and calling completion again. And if it shows no results and rollback is required then it costs one more reparse. With this change it's possible to get all results which can be later filtered to split changes which require correction. Differential Revision: https://reviews.llvm.org/D41537 llvm-svn: 333272
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-091-2/+2
| | | | | | | | | | | | | | | | | | | This is similar to the LLVM change https://reviews.llvm.org/D46290. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46320 llvm-svn: 331834
* [Sema] Revert r329346 because of memory sanitizer failures.Eugene Zelenko2018-04-051-10/+10
| | | | llvm-svn: 329357
* [Sema] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2018-04-051-10/+10
| | | | | | other minor fixes (NFC). llvm-svn: 329346
* [Sema] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2018-02-201-32/+31
| | | | | | other minor fixes (NFC). llvm-svn: 325544
* [CodeComplete] Avoid name clashes of 'Kind' inside CodeCompletionContext. NFCIlya Biryukov2018-02-191-3/+3
| | | | | | | | | | CodeCompletionContext had declarations of field and enum inside, both named 'Kind'. It caused gcc 4.8 to give an incorrent warning when refering to enum as `enum CodeCompletionContext::Kind`. Avoid that warning by renaming the private field to CCKind. llvm-svn: 325496
* [CodeComplete] Add a helper to print CodeCompletionContext::KindIlya Biryukov2018-02-191-0/+75
| | | | | | | | | | | | | | Summary: Will be used in clangd. See D43377. Reviewers: sammccall Reviewed By: sammccall Subscribers: ioeric, cfe-commits Differential Revision: https://reviews.llvm.org/D43379 llvm-svn: 325490
* Silence a bunch of implicit fallthrough warningsAdrian Prantl2017-12-191-1/+1
| | | | llvm-svn: 321115
* [clang] Expose orderedString from CodeCompletionResult. NFCSam McCall2017-11-151-16/+12
| | | | llvm-svn: 318286
* Retire llvm::alignOf in favor of C++11 alignof.Benjamin Kramer2016-10-201-3/+3
| | | | | | No functionality change intended. llvm-svn: 284730
* Fix unnecessary default switch warningSimon Pilgrim2016-07-271-1/+1
| | | | llvm-svn: 276889
* Implement filtering for code completion of identifiers.Vassil Vassilev2016-07-271-0/+25
| | | | | | | | Patch by Cristina Cristescu and Axel Naumann! Agreed on post commit review (D17820). llvm-svn: 276878
* Silence some MSVC false positive warnings about integer zexts and falling ↵Reid Kleckner2016-02-101-1/+1
| | | | | | off the end of a covered switch llvm-svn: 260411
* Roll-back r250822.Angel Garcia Gomez2015-10-201-1/+1
| | | | | | | | | | Summary: It breaks the build for the ASTMatchers Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D13893 llvm-svn: 250827
* Apply modernize-use-default to clang.Angel Garcia Gomez2015-10-201-1/+1
| | | | | | | | | | | | Summary: Replace empty bodies of default constructors and destructors with '= default'. Reviewers: bkramer, klimek Subscribers: klimek, alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D13890 llvm-svn: 250822
* [libclang] Replace ObjC generic parameters in code-completion results.Douglas Gregor2015-07-071-2/+4
| | | | | | rdar://19369529 llvm-svn: 241557
* Teach Twine to support SmallString.Yaron Keren2015-03-171-10/+7
| | | | | | | | Enable removing .str() member calls for these frequent cases. http://reviews.llvm.org/D6372 llvm-svn: 232465
* Improves overload completion result chunks.Francisco Lopes da Silva2015-01-281-2/+28
| | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 227309
* [C++11] Use 'nullptr'. Sema edition.Craig Topper2014-05-261-5/+5
| | | | llvm-svn: 209613
* Fix a bunch of mislayered clang/Lex includes from SemaAlp Toker2014-05-031-1/+0
| | | | llvm-svn: 207896
* Allow the computation of the base priority for a declaration code completion ↵Douglas Gregor2013-01-311-28/+0
| | | | | | result to consider the completion context llvm-svn: 174037
* Use 'const Decl *' throughout code completion in SemaDmitri Gribenko2013-01-231-15/+16
| | | | llvm-svn: 173277
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-2/+2
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-4/+4
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* [libclang] Remove the ParentKind cursor kind from code-completion results.Argyrios Kyrtzidis2012-09-261-5/+2
| | | | | | This is to reduce dependency to cursors for the code-completion results. llvm-svn: 164705
* Add a new libclang completion API to get brief documentation comment that isDmitri Gribenko2012-07-021-5/+14
| | | | | | | | | | | | | | | | attached to a declaration in the completion string. Since extracting comments isn't free, a new code completion option is introduced. A new code completion option that enables including brief comments into CodeCompletionString should be a, err, code completion option. But because ASTUnit caches global declarations during parsing before even completion consumer is created, the option is duplicated as a translation unit option (in both libclang and ASTUnit, like the option to cache code completion results). llvm-svn: 159539
* Bitpack CodeCompletionResults.Benjamin Kramer2012-05-201-7/+1
| | | | llvm-svn: 157158
* [code-complete] Introduce CodeCompletionTUInfo which will be used for cachingArgyrios Kyrtzidis2012-04-101-52/+69
| | | | | | | | | | | | | | | | | | | code-completion related strings specific to a translation unit (ASTContext and related data) CodeCompletionAllocator does such limited caching, by caching the name assigned to a DeclContext*, but that is not the appropriate place since that object has a lifetime that can extend beyond that of an ASTContext. Introduce CodeCompletionTUInfo which will be always tied to a translation unit to do this kind of caching and move the caching of CodeCompletionAllocator into this object, and propagate it to all the places where it will be needed. The plan is to extend the caching where appropriate, using CodeCompletionTUInfo, to avoid re-calculating code-completion strings. Part of rdar://10796159. llvm-svn: 154408
* Introduce a new libclang API to determine the parent context of a codeDouglas Gregor2012-03-271-9/+80
| | | | | | | | | completion item. For example, if the code completion itself represents a declaration in a namespace (say, std::vector), then this API retrieves the cursor kind and name of the namespace (std). Implements <rdar://problem/11121951>. llvm-svn: 153545
* Move CodeCompletionBuilder's chunk adding methods out of line.Benjamin Kramer2012-03-261-0/+34
| | | | | | | This makes sense because chunk's ctor is also out of line and simplifies considerably when inlined with a constant parameter. Shrinks clang on i386-linux-Release+Asserts by 65k. llvm-svn: 153446
* When determining the availability of an enum constant, also considerDouglas Gregor2012-03-171-2/+11
| | | | | | | the availability of the enumeration type itself. Fixes <rdar://problem/10996386>. llvm-svn: 152977
* Basic: import SmallString<> into clang namespaceDylan Noblesmith2012-02-051-1/+1
| | | | | | | (I was going to fix the TODO about DenseMap too, but that would break self-host right now. See PR11922.) llvm-svn: 149799
* Move a method from IdentifierTable.h out of line and remove the SmallString ↵Benjamin Kramer2012-02-041-0/+1
| | | | | | | | include. Fix all the transitive include users. llvm-svn: 149783
* Remove unreachable code in Clang. (replace with llvm_unreachable where ↵David Blaikie2012-01-171-5/+4
| | | | | | appropriate or when GCC requires it) llvm-svn: 148292
* Eliminate ObjCForwardProtocolDecl, which is redundant now thatDouglas Gregor2012-01-011-2/+5
| | | | | | ObjCProtocolDecl modules forward declarations properly. llvm-svn: 147415
* Eliminate ObjCClassDecl, which is redundant now that ObjCInterfaceDeclDouglas Gregor2011-12-271-2/+8
| | | | | | | covers both declarations (@class) and definitions (@interface) of an Objective-C class. llvm-svn: 147299
* Change operator<< for raw_ostream and NamedDecl to take a reference instead ↵Benjamin Kramer2011-10-141-1/+1
| | | | | | | | of a pointer. Passing a pointer was a bad idea as it collides with the overload for void*. llvm-svn: 141971
* Added clang_getCompletionAnnotation and clang_getCompletionNumAnnotations toErik Verbruggen2011-10-141-4/+28
| | | | | | retrieve annotations from completion string. llvm-svn: 141953
* Added CXAvailability_NotAccessible to indicate that a declaration is ↵Erik Verbruggen2011-10-061-1/+4
| | | | | | available, but not accessible from the current code completion context. llvm-svn: 141278
* When performing code completion after at @interface, allow bothDouglas Gregor2011-07-301-1/+1
| | | | | | | | already-defined and forward-declared results. Already-defined results are fine because they could be the start of a category. Fixes <rdar://problem/9811691>. llvm-svn: 136559
OpenPOWER on IntegriCloud