Follow up for https://reviews.llvm.org/D41537 - libclang part is extracted into this review
Details
- Reviewers
ilya-biryukov klimek bkramer arphaman nik - Commits
- 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
Diff Detail
Event Timeline
Output range of token being replaced instead of it's text
As a side-effect introduce a call to get a Token starting from specified location.
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]
include/clang-c/Index.h | ||
---|---|---|
4753 | s/tokens/token | |
5256 | s/string/index | |
5264 |
| |
5266 | Please avoid double negation. | |
5268 | s/editors/clients/ | |
5269 | Do you mean replacement_range instead of RemoveRange? | |
5284 | The vec_ptr-> example should go to its own line. | |
5326 | Currently there is not more, so I would avoid the "etc.". | |
test/Index/complete-arrow-dot.cpp | ||
21 | That's pretty verbose, consider to use wildcards/regexes instead just checking for "requires fix-it:". | |
tools/c-index-test/c-index-test.c | ||
2478 | Keep terminology of the API - s/CORRECTIONS/FIXITS |
Address review comments
include/clang-c/Index.h | ||
---|---|---|
5264 | '\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?) | |
5269 | Yes, it's repalcement_range here | |
5284 | I've fixed it the same way it's done in CodeCompleteConsumer.h | |
5326 | It might change without Index.h being updated. |
include/clang-c/Index.h | ||
---|---|---|
4747 | "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". | |
5256 | Indicate that calling this makes only sense if CXCodeComplete_IncludeFixIts was set. | |
5264 | Still \param and \returns are useful since there the range is an output argument. | |
5266 | Clarify that you refer to clang_codeCompleteAt here. Suggestion: By default, clang_codeCompleteAt().... | |
5268 | Add empty line before "For the client..." for readability. | |
5269 | ...of the cursor after applying the fixits | |
5277 | new line | |
5281 | new line | |
5283 | "one of the ...", same below. | |
5328 | Suggestion: CXCodeComplete_IncludeCompletionsWithFixIts |
- 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.
"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".