[PATCH] D65263: [clangd] a prototype for triggering rename after extracting.

2019-07-31 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. In D65263#1606371 , @hokein wrote: > I agree that doing rename after extraction is not an ideal approach (both > correctness and latency), there should be other better ways to achieve this. > However as a LSP server, we

[PATCH] D65263: [clangd] a prototype for triggering rename after extracting.

2019-07-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. The patch is still missing tests, but should be good for early comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65263/new/ https://reviews.llvm.org/D65263 ___

[PATCH] D65263: [clangd] a prototype for triggering rename after extracting.

2019-07-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D65263#1601036 , @ilya-biryukov wrote: > If we are going down that path, could we consider to pre-selecting a name of > the extract variable and its usage (using multi-select)? I agree that doing rename after extraction is

[PATCH] D65263: [clangd] a prototype for triggering rename after extracting.

2019-07-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 212347. hokein added a comment. update the diff Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65263/new/ https://reviews.llvm.org/D65263 Files: clang-tools-extra/clangd/ClangdLSPServer.cpp

[PATCH] D65263: [clangd] a prototype for triggering rename after extracting.

2019-07-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 212345. hokein edited the summary of this revision. hokein added a comment. reimplement the mechanism based on the offline discussion. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65263/new/

[PATCH] D65263: [clangd] a prototype for triggering rename after extracting.

2019-07-25 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. If we are going down that path, could we consider to pre-selecting a name of the extract variable and its usage (using multi-select)? I.e. the optimal workflow seems to be (`[[code]] marks selected regions`): // Input: foo([[10+10]]); // 'extract'

[PATCH] D65263: [clangd] a prototype for triggering rename after extracting.

2019-07-25 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked 4 inline comments as done. hokein added inline comments. Comment at: clang-tools-extra/clangd/Protocol.h:777 + // each command has a certain llvm::Optional structure for its arguments. + llvm::Optional renamePosition; // for LSP_RENAME +};

[PATCH] D65263: [clangd] a prototype for triggering rename after extracting.

2019-07-25 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. This is really cool! Hm, formatting is troublesome, well spotted :-) As you're defining a generic mechanism, it'd be useful to have more examples to verify that this actually generalizes. We might have to make them up (e.g.

[PATCH] D65263: [clangd] a prototype for triggering rename after extracting.

2019-07-25 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov. Herald added a project: clang. This is a prototype patch. LSP doesn't have support for asking user input currently. Other language servers (Typescript, Java) will trigger