llvm-project/clang/test/CodeCompletion
Ilya Biryukov ebf0a6d75d [CodeComplete] Do not complete self-initializations
Summary:
Removes references to initialized variable from the following completions:

    int x = ^;

Handles only the trivial cases where the variable name is completed
immediately at the start of initializer or assignment, more complicated
cases aren't covered, e.g. these completions still contain 'x':

    // More complicated expressions.
    int x = foo(^);
    int x = 10 + ^;
    // Other kinds of initialization.
    int x{^};
    int x(^);
    // Constructor initializers.
    struct Foo {
      Foo() : x(^) {}
      int x;
    };

We should address those in the future, but they are outside of the scope of
this initial change.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: arphaman, cfe-commits

Differential Revision: https://reviews.llvm.org/D54156

llvm-svn: 346301
2018-11-07 10:02:31 +00:00
..
Inputs [Lex] Fix crash on code completion in comment in included file. 2018-01-19 23:41:47 +00:00
PR9728.cpp
auto.cpp
auto_type.c [CodeCompletion] Code complete the '__auto_type' keyword 2017-02-13 23:35:59 +00:00
bracket-decl.c
call.c
call.cpp [CodeComplete] Clearly distinguish signature help and code completion. 2018-09-07 14:04:39 +00:00
comments.cpp [Lex] Fix crash on code completion in comment in included file. 2018-01-19 23:41:47 +00:00
constexpr.cpp
crash-func-decl.cpp [CodeComplete] Fix crash when completing params function declarations. 2018-10-10 10:51:48 +00:00
crash-func-init.cpp Fixed a crash in code completion. 2017-09-08 13:36:38 +00:00
crash-skipped-bodies-template-inst.cpp [Sema] Don't skip function bodies with 'auto' without trailing return type 2018-05-30 12:50:48 +00:00
ctor-initializer.cpp [clang] Improve ctor initializer completions. 2018-11-01 15:54:18 +00:00
documentation.cpp
documentation.m
enable-if-attr-crash.cpp [SemaOverload] Fixed crash on code completion 2018-03-09 14:43:29 +00:00
end-of-file.cpp [CodeComplete] Fix completion in the middle of ident in ctor lists. 2018-04-25 15:13:34 +00:00
end-of-ident-macro.cpp [CodeComplete] Fix completion at the end of keywords 2018-04-24 13:48:53 +00:00
end-of-ident.cpp [CodeComplete] Fix completion at the end of keywords 2018-04-24 13:48:53 +00:00
enum-switch-case-qualified.cpp
enum-switch-case.c
enum-switch-case.cpp
function-overloads.cpp [clang] Make sure codecompletion is called for calls even when inside a token. 2018-09-10 13:46:28 +00:00
function-templates.cpp
functions.cpp Add default values for function parameter chunks 2017-07-19 10:45:40 +00:00
ignore-ns-level-decls.cpp [Sema] Ignore decls in namespaces when global decls are not wanted. 2017-12-13 10:26:49 +00:00
included-files.cpp [CodeComplete] #include completion treats -I as non-system (require header-like extension). 2018-10-01 11:56:42 +00:00
incomplete-ret-type.cpp [CodeComplete] Provide completion in decls even for incomplete types 2018-05-14 13:50:36 +00:00
inside-macros.cpp [CodeComplete] Fix completion in the middle of idents in macro calls 2018-01-22 17:18:28 +00:00
keywords.cpp [CodeCompletion] Code complete the missing C++11 keywords 2017-02-13 23:19:40 +00:00
macros-in-modules.c
macros-in-modules.m
macros.c [CodeComplete] Fix completion at the end of keywords 2018-04-24 13:48:53 +00:00
member-access.c [CodeComplete] Generate completion fix-its for C code as well 2018-09-21 11:23:22 +00:00
member-access.cpp [CodeComplete] Expose InBaseClass signal in code completion results. 2018-10-24 12:57:27 +00:00
namespace-alias.cpp
namespace.cpp [CodeComplete] Fix completion at the end of keywords 2018-04-24 13:48:53 +00:00
nested-name-specifier.cpp
objc-expr.m
objc-message.m
objc-message.mm [CodeComplete] Expose InBaseClass signal in code completion results. 2018-10-24 12:57:27 +00:00
objc-protocol-member-access.m [CodeCompletion] Show protocol properties that are accessed through qualified id 2016-10-12 11:40:15 +00:00
operator.cpp [CodeComplete] Fix completion at the end of keywords 2018-04-24 13:48:53 +00:00
ordinary-name-cxx11.cpp [CodeComplete] Do not complete self-initializations 2018-11-07 10:02:31 +00:00
ordinary-name.c
ordinary-name.cpp [CodeComplete] Do not complete self-initializations 2018-11-07 10:02:31 +00:00
overrides.cpp [clang] Implement Override Suggestions in Sema. 2018-10-02 09:42:31 +00:00
paren_locs.cpp [CodeComplete] Report location of opening parens for signature help 2018-08-30 13:08:03 +00:00
pch-and-module.m
pragma-macro-token-caching.c [Preprocessor] Fix incorrect token caching that occurs when lexing _Pragma 2017-02-24 17:45:16 +00:00
preamble.c
qualifiers-as-written.cpp Workaround reverse-iteration buildbot breakages. Filed PR35244. 2017-11-08 13:05:52 +00:00
self-inits.cpp [CodeComplete] Do not complete self-initializations 2018-11-07 10:02:31 +00:00
skip-auto-funcs.cpp [CodeComplete] Add a few extra tests for r333538. NFC 2018-06-01 09:49:53 +00:00
some_struct.h
stdin.c
tag.c [CodeComplete] Fix completion at the end of keywords 2018-04-24 13:48:53 +00:00
tag.cpp [CodeComplete] Fix completion at the end of keywords 2018-04-24 13:48:53 +00:00
templates.cpp
truncation.c
truncation.c.h
uninstantiated_params.cpp Avoid printing some redundant name qualifiers in completion 2017-11-08 10:39:09 +00:00
using-namespace.cpp [CodeComplete] Fix completion at the end of keywords 2018-04-24 13:48:53 +00:00
using.cpp [CodeComplete] Fix completion at the end of keywords 2018-04-24 13:48:53 +00:00