[PATCH] D67224: [clangd] Enable completions with fixes in VSCode

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 7 00:36:10 PST 2020


ilya-biryukov added a comment.

In D67224#1804513 <https://reviews.llvm.org/D67224#1804513>, @nridge wrote:

> Just throwing a wild idea out there: what if we used `textDocument/onTypeFormatting` to replace the `.` with `->` as soon as it's typed?


There is no way we can do this with proper latency. `onTypeFormatting` can't wait for the parsing to complete and we need the parsing to complete in order to determine the type of expression to the left of `.` or `->`.
Moreover, in cases like `unique_ptr<T>().` we can't know whether the user wants `.` or `->` before we pick the completion item. Both `.` and `->` are allowed in this context.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67224/new/

https://reviews.llvm.org/D67224





More information about the cfe-commits mailing list