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
- Repository
- rC Clang
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 | ||
|---|---|---|
| 85 | s/string/index | |
| 88 | Currently there is not more, so I would avoid the "etc.". | |
| 92 | s/tokens/token | |
| 93 |
| |
| 95 | Please avoid double negation. | |
| 97 | s/editors/clients/ | |
| 98 | Do you mean replacement_range instead of RemoveRange? | |
| 113 | The vec_ptr-> example should go to its own line. | |
| 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 | ||
| 41 | Keep terminology of the API - s/CORRECTIONS/FIXITS | |
Address review comments
| include/clang-c/Index.h | ||
|---|---|---|
| 88 | It might change without Index.h being updated. | |
| 93 | '\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?) | |
| 98 | Yes, it's repalcement_range here | |
| 113 | I've fixed it the same way it's done in CodeCompleteConsumer.h | |
| include/clang-c/Index.h | ||
|---|---|---|
| 85 | Indicate that calling this makes only sense if CXCodeComplete_IncludeFixIts was set. | |
| 86 | "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". | |
| 90 | Suggestion: CXCodeComplete_IncludeCompletionsWithFixIts | |
| 93 | Still \param and \returns are useful since there the range is an output argument. | |
| 95 | Clarify that you refer to clang_codeCompleteAt here. Suggestion: By default, clang_codeCompleteAt().... | |
| 97 | Add empty line before "For the client..." for readability. | |
| 98 | ...of the cursor after applying the fixits | |
| 106 | new line | |
| 110 | new line | |
| 112 | "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.
s/string/index