[PATCH] D46862: [libclang] Optionally add code completion results for arrow instead of dot

Ivan Donchevskii via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 29 23:32:08 PDT 2018


yvvan added inline comments.


================
Comment at: include/clang-c/Index.h:5264
+ * FixIts that *must* be applied before inserting the text for the
+ * corresponding completion item.
+ *
----------------
nik wrote:
> * Please use proper documentation style, e.g. make use of "\brief", "\param", "\returns". Currently one has to somewhat guess that the returned string is related to the replacement_range parameter.
> 
> * Is this a behavior change now? What happens to old code not aware of this function?
'\brief' is not used anymore.

> Is this a behavior change now?

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?)


================
Comment at: include/clang-c/Index.h:5269
+ * the editors to be able to compute position of the cursor for the completion
+ * item itself, the following conditions are guaranteed to hold for RemoveRange
+ * of the stored fixits:
----------------
nik wrote:
> Do you mean replacement_range instead of RemoveRange?
Yes, it's repalcement_range here


================
Comment at: include/clang-c/Index.h:5284
+ *      vec_ptr.^  // completion returns an item 'push_back', replacing '.'
+ *      with '->' vec_ptr->^ // completion returns an item 'release',
+ *      replacing '->' with '.'
----------------
nik wrote:
> The vec_ptr-> example should go to its own line.
I've fixed it the same way it's done in CodeCompleteConsumer.h


================
Comment at: include/clang-c/Index.h:5326
+   * Whether to include completion items with small
+   * fix-its, e.g. change '.' to '->' on member access, etc.
+   */
----------------
nik wrote:
> Currently there is not more, so I would avoid the "etc.".
It might change without Index.h being updated.


https://reviews.llvm.org/D46862





More information about the cfe-commits mailing list