diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-09-04 03:32:15 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-09-04 03:32:15 +0000 |
commit | 5cec2aea3f5c402bbf570bc71dc173562424c8d6 (patch) | |
tree | 831c0bb13a4db8c277d53fc819130d1abdb188d6 /clang/test/Index/complete-cxx-inline-methods.cpp | |
parent | a3deaeeb52acdc863ee98eb5bb20b419518bc592 (diff) | |
download | bcm5719-llvm-5cec2aea3f5c402bbf570bc71dc173562424c8d6.tar.gz bcm5719-llvm-5cec2aea3f5c402bbf570bc71dc173562424c8d6.zip |
Support code-completion for C++ inline methods and ObjC buffering methods.
Previously we would cut off the source file buffer at the code-completion
point; this impeded code-completion inside C++ inline methods and,
recently, with buffering ObjC methods.
Have the code-completion inserted into the source buffer so that it can
be buffered along with a method body. When we actually hit the code-completion
point the cut-off lexing or parsing.
Fixes rdar://10056932&8319466
llvm-svn: 139086
Diffstat (limited to 'clang/test/Index/complete-cxx-inline-methods.cpp')
-rw-r--r-- | clang/test/Index/complete-cxx-inline-methods.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/clang/test/Index/complete-cxx-inline-methods.cpp b/clang/test/Index/complete-cxx-inline-methods.cpp new file mode 100644 index 00000000000..e25949df4ca --- /dev/null +++ b/clang/test/Index/complete-cxx-inline-methods.cpp @@ -0,0 +1,24 @@ +class MyCls { + void in_foo() { + vec.x = 0; + } + void out_foo(); + + struct Vec { int x, y; }; + Vec vec; +}; + +void MyCls::out_foo() { + vec.x = 0; +} + +// RUN: c-index-test -code-completion-at=%s:3:9 %s | FileCheck %s +// RUN: c-index-test -code-completion-at=%s:12:7 %s | FileCheck %s +// CHECK: CXXMethod:{ResultType MyCls::Vec &}{TypedText operator=}{LeftParen (}{Placeholder const MyCls::Vec &}{RightParen )} (34) +// CHECK-NEXT: StructDecl:{TypedText Vec}{Text ::} (75) +// CHECK-NEXT: FieldDecl:{ResultType int}{TypedText x} (35) +// CHECK-NEXT: FieldDecl:{ResultType int}{TypedText y} (35) +// CHECK-NEXT: CXXDestructor:{ResultType void}{TypedText ~Vec}{LeftParen (}{RightParen )} (34) +// CHECK-NEXT: Completion contexts: +// CHECK-NEXT: Dot member access +// CHECK-NEXT: Container Kind: StructDecl |