ilya-biryukov added a comment.

Sorry for not getting back on this earlier.

I wanted to discuss whether returning correction as a enum value is a proper 
interface for users of `libclang`.
It seems easy to replace `.` with `->` inside clang, properly handling all the 
tricky cases (tokens coming from macro substitution, etc)  and making sure it's 
a viable option (again, macro substitutions may make it non-viable).
And even though it's not hard to implement things like "replace . with ->" for 
any particular editor, we still need to do that for **every** small correction 
that may we want to add to the completion in **every** editor.

I propose to return something similar to a `FixItHint` from `Diagnostic.h`, 
i.e. description of a simple text edit that should be applied before inserting 
the completion identifier. In that case, we may hope that every editor will 
implement the corrections once, and we could add more features into code 
completions that will be immediately picked up by all the editors that support 
it.
WDYT?


https://reviews.llvm.org/D41537



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to