Re: [PATCH] D17820: Clang Code Completion Filtering

2016-07-27 Thread Vassil Vassilev via cfe-commits

Fixed in r276889 by Simon Pilgrim!
On 27/07/16 22:03, Vassil Vassilev wrote:

Looking into it.
On 27/07/16 18:34, Jun Bum Lim wrote:

junbuml added a subscriber: junbuml.
junbuml added a comment.

It appears that build fails due to this change :

llvm/tools/clang/lib/Sema/CodeCompleteConsumer.cpp:448:3: error: 
default label in switch which covers all enumeration values 
[-Werror,-Wcovered-switch-default]


   default: llvm_unreachable("Unknown code completion result Kind.");
   ^


Repository:
   rL LLVM

https://reviews.llvm.org/D17820







___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D17820: Clang Code Completion Filtering

2016-07-27 Thread Vassil Vassilev via cfe-commits

Looking into it.
On 27/07/16 18:34, Jun Bum Lim wrote:

junbuml added a subscriber: junbuml.
junbuml added a comment.

It appears that build fails due to this change :

llvm/tools/clang/lib/Sema/CodeCompleteConsumer.cpp:448:3: error: default label 
in switch which covers all enumeration values [-Werror,-Wcovered-switch-default]

   default: llvm_unreachable("Unknown code completion result Kind.");
   ^


Repository:
   rL LLVM

https://reviews.llvm.org/D17820





___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D17820: Clang Code Completion Filtering

2016-07-27 Thread Jun Bum Lim via cfe-commits
junbuml added a subscriber: junbuml.
junbuml added a comment.

It appears that build fails due to this change :

llvm/tools/clang/lib/Sema/CodeCompleteConsumer.cpp:448:3: error: default label 
in switch which covers all enumeration values [-Werror,-Wcovered-switch-default]

  default: llvm_unreachable("Unknown code completion result Kind.");
  ^


Repository:
  rL LLVM

https://reviews.llvm.org/D17820



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D17820: Clang Code Completion Filtering

2016-07-27 Thread Vassil Vassilev via cfe-commits
v.g.vassilev closed this revision.
v.g.vassilev added a comment.

Landed in r276878.


Repository:
  rL LLVM

https://reviews.llvm.org/D17820



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D17820: Clang Code Completion Filtering

2016-07-26 Thread Bianca-Cristina Cristescu via cfe-commits
CrisCristescu updated this revision to Diff 65528.
CrisCristescu added a comment.

Wrong indentation update.


Repository:
  rL LLVM

https://reviews.llvm.org/D17820

Files:
  include/clang/Lex/Preprocessor.h
  include/clang/Sema/CodeCompleteConsumer.h
  lib/Lex/Lexer.cpp
  lib/Lex/Preprocessor.cpp
  lib/Sema/CodeCompleteConsumer.cpp
  test/CodeCompletion/filter-function-name.cpp
  test/CodeCompletion/filter-member-access.cpp
  test/CodeCompletion/filter-namespace.cpp
  test/CodeCompletion/filter-ordinary-name.cpp
  test/CodeCompletion/objc-message.mm
  test/Index/complete-method-decls.m
  test/Index/complete-objc-message-id.m
  test/Index/complete-objc-message.m
  test/Index/complete-recovery.m
  test/Index/complete-super.m

Index: test/Index/complete-super.m
===
--- test/Index/complete-super.m
+++ test/Index/complete-super.m
@@ -60,16 +60,16 @@
 // RUN: c-index-test -code-completion-at=%s:20:16 %s | FileCheck -check-prefix=CHECK-ADD-TO %s
 // CHECK-ADD-TO: ObjCInstanceMethodDecl:{ResultType void}{Informative add:}{TypedText to:}{Placeholder b} (20)
 
-// RUN: c-index-test -code-completion-at=%s:24:28 %s | FileCheck -check-prefix=CHECK-SELECTOR-FIRST %s
+// RUN: c-index-test -code-completion-at=%s:24:29 %s | FileCheck -check-prefix=CHECK-SELECTOR-FIRST %s
 // CHECK-SELECTOR-FIRST: ObjCClassMethodDecl:{ResultType void}{Informative select:}{TypedText first:}{Placeholder a}{HorizontalSpace  }{Text second:}{Placeholder b} (20)
 
 // Check "super" completion at the third identifier
 // RUN: c-index-test -code-completion-at=%s:24:37 %s | FileCheck -check-prefix=CHECK-SELECTOR-SECOND %s
 // CHECK-SELECTOR-SECOND: ObjCClassMethodDecl:{ResultType void}{Informative select:}{Informative first:}{TypedText second:}{Placeholder b} (20)
 
 // Check "super" completion with missing '['.
 // RUN: c-index-test -code-completion-at=%s:25:10 %s | FileCheck -check-prefix=CHECK-SELECTOR-SELECTOR %s
-// RUN: c-index-test -code-completion-at=%s:25:28 %s | FileCheck -check-prefix=CHECK-SELECTOR-FIRST %s
+// RUN: c-index-test -code-completion-at=%s:25:29 %s | FileCheck -check-prefix=CHECK-SELECTOR-FIRST %s
 // RUN: c-index-test -code-completion-at=%s:25:37 %s | FileCheck -check-prefix=CHECK-SELECTOR-SECOND %s
 
 // Check "super" completion for a method declared in a category.
Index: test/Index/complete-recovery.m
===
--- test/Index/complete-recovery.m
+++ test/Index/complete-recovery.m
@@ -26,7 +26,7 @@
 // Test case for fix committed in r145441.
 // RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:9:20 %s -fms-compatibility | FileCheck -check-prefix=CHECK-CC1 %s
 
-// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:10:24 %s | FileCheck -check-prefix=CHECK-CC2 %s
+// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:10:25 %s | FileCheck -check-prefix=CHECK-CC2 %s
 // CHECK-CC2: NotImplemented:{ResultType char[]}{TypedText @encode}{LeftParen (}{Placeholder type-name}{RightParen )}
 // CHECK-CC2: NotImplemented:{TypedText _Bool}
 // CHECK-CC2: VarDecl:{ResultType A *}{TypedText a}
Index: test/Index/complete-objc-message.m
===
--- test/Index/complete-objc-message.m
+++ test/Index/complete-objc-message.m
@@ -218,13 +218,13 @@
 // CHECK-CC2-NEXT: Container Kind: ObjCInterfaceDecl
 // CHECK-CC2-NEXT: Container is complete
 // CHECK-CC2-NEXT: Container USR: c:objc(cs)Foo
-// RUN: c-index-test -code-completion-at=%s:61:16 %s | FileCheck -check-prefix=CHECK-CC3 %s
+// RUN: c-index-test -code-completion-at=%s:61:17 %s | FileCheck -check-prefix=CHECK-CC3 %s
 // CHECK-CC3: ObjCClassMethodDecl:{ResultType int}{TypedText MyClassMethod:}{Placeholder (id)}
 // CHECK-CC3: ObjCClassMethodDecl:{ResultType int}{TypedText MyPrivateMethod}
-// RUN: c-index-test -code-completion-at=%s:65:16 %s | FileCheck -check-prefix=CHECK-CC4 %s
+// RUN: c-index-test -code-completion-at=%s:65:17 %s | FileCheck -check-prefix=CHECK-CC4 %s
 // CHECK-CC4: ObjCInstanceMethodDecl:{ResultType int}{TypedText MyInstMethod:}{Placeholder (id)}{HorizontalSpace  }{TypedText second:}{Placeholder (id)}
 // CHECK-CC4: ObjCInstanceMethodDecl:{ResultType int}{TypedText MyPrivateInstMethod}
-// RUN: c-index-test -code-completion-at=%s:74:9 %s | FileCheck -check-prefix=CHECK-CC5 %s
+// RUN: c-index-test -code-completion-at=%s:74:10 %s | FileCheck -check-prefix=CHECK-CC5 %s
 // CHECK-CC5: ObjCInstanceMethodDecl:{ResultType int}{TypedText MyInstMethod:}{Placeholder (id)}{HorizontalSpace  }{TypedText second:}{Placeholder (id)}
 // CHECK-CC5: ObjCInstanceMethodDecl:{ResultType int}{TypedText MySubInstMethod}
 // RUN: c-index-test -code-completion-at=%s:82:8 %s | FileCheck -check-prefix=CHECK-CC6 %s
@@ -311,7 +311,7 @@
 // CHECK-CCI: ObjCInstanceMethodDecl:{ResultType void}{TypedText method1} (37)
 // 

Re: [PATCH] D17820: Clang Code Completion Filtering

2016-07-26 Thread Vassil Vassilev via cfe-commits
v.g.vassilev requested changes to this revision.
v.g.vassilev added a reviewer: v.g.vassilev.
This revision now requires changes to proceed.


Comment at: lib/Lex/Preprocessor.cpp:748
@@ +747,3 @@
+  if (Result.is(tok::code_completion))
+  setCodeCompletionIdentifierInfo(Result.getIdentifierInfo());
+

It seems the indentation is too much here.


Repository:
  rL LLVM

https://reviews.llvm.org/D17820



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D17820: Clang Code Completion Filtering

2016-07-26 Thread Bianca-Cristina Cristescu via cfe-commits
CrisCristescu updated this revision to Diff 65508.
CrisCristescu marked an inline comment as done.
CrisCristescu added a comment.

Some more cosmetics.


Repository:
  rL LLVM

https://reviews.llvm.org/D17820

Files:
  include/clang/Lex/Preprocessor.h
  include/clang/Sema/CodeCompleteConsumer.h
  lib/Lex/Lexer.cpp
  lib/Lex/Preprocessor.cpp
  lib/Sema/CodeCompleteConsumer.cpp
  test/CodeCompletion/filter-function-name.cpp
  test/CodeCompletion/filter-member-access.cpp
  test/CodeCompletion/filter-namespace.cpp
  test/CodeCompletion/filter-ordinary-name.cpp
  test/CodeCompletion/objc-message.mm
  test/Index/complete-method-decls.m
  test/Index/complete-objc-message-id.m
  test/Index/complete-objc-message.m
  test/Index/complete-recovery.m
  test/Index/complete-super.m

Index: test/Index/complete-super.m
===
--- test/Index/complete-super.m
+++ test/Index/complete-super.m
@@ -60,16 +60,16 @@
 // RUN: c-index-test -code-completion-at=%s:20:16 %s | FileCheck -check-prefix=CHECK-ADD-TO %s
 // CHECK-ADD-TO: ObjCInstanceMethodDecl:{ResultType void}{Informative add:}{TypedText to:}{Placeholder b} (20)
 
-// RUN: c-index-test -code-completion-at=%s:24:28 %s | FileCheck -check-prefix=CHECK-SELECTOR-FIRST %s
+// RUN: c-index-test -code-completion-at=%s:24:29 %s | FileCheck -check-prefix=CHECK-SELECTOR-FIRST %s
 // CHECK-SELECTOR-FIRST: ObjCClassMethodDecl:{ResultType void}{Informative select:}{TypedText first:}{Placeholder a}{HorizontalSpace  }{Text second:}{Placeholder b} (20)
 
 // Check "super" completion at the third identifier
 // RUN: c-index-test -code-completion-at=%s:24:37 %s | FileCheck -check-prefix=CHECK-SELECTOR-SECOND %s
 // CHECK-SELECTOR-SECOND: ObjCClassMethodDecl:{ResultType void}{Informative select:}{Informative first:}{TypedText second:}{Placeholder b} (20)
 
 // Check "super" completion with missing '['.
 // RUN: c-index-test -code-completion-at=%s:25:10 %s | FileCheck -check-prefix=CHECK-SELECTOR-SELECTOR %s
-// RUN: c-index-test -code-completion-at=%s:25:28 %s | FileCheck -check-prefix=CHECK-SELECTOR-FIRST %s
+// RUN: c-index-test -code-completion-at=%s:25:29 %s | FileCheck -check-prefix=CHECK-SELECTOR-FIRST %s
 // RUN: c-index-test -code-completion-at=%s:25:37 %s | FileCheck -check-prefix=CHECK-SELECTOR-SECOND %s
 
 // Check "super" completion for a method declared in a category.
Index: test/Index/complete-recovery.m
===
--- test/Index/complete-recovery.m
+++ test/Index/complete-recovery.m
@@ -26,7 +26,7 @@
 // Test case for fix committed in r145441.
 // RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:9:20 %s -fms-compatibility | FileCheck -check-prefix=CHECK-CC1 %s
 
-// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:10:24 %s | FileCheck -check-prefix=CHECK-CC2 %s
+// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:10:25 %s | FileCheck -check-prefix=CHECK-CC2 %s
 // CHECK-CC2: NotImplemented:{ResultType char[]}{TypedText @encode}{LeftParen (}{Placeholder type-name}{RightParen )}
 // CHECK-CC2: NotImplemented:{TypedText _Bool}
 // CHECK-CC2: VarDecl:{ResultType A *}{TypedText a}
Index: test/Index/complete-objc-message.m
===
--- test/Index/complete-objc-message.m
+++ test/Index/complete-objc-message.m
@@ -218,13 +218,13 @@
 // CHECK-CC2-NEXT: Container Kind: ObjCInterfaceDecl
 // CHECK-CC2-NEXT: Container is complete
 // CHECK-CC2-NEXT: Container USR: c:objc(cs)Foo
-// RUN: c-index-test -code-completion-at=%s:61:16 %s | FileCheck -check-prefix=CHECK-CC3 %s
+// RUN: c-index-test -code-completion-at=%s:61:17 %s | FileCheck -check-prefix=CHECK-CC3 %s
 // CHECK-CC3: ObjCClassMethodDecl:{ResultType int}{TypedText MyClassMethod:}{Placeholder (id)}
 // CHECK-CC3: ObjCClassMethodDecl:{ResultType int}{TypedText MyPrivateMethod}
-// RUN: c-index-test -code-completion-at=%s:65:16 %s | FileCheck -check-prefix=CHECK-CC4 %s
+// RUN: c-index-test -code-completion-at=%s:65:17 %s | FileCheck -check-prefix=CHECK-CC4 %s
 // CHECK-CC4: ObjCInstanceMethodDecl:{ResultType int}{TypedText MyInstMethod:}{Placeholder (id)}{HorizontalSpace  }{TypedText second:}{Placeholder (id)}
 // CHECK-CC4: ObjCInstanceMethodDecl:{ResultType int}{TypedText MyPrivateInstMethod}
-// RUN: c-index-test -code-completion-at=%s:74:9 %s | FileCheck -check-prefix=CHECK-CC5 %s
+// RUN: c-index-test -code-completion-at=%s:74:10 %s | FileCheck -check-prefix=CHECK-CC5 %s
 // CHECK-CC5: ObjCInstanceMethodDecl:{ResultType int}{TypedText MyInstMethod:}{Placeholder (id)}{HorizontalSpace  }{TypedText second:}{Placeholder (id)}
 // CHECK-CC5: ObjCInstanceMethodDecl:{ResultType int}{TypedText MySubInstMethod}
 // RUN: c-index-test -code-completion-at=%s:82:8 %s | FileCheck -check-prefix=CHECK-CC6 %s
@@ -311,7 +311,7 @@
 // CHECK-CCI: ObjCInstanceMethodDecl:{ResultType 

Re: [PATCH] D17820: Clang Code Completion Filtering

2016-07-25 Thread Bianca-Cristina Cristescu via cfe-commits
CrisCristescu updated this revision to Diff 65403.
CrisCristescu marked an inline comment as done.
CrisCristescu added a comment.

PP CodeCompletionII initialisation.


Repository:
  rL LLVM

https://reviews.llvm.org/D17820

Files:
  include/clang/Lex/Preprocessor.h
  include/clang/Sema/CodeCompleteConsumer.h
  lib/Lex/Lexer.cpp
  lib/Lex/Preprocessor.cpp
  lib/Sema/CodeCompleteConsumer.cpp
  test/CodeCompletion/filter-function-name.cpp
  test/CodeCompletion/filter-member-access.cpp
  test/CodeCompletion/filter-namespace.cpp
  test/CodeCompletion/filter-ordinary-name.cpp
  test/CodeCompletion/objc-message.mm
  test/Index/complete-method-decls.m
  test/Index/complete-objc-message-id.m
  test/Index/complete-objc-message.m
  test/Index/complete-recovery.m
  test/Index/complete-super.m

Index: test/Index/complete-super.m
===
--- test/Index/complete-super.m
+++ test/Index/complete-super.m
@@ -60,16 +60,16 @@
 // RUN: c-index-test -code-completion-at=%s:20:16 %s | FileCheck -check-prefix=CHECK-ADD-TO %s
 // CHECK-ADD-TO: ObjCInstanceMethodDecl:{ResultType void}{Informative add:}{TypedText to:}{Placeholder b} (20)
 
-// RUN: c-index-test -code-completion-at=%s:24:28 %s | FileCheck -check-prefix=CHECK-SELECTOR-FIRST %s
+// RUN: c-index-test -code-completion-at=%s:24:29 %s | FileCheck -check-prefix=CHECK-SELECTOR-FIRST %s
 // CHECK-SELECTOR-FIRST: ObjCClassMethodDecl:{ResultType void}{Informative select:}{TypedText first:}{Placeholder a}{HorizontalSpace  }{Text second:}{Placeholder b} (20)
 
 // Check "super" completion at the third identifier
 // RUN: c-index-test -code-completion-at=%s:24:37 %s | FileCheck -check-prefix=CHECK-SELECTOR-SECOND %s
 // CHECK-SELECTOR-SECOND: ObjCClassMethodDecl:{ResultType void}{Informative select:}{Informative first:}{TypedText second:}{Placeholder b} (20)
 
 // Check "super" completion with missing '['.
 // RUN: c-index-test -code-completion-at=%s:25:10 %s | FileCheck -check-prefix=CHECK-SELECTOR-SELECTOR %s
-// RUN: c-index-test -code-completion-at=%s:25:28 %s | FileCheck -check-prefix=CHECK-SELECTOR-FIRST %s
+// RUN: c-index-test -code-completion-at=%s:25:29 %s | FileCheck -check-prefix=CHECK-SELECTOR-FIRST %s
 // RUN: c-index-test -code-completion-at=%s:25:37 %s | FileCheck -check-prefix=CHECK-SELECTOR-SECOND %s
 
 // Check "super" completion for a method declared in a category.
Index: test/Index/complete-recovery.m
===
--- test/Index/complete-recovery.m
+++ test/Index/complete-recovery.m
@@ -26,7 +26,7 @@
 // Test case for fix committed in r145441.
 // RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:9:20 %s -fms-compatibility | FileCheck -check-prefix=CHECK-CC1 %s
 
-// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:10:24 %s | FileCheck -check-prefix=CHECK-CC2 %s
+// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:10:25 %s | FileCheck -check-prefix=CHECK-CC2 %s
 // CHECK-CC2: NotImplemented:{ResultType char[]}{TypedText @encode}{LeftParen (}{Placeholder type-name}{RightParen )}
 // CHECK-CC2: NotImplemented:{TypedText _Bool}
 // CHECK-CC2: VarDecl:{ResultType A *}{TypedText a}
Index: test/Index/complete-objc-message.m
===
--- test/Index/complete-objc-message.m
+++ test/Index/complete-objc-message.m
@@ -218,13 +218,13 @@
 // CHECK-CC2-NEXT: Container Kind: ObjCInterfaceDecl
 // CHECK-CC2-NEXT: Container is complete
 // CHECK-CC2-NEXT: Container USR: c:objc(cs)Foo
-// RUN: c-index-test -code-completion-at=%s:61:16 %s | FileCheck -check-prefix=CHECK-CC3 %s
+// RUN: c-index-test -code-completion-at=%s:61:17 %s | FileCheck -check-prefix=CHECK-CC3 %s
 // CHECK-CC3: ObjCClassMethodDecl:{ResultType int}{TypedText MyClassMethod:}{Placeholder (id)}
 // CHECK-CC3: ObjCClassMethodDecl:{ResultType int}{TypedText MyPrivateMethod}
-// RUN: c-index-test -code-completion-at=%s:65:16 %s | FileCheck -check-prefix=CHECK-CC4 %s
+// RUN: c-index-test -code-completion-at=%s:65:17 %s | FileCheck -check-prefix=CHECK-CC4 %s
 // CHECK-CC4: ObjCInstanceMethodDecl:{ResultType int}{TypedText MyInstMethod:}{Placeholder (id)}{HorizontalSpace  }{TypedText second:}{Placeholder (id)}
 // CHECK-CC4: ObjCInstanceMethodDecl:{ResultType int}{TypedText MyPrivateInstMethod}
-// RUN: c-index-test -code-completion-at=%s:74:9 %s | FileCheck -check-prefix=CHECK-CC5 %s
+// RUN: c-index-test -code-completion-at=%s:74:10 %s | FileCheck -check-prefix=CHECK-CC5 %s
 // CHECK-CC5: ObjCInstanceMethodDecl:{ResultType int}{TypedText MyInstMethod:}{Placeholder (id)}{HorizontalSpace  }{TypedText second:}{Placeholder (id)}
 // CHECK-CC5: ObjCInstanceMethodDecl:{ResultType int}{TypedText MySubInstMethod}
 // RUN: c-index-test -code-completion-at=%s:82:8 %s | FileCheck -check-prefix=CHECK-CC6 %s
@@ -311,7 +311,7 @@
 // CHECK-CCI: 

Re: [PATCH] D17820: Clang Code Completion Filtering

2016-07-25 Thread Bianca-Cristina Cristescu via cfe-commits
CrisCristescu updated this revision to Diff 65401.
CrisCristescu marked 3 inline comments as done.
CrisCristescu added a comment.

Addressing some sugesstions.


Repository:
  rL LLVM

https://reviews.llvm.org/D17820

Files:
  include/clang/Lex/Preprocessor.h
  include/clang/Sema/CodeCompleteConsumer.h
  lib/Lex/Lexer.cpp
  lib/Lex/Preprocessor.cpp
  lib/Sema/CodeCompleteConsumer.cpp
  test/CodeCompletion/filter-function-name.cpp
  test/CodeCompletion/filter-member-access.cpp
  test/CodeCompletion/filter-namespace.cpp
  test/CodeCompletion/filter-ordinary-name.cpp
  test/CodeCompletion/objc-message.mm
  test/Index/complete-method-decls.m
  test/Index/complete-objc-message-id.m
  test/Index/complete-objc-message.m
  test/Index/complete-recovery.m
  test/Index/complete-super.m

Index: test/Index/complete-super.m
===
--- test/Index/complete-super.m
+++ test/Index/complete-super.m
@@ -60,16 +60,16 @@
 // RUN: c-index-test -code-completion-at=%s:20:16 %s | FileCheck -check-prefix=CHECK-ADD-TO %s
 // CHECK-ADD-TO: ObjCInstanceMethodDecl:{ResultType void}{Informative add:}{TypedText to:}{Placeholder b} (20)
 
-// RUN: c-index-test -code-completion-at=%s:24:28 %s | FileCheck -check-prefix=CHECK-SELECTOR-FIRST %s
+// RUN: c-index-test -code-completion-at=%s:24:29 %s | FileCheck -check-prefix=CHECK-SELECTOR-FIRST %s
 // CHECK-SELECTOR-FIRST: ObjCClassMethodDecl:{ResultType void}{Informative select:}{TypedText first:}{Placeholder a}{HorizontalSpace  }{Text second:}{Placeholder b} (20)
 
 // Check "super" completion at the third identifier
 // RUN: c-index-test -code-completion-at=%s:24:37 %s | FileCheck -check-prefix=CHECK-SELECTOR-SECOND %s
 // CHECK-SELECTOR-SECOND: ObjCClassMethodDecl:{ResultType void}{Informative select:}{Informative first:}{TypedText second:}{Placeholder b} (20)
 
 // Check "super" completion with missing '['.
 // RUN: c-index-test -code-completion-at=%s:25:10 %s | FileCheck -check-prefix=CHECK-SELECTOR-SELECTOR %s
-// RUN: c-index-test -code-completion-at=%s:25:28 %s | FileCheck -check-prefix=CHECK-SELECTOR-FIRST %s
+// RUN: c-index-test -code-completion-at=%s:25:29 %s | FileCheck -check-prefix=CHECK-SELECTOR-FIRST %s
 // RUN: c-index-test -code-completion-at=%s:25:37 %s | FileCheck -check-prefix=CHECK-SELECTOR-SECOND %s
 
 // Check "super" completion for a method declared in a category.
Index: test/Index/complete-recovery.m
===
--- test/Index/complete-recovery.m
+++ test/Index/complete-recovery.m
@@ -26,7 +26,7 @@
 // Test case for fix committed in r145441.
 // RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:9:20 %s -fms-compatibility | FileCheck -check-prefix=CHECK-CC1 %s
 
-// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:10:24 %s | FileCheck -check-prefix=CHECK-CC2 %s
+// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:10:25 %s | FileCheck -check-prefix=CHECK-CC2 %s
 // CHECK-CC2: NotImplemented:{ResultType char[]}{TypedText @encode}{LeftParen (}{Placeholder type-name}{RightParen )}
 // CHECK-CC2: NotImplemented:{TypedText _Bool}
 // CHECK-CC2: VarDecl:{ResultType A *}{TypedText a}
Index: test/Index/complete-objc-message.m
===
--- test/Index/complete-objc-message.m
+++ test/Index/complete-objc-message.m
@@ -218,13 +218,13 @@
 // CHECK-CC2-NEXT: Container Kind: ObjCInterfaceDecl
 // CHECK-CC2-NEXT: Container is complete
 // CHECK-CC2-NEXT: Container USR: c:objc(cs)Foo
-// RUN: c-index-test -code-completion-at=%s:61:16 %s | FileCheck -check-prefix=CHECK-CC3 %s
+// RUN: c-index-test -code-completion-at=%s:61:17 %s | FileCheck -check-prefix=CHECK-CC3 %s
 // CHECK-CC3: ObjCClassMethodDecl:{ResultType int}{TypedText MyClassMethod:}{Placeholder (id)}
 // CHECK-CC3: ObjCClassMethodDecl:{ResultType int}{TypedText MyPrivateMethod}
-// RUN: c-index-test -code-completion-at=%s:65:16 %s | FileCheck -check-prefix=CHECK-CC4 %s
+// RUN: c-index-test -code-completion-at=%s:65:17 %s | FileCheck -check-prefix=CHECK-CC4 %s
 // CHECK-CC4: ObjCInstanceMethodDecl:{ResultType int}{TypedText MyInstMethod:}{Placeholder (id)}{HorizontalSpace  }{TypedText second:}{Placeholder (id)}
 // CHECK-CC4: ObjCInstanceMethodDecl:{ResultType int}{TypedText MyPrivateInstMethod}
-// RUN: c-index-test -code-completion-at=%s:74:9 %s | FileCheck -check-prefix=CHECK-CC5 %s
+// RUN: c-index-test -code-completion-at=%s:74:10 %s | FileCheck -check-prefix=CHECK-CC5 %s
 // CHECK-CC5: ObjCInstanceMethodDecl:{ResultType int}{TypedText MyInstMethod:}{Placeholder (id)}{HorizontalSpace  }{TypedText second:}{Placeholder (id)}
 // CHECK-CC5: ObjCInstanceMethodDecl:{ResultType int}{TypedText MySubInstMethod}
 // RUN: c-index-test -code-completion-at=%s:82:8 %s | FileCheck -check-prefix=CHECK-CC6 %s
@@ -311,7 +311,7 @@
 // CHECK-CCI: 

Re: [PATCH] D17820: Clang Code Completion Filtering

2016-07-22 Thread Argyrios Kyrtzidis via cfe-commits
akyrtzi added a comment.

Thanks for making the changes; I'd recommend to go ahead and commit and we can 
iterate post-commit if necessary.


Repository:
  rL LLVM

https://reviews.llvm.org/D17820



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D17820: Clang Code Completion Filtering

2016-07-22 Thread Vassil Vassilev via cfe-commits
v.g.vassilev added a subscriber: v.g.vassilev.


Comment at: include/clang/Lex/Preprocessor.h:270
@@ +269,3 @@
+  /// on the stem that is to be code completed.
+  IdentifierInfo *CodeCompletionII;
+

Can you initialize this variable in the PP's ctor?


Repository:
  rL LLVM

https://reviews.llvm.org/D17820



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D17820: Clang Code Completion Filtering

2016-05-09 Thread Axel Naumann via cfe-commits
karies added a comment.

Regarding the concerns raised by @akyrtzi : maybe it's a question of making the 
completer interface useful at low cost (with filtering for generic use cases 
and less ASTReading) versus not breaking existing use cases (fuzzy match). 
Would you still object to this change if the filtering could be disabled in the 
CodeCompleteConsumer?


Repository:
  rL LLVM

http://reviews.llvm.org/D17820



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D17820: Clang Code Completion Filtering

2016-05-05 Thread Ben Langmuir via cfe-commits
benlangmuir added a comment.

LGTM with one comment about the doxygen comments, but you should probably wait 
to hear from @akyrtzi too.



Comment at: include/clang/Sema/CodeCompleteConsumer.h:916
@@ +915,3 @@
+  /// \name Code-completion filtering
+  //@{
+  /// \brief Check if the result should be filtered out.

Do we really need a group here for just one method?  If we do need the group, 
there should be a matching `@}`.  And it's missing one of the slashes (should 
be  `/// @{`).


Repository:
  rL LLVM

http://reviews.llvm.org/D17820



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D17820: Clang Code Completion Filtering

2016-05-04 Thread Bianca-Cristina Cristescu via cfe-commits
CrisCristescu updated this revision to Diff 56115.
CrisCristescu added a comment.

Addresses the previous comments and adds testing for filtering. 
All the tests already in CodeCompletion are testing both the backward 
compatibility and the new functionality itself.


Repository:
  rL LLVM

http://reviews.llvm.org/D17820

Files:
  include/clang/Lex/Preprocessor.h
  include/clang/Sema/CodeCompleteConsumer.h
  lib/Lex/Lexer.cpp
  lib/Lex/Preprocessor.cpp
  lib/Sema/CodeCompleteConsumer.cpp
  test/CodeCompletion/Filtering/filter-function-name.cpp
  test/CodeCompletion/Filtering/filter-member-access.cpp
  test/CodeCompletion/Filtering/filter-namespace.cpp
  test/CodeCompletion/Filtering/filter-ordinary-name.cpp
  test/CodeCompletion/objc-message.mm
  test/Index/complete-method-decls.m
  test/Index/complete-objc-message-id.m
  test/Index/complete-objc-message.m
  test/Index/complete-recovery.m
  test/Index/complete-super.m

Index: test/Index/complete-super.m
===
--- test/Index/complete-super.m
+++ test/Index/complete-super.m
@@ -60,7 +60,7 @@
 // RUN: c-index-test -code-completion-at=%s:20:16 %s | FileCheck -check-prefix=CHECK-ADD-TO %s
 // CHECK-ADD-TO: ObjCInstanceMethodDecl:{ResultType void}{Informative add:}{TypedText to:}{Placeholder b} (20)
 
-// RUN: c-index-test -code-completion-at=%s:24:28 %s | FileCheck -check-prefix=CHECK-SELECTOR-FIRST %s
+// RUN: c-index-test -code-completion-at=%s:24:29 %s | FileCheck -check-prefix=CHECK-SELECTOR-FIRST %s
 // CHECK-SELECTOR-FIRST: ObjCClassMethodDecl:{ResultType void}{Informative select:}{TypedText first:}{Placeholder a}{HorizontalSpace  }{Text second:}{Placeholder b} (20)
 
 // Check "super" completion at the third identifier
@@ -69,7 +69,7 @@
 
 // Check "super" completion with missing '['.
 // RUN: c-index-test -code-completion-at=%s:25:10 %s | FileCheck -check-prefix=CHECK-SELECTOR-SELECTOR %s
-// RUN: c-index-test -code-completion-at=%s:25:28 %s | FileCheck -check-prefix=CHECK-SELECTOR-FIRST %s
+// RUN: c-index-test -code-completion-at=%s:25:29 %s | FileCheck -check-prefix=CHECK-SELECTOR-FIRST %s
 // RUN: c-index-test -code-completion-at=%s:25:37 %s | FileCheck -check-prefix=CHECK-SELECTOR-SECOND %s
 
 // Check "super" completion for a method declared in a category.
Index: test/Index/complete-recovery.m
===
--- test/Index/complete-recovery.m
+++ test/Index/complete-recovery.m
@@ -26,7 +26,7 @@
 // Test case for fix committed in r145441.
 // RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:9:20 %s -fms-compatibility | FileCheck -check-prefix=CHECK-CC1 %s
 
-// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:10:24 %s | FileCheck -check-prefix=CHECK-CC2 %s
+// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:10:25 %s | FileCheck -check-prefix=CHECK-CC2 %s
 // CHECK-CC2: NotImplemented:{ResultType char[]}{TypedText @encode}{LeftParen (}{Placeholder type-name}{RightParen )}
 // CHECK-CC2: NotImplemented:{TypedText _Bool}
 // CHECK-CC2: VarDecl:{ResultType A *}{TypedText a}
Index: test/Index/complete-objc-message.m
===
--- test/Index/complete-objc-message.m
+++ test/Index/complete-objc-message.m
@@ -218,13 +218,13 @@
 // CHECK-CC2-NEXT: Container Kind: ObjCInterfaceDecl
 // CHECK-CC2-NEXT: Container is complete
 // CHECK-CC2-NEXT: Container USR: c:objc(cs)Foo
-// RUN: c-index-test -code-completion-at=%s:61:16 %s | FileCheck -check-prefix=CHECK-CC3 %s
+// RUN: c-index-test -code-completion-at=%s:61:17 %s | FileCheck -check-prefix=CHECK-CC3 %s
 // CHECK-CC3: ObjCClassMethodDecl:{ResultType int}{TypedText MyClassMethod:}{Placeholder (id)}
 // CHECK-CC3: ObjCClassMethodDecl:{ResultType int}{TypedText MyPrivateMethod}
-// RUN: c-index-test -code-completion-at=%s:65:16 %s | FileCheck -check-prefix=CHECK-CC4 %s
+// RUN: c-index-test -code-completion-at=%s:65:17 %s | FileCheck -check-prefix=CHECK-CC4 %s
 // CHECK-CC4: ObjCInstanceMethodDecl:{ResultType int}{TypedText MyInstMethod:}{Placeholder (id)}{HorizontalSpace  }{TypedText second:}{Placeholder (id)}
 // CHECK-CC4: ObjCInstanceMethodDecl:{ResultType int}{TypedText MyPrivateInstMethod}
-// RUN: c-index-test -code-completion-at=%s:74:9 %s | FileCheck -check-prefix=CHECK-CC5 %s
+// RUN: c-index-test -code-completion-at=%s:74:10 %s | FileCheck -check-prefix=CHECK-CC5 %s
 // CHECK-CC5: ObjCInstanceMethodDecl:{ResultType int}{TypedText MyInstMethod:}{Placeholder (id)}{HorizontalSpace  }{TypedText second:}{Placeholder (id)}
 // CHECK-CC5: ObjCInstanceMethodDecl:{ResultType int}{TypedText MySubInstMethod}
 // RUN: c-index-test -code-completion-at=%s:82:8 %s | FileCheck -check-prefix=CHECK-CC6 %s
@@ -311,7 +311,7 @@
 // CHECK-CCI: ObjCInstanceMethodDecl:{ResultType void}{TypedText method1} (37)
 // CHECK-CCI: ObjCInstanceMethodDecl:{ResultType 

Re: [PATCH] D17820: Clang Code Completion Filtering

2016-03-23 Thread Bianca-Cristina Cristescu via cfe-commits
CrisCristescu added a comment.

For the filtering itself the motivation for not doing it on the client side is 
the following in our use case:

- we do not re-filter on every key stroke, we only filter when the  key is 
pressed i.e there is one completion point;
- we have a PCH which will help with the generation time;
- performance is acceptable with the patch included: less than 1s even when the 
file contains several "heavier" includes such as  or ;
- without the patch if the  key is pressed in the middle of the identifier 
name (i.e setDouble) an error is thrown:

fiter-member-access.cpp:19:17: error: no member named 'set' in 'MyClass'

objectMyClass->set
~  ^
  - and most importantly, we plan to propose another set of patches which would 
do lookup's only on subsets of the DeclContext of the identifier i.e incomplete 
lookup-s in order to reduce the amount of PCH deserializations.


Repository:
  rL LLVM

http://reviews.llvm.org/D17820



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D17820: Clang Code Completion Filtering

2016-03-23 Thread Bianca-Cristina Cristescu via cfe-commits
CrisCristescu updated this revision to Diff 51404.
CrisCristescu added a comment.

The code_completion token now stores the information, if there is one,
about the identifier that it is lexing.
During the parsing there is a common entry point which is ConsumerToken
where we can set the information necessary for filtering in the Sema
in the case of a code_completion token.
The information is retrieved when doing the actual filtering.

This introduces a change in functionality which means that some tests
had to be modified(6 tests for ObjC) due to the fact that if you press
tab at the end of a word which could be a language specific keyword,
you will get the possible completions of this identifier,
not what could be written after the space. This is in accordance with the
behaviour of IDEs, for instance XCode.
As an example:
const will only give completions for variables like constVar,
and if you have const the you get the possible completions:
const double, const int etc.


Repository:
  rL LLVM

http://reviews.llvm.org/D17820

Files:
  include/clang/Parse/Parser.h
  include/clang/Sema/CodeCompleteConsumer.h
  include/clang/Sema/Sema.h
  lib/Lex/Lexer.cpp
  lib/Sema/CodeCompleteConsumer.cpp
  lib/Sema/Sema.cpp
  test/CodeCompletion/objc-message.mm
  test/Index/complete-method-decls.m
  test/Index/complete-objc-message-id.m
  test/Index/complete-objc-message.m
  test/Index/complete-recovery.m
  test/Index/complete-super.m

Index: test/Index/complete-super.m
===
--- test/Index/complete-super.m
+++ test/Index/complete-super.m
@@ -60,7 +60,7 @@
 // RUN: c-index-test -code-completion-at=%s:20:16 %s | FileCheck -check-prefix=CHECK-ADD-TO %s
 // CHECK-ADD-TO: ObjCInstanceMethodDecl:{ResultType void}{Informative add:}{TypedText to:}{Placeholder b} (20)
 
-// RUN: c-index-test -code-completion-at=%s:24:28 %s | FileCheck -check-prefix=CHECK-SELECTOR-FIRST %s
+// RUN: c-index-test -code-completion-at=%s:24:29 %s | FileCheck -check-prefix=CHECK-SELECTOR-FIRST %s
 // CHECK-SELECTOR-FIRST: ObjCClassMethodDecl:{ResultType void}{Informative select:}{TypedText first:}{Placeholder a}{HorizontalSpace  }{Text second:}{Placeholder b} (20)
 
 // Check "super" completion at the third identifier
@@ -69,7 +69,7 @@
 
 // Check "super" completion with missing '['.
 // RUN: c-index-test -code-completion-at=%s:25:10 %s | FileCheck -check-prefix=CHECK-SELECTOR-SELECTOR %s
-// RUN: c-index-test -code-completion-at=%s:25:28 %s | FileCheck -check-prefix=CHECK-SELECTOR-FIRST %s
+// RUN: c-index-test -code-completion-at=%s:25:29 %s | FileCheck -check-prefix=CHECK-SELECTOR-FIRST %s
 // RUN: c-index-test -code-completion-at=%s:25:37 %s | FileCheck -check-prefix=CHECK-SELECTOR-SECOND %s
 
 // Check "super" completion for a method declared in a category.
Index: test/Index/complete-recovery.m
===
--- test/Index/complete-recovery.m
+++ test/Index/complete-recovery.m
@@ -26,7 +26,7 @@
 // Test case for fix committed in r145441.
 // RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:9:20 %s -fms-compatibility | FileCheck -check-prefix=CHECK-CC1 %s
 
-// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:10:24 %s | FileCheck -check-prefix=CHECK-CC2 %s
+// RUN: env CINDEXTEST_CODE_COMPLETE_PATTERNS=1 c-index-test -code-completion-at=%s:10:25 %s | FileCheck -check-prefix=CHECK-CC2 %s
 // CHECK-CC2: NotImplemented:{ResultType char[]}{TypedText @encode}{LeftParen (}{Placeholder type-name}{RightParen )}
 // CHECK-CC2: NotImplemented:{TypedText _Bool}
 // CHECK-CC2: VarDecl:{ResultType A *}{TypedText a}
Index: test/Index/complete-objc-message.m
===
--- test/Index/complete-objc-message.m
+++ test/Index/complete-objc-message.m
@@ -218,13 +218,13 @@
 // CHECK-CC2-NEXT: Container Kind: ObjCInterfaceDecl
 // CHECK-CC2-NEXT: Container is complete
 // CHECK-CC2-NEXT: Container USR: c:objc(cs)Foo
-// RUN: c-index-test -code-completion-at=%s:61:16 %s | FileCheck -check-prefix=CHECK-CC3 %s
+// RUN: c-index-test -code-completion-at=%s:61:17 %s | FileCheck -check-prefix=CHECK-CC3 %s
 // CHECK-CC3: ObjCClassMethodDecl:{ResultType int}{TypedText MyClassMethod:}{Placeholder (id)}
 // CHECK-CC3: ObjCClassMethodDecl:{ResultType int}{TypedText MyPrivateMethod}
-// RUN: c-index-test -code-completion-at=%s:65:16 %s | FileCheck -check-prefix=CHECK-CC4 %s
+// RUN: c-index-test -code-completion-at=%s:65:17 %s | FileCheck -check-prefix=CHECK-CC4 %s
 // CHECK-CC4: ObjCInstanceMethodDecl:{ResultType int}{TypedText MyInstMethod:}{Placeholder (id)}{HorizontalSpace  }{TypedText second:}{Placeholder (id)}
 // CHECK-CC4: ObjCInstanceMethodDecl:{ResultType int}{TypedText MyPrivateInstMethod}
-// RUN: c-index-test -code-completion-at=%s:74:9 %s | FileCheck -check-prefix=CHECK-CC5 %s
+// RUN: c-index-test -code-completion-at=%s:74:10 %s | 

Re: [PATCH] D17820: Clang Code Completion Filtering

2016-03-02 Thread Argyrios Kyrtzidis via cfe-commits
akyrtzi added a comment.

In http://reviews.llvm.org/D17820#366638, @milianw wrote:

> But, we currently always request code completion at a word start boundary so 
> nothing would change for us. That said, I see how this patch could be seen as 
> a breaking behavior change, and thus should probably only get enabled by an 
> explicit option - if at all.


I actually think it is fine changing it so clang code-completion automatically 
adjusts to word boundary, I cannot think of a case where it is useful to not do 
that, or being aware of a client that does not already adjusts anyway.


Repository:
  rL LLVM

http://reviews.llvm.org/D17820



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D17820: Clang Code Completion Filtering

2016-03-02 Thread Milian Wolff via cfe-commits
milianw added a comment.

@akyrtzi raises a very valid point - I did not think about that. KDevelop uses 
the clang-c API and does fuzzy matching on top of the results, e.g. for 
camel-case matching. But, we currently always request code completion at a word 
start boundary so nothing would change for us. That said, I see how this patch 
could be seen as a breaking behavior change, and thus should probably only get 
enabled by an explicit option - if at all.


Repository:
  rL LLVM

http://reviews.llvm.org/D17820



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D17820: Clang Code Completion Filtering

2016-03-02 Thread Milian Wolff via cfe-commits
milianw added a subscriber: milianw.
milianw added a comment.

I'm not yet acquainted enough with the code at hand, but I wonder whether I'm 
understanding the code correctly:

Could it be that you only filter before printing to the output stream? The 
other consumers, e.g. the one used by the clang-c API function 
clang_codeCompleteAt is thus not affected? That would be a shame, imo. This 
functionality should also be applied there, don't you think?


Repository:
  rL LLVM

http://reviews.llvm.org/D17820



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D17820: Clang Code Completion Filtering

2016-03-02 Thread Argyrios Kyrtzidis via cfe-commits
akyrtzi added a comment.

We should not bake-in filtering into the clang CodeComplete API. What kind of 
filtering to use should be on a higher level, different clients may want 
different filtering, e.g. prefix filtering, fuzzy filtering, etc.


Repository:
  rL LLVM

http://reviews.llvm.org/D17820



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits