[PATCH] D17820: Clang Code Completion Filtering

Bianca-Cristina Cristescu via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 23 05:58:23 PDT 2016


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<TAB> will only give completions for variables like constVar,
and if you have const<SPACE><TAB> 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17820.51404.patch
Type: text/x-patch
Size: 12813 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160323/dd69cb5f/attachment-0001.bin>


More information about the cfe-commits mailing list