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

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 19 08:48:32 PDT 2018


ilya-biryukov added a comment.

Sorry for the delay.



================
Comment at: include/clang/Sema/CodeCompleteConsumer.h:565
+  /// \brief For this completion result correction is required.
+  Optional<std::string> Corr = None;
+
----------------
Having a string replacement without an actual range to replace still moves a lot of responsibility onto the clients. We should probably model corrections after the fix-its for diagnostics:
- replacements need to provide a range to be replaced, alongside with a text for the replacement,
- we should provide a list of edits to allow corrections that touch two separate pieces of code.

For the fix-its in the diagnostics, see [[https://reviews.llvm.org/source/clang/browse/cfe/trunk/tools/libclang/CXLoadedDiagnostic.h;327861$84 | CXLoadedDiagnostic.h]] for an interface exported via libclang and [[https://reviews.llvm.org/source/clang/browse/cfe/trunk/include/clang/Basic/Diagnostic.h;327861$947|Diagnostic.h]] for an interface exported in C++ API.
WDYT?


https://reviews.llvm.org/D41537





More information about the cfe-commits mailing list