Follow up for https://reviews.llvm.org/D41537 - libclang part is extracted into this review
ilya-biryukov klimek bkramer arphaman nik
- rG3957e48a68d1: [libclang] Optionally add code completion results for arrow instead of dot
rL334593: [libclang] Optionally add code completion results for arrow instead of dot
rC334593: [libclang] Optionally add code completion results for arrow instead of dot
Generates build errors here:
In file included from /d2/llvm/qtc/source/tools/clang/tools/c-index-test/c-index-test.c:4:0:
/d2/llvm/qtc/source/tools/clang/include/clang-c/Index.h:1332:62: warning: comma at end of enumerator list [-Wpedantic]
/d2/llvm/qtc/source/tools/clang/tools/c-index-test/c-index-test.c: In function 'tokens_spelling_at_range':
/d2/llvm/qtc/source/tools/clang/tools/c-index-test/c-index-test.c:2263:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
/d2/llvm/qtc/source/tools/clang/tools/c-index-test/c-index-test.c:2263:3: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
/d2/llvm/qtc/source/tools/clang/tools/c-index-test/c-index-test.c: In function 'print_completion_result':
/d2/llvm/qtc/source/tools/clang/tools/c-index-test/c-index-test.c:2365:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
At top level:
/d2/llvm/qtc/source/tools/clang/tools/c-index-test/c-index-test.c:2257:13: warning: 'tokens_spelling_at_range' defined but not used [-Wunused-function]
Please avoid double negation.
Do you mean replacement_range instead of RemoveRange?
The vec_ptr-> example should go to its own line.
Currently there is not more, so I would avoid the "etc.".
That's pretty verbose, consider to use wildcards/regexes instead just checking for "requires fix-it:".
Keep terminology of the API - s/CORRECTIONS/FIXITS
Address review comments
'\brief' is not used anymore.
No, without CXCodeComplete_IncludeFixIts set you won't event have extra completions. And existing ones won't get any fix-its (because why would they?)
Yes, it's repalcement_range here
I've fixed it the same way it's done in CodeCompleteConsumer.h
It might change without Index.h being updated.
"Tokenize the source code" sounds as if more than one token will be handled.
Suggestion: Reduce to "Get the raw lexical token starting with the given location".
Indicate that calling this makes only sense if CXCodeComplete_IncludeFixIts was set.
Still \param and \returns are useful since there the range is an output argument.
Clarify that you refer to clang_codeCompleteAt here.
Suggestion: By default, clang_codeCompleteAt()....
Add empty line before "For the client..." for readability.
...of the cursor after applying the fixits
"one of the ...", same below.
- Sometimes you refer to "fixits", sometimes "fix-its" and some times "FixIts". Unify to what is already there.
- The term "completion items" is new so far. Use "completions" for consistency.