[PATCH] D70594: [clangd] Implement range patching heuristics for cross-file rename.

2019-12-09 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG891f8bb8: [clangd] Implement range patching heuristics for cross-file rename. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70594/n

[PATCH] D70594: [clangd] Implement range patching heuristics for cross-file rename.

2019-12-09 Thread pre-merge checks [bot] via Phabricator via cfe-commits
merge_guards_bot added a comment. Build result: pass - 60627 tests passed, 0 failed and 726 were skipped. Log files: console-log.txt , CMakeCache.txt

[PATCH] D70594: [clangd] Implement range patching heuristics for cross-file rename.

2019-12-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/refactor/Rename.cpp:569 +// possible +llvm::Expected> +adjustRenameRanges(llvm::StringRef DraftCode, llvm::StringRef Identifier, sammccall wrote: > why returning Expected rather than Opti

[PATCH] D70594: [clangd] Implement range patching heuristics for cross-file rename.

2019-12-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 232844. hokein marked 12 inline comments as done. hokein added a comment. address comments: - don't emit the internal messages to users, llvm::Expected => llvm::Optional - use the index of lexed array to calculate the adjustment cost. Repository: rG LLVM G

[PATCH] D70594: [clangd] Implement range patching heuristics for cross-file rename.

2019-12-09 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/clangd/refactor/Rename.cpp:452 + for (int Pos : MatchedIndex) +Mapped.push_back(Lexed[Pos]); + return MatchedCB(std:

[PATCH] D70594: [clangd] Implement range patching heuristics for cross-file rename.

2019-12-08 Thread pre-merge checks [bot] via Phabricator via cfe-commits
merge_guards_bot added a comment. Build result: pass - 60605 tests passed, 0 failed and 726 were skipped. Log files: console-log.txt , CMakeCache.txt

[PATCH] D70594: [clangd] Implement range patching heuristics for cross-file rename.

2019-12-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 232744. hokein added a comment. some minor fixes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70594/new/ https://reviews.llvm.org/D70594 Files: clang-tools-extra/clangd/refactor/Rename.cpp clang-tools-ext

[PATCH] D70594: [clangd] Implement range patching heuristics for cross-file rename.

2019-12-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/refactor/Rename.cpp:452 + for (int Pos : MatchedIndex) +Mapped.push_back(Lexed[Pos]); + return MatchedCB(std::move(Mapped)); sammccall wrote: > if we're actually evaluating all r

[PATCH] D70594: [clangd] Implement range patching heuristics for cross-file rename.

2019-12-08 Thread pre-merge checks [bot] via Phabricator via cfe-commits
merge_guards_bot added a comment. Build result: pass - 60605 tests passed, 0 failed and 726 were skipped. Log files: console-log.txt , CMakeCache.txt

[PATCH] D70594: [clangd] Implement range patching heuristics for cross-file rename.

2019-12-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 232743. hokein marked 21 inline comments as done. hokein added a comment. address reveiw comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70594/new/ https://reviews.llvm.org/D70594 Files: clang-tools-e

[PATCH] D70594: [clangd] Implement range patching heuristics for cross-file rename.

2019-12-05 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clang-tools-extra/clangd/refactor/Rename.cpp:384 +bool isLineOrColumnEqual(const Position &LHS, const Position &RHS) { + return LHS.line == RHS.line || LHS.character == RHS.character; the name here isn't much simple

[PATCH] D70594: [clangd] Implement range patching heuristics for cross-file rename.

2019-12-04 Thread pre-merge checks [bot] via Phabricator via cfe-commits
merge_guards_bot added a comment. Build result: pass - 60453 tests passed, 0 failed and 726 were skipped. Log files: console-log.txt , CMakeCache.txt

[PATCH] D70594: [clangd] Implement range patching heuristics for cross-file rename.

2019-12-04 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clang-tools-extra/clangd/refactor/Rename.h:95 + /// \p getBest, exposing for testing only. + static MatchType match(llvm::ArrayRef LHS, llvm::ArrayRef RHS); + hokein wrote: > sammccall wrote: > > Oops, forgot this...

[PATCH] D70594: [clangd] Implement range patching heuristics for cross-file rename.

2019-12-04 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 232101. hokein marked 3 inline comments as done. hokein added a comment. address comments - re-define the concept of a near miss - add metric for evaluate how good a near miss is Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://revi

[PATCH] D70594: [clangd] Implement range patching heuristics for cross-file rename.

2019-12-04 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/refactor/Rename.h:95 + /// \p getBest, exposing for testing only. + static MatchType match(llvm::ArrayRef LHS, llvm::ArrayRef RHS); + sammccall wrote: > Oops, forgot this... > I think the public

[PATCH] D70594: [clangd] Implement range patching heuristics for cross-file rename.

2019-12-02 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clang-tools-extra/clangd/refactor/Rename.h:95 + /// \p getBest, exposing for testing only. + static MatchType match(llvm::ArrayRef LHS, llvm::ArrayRef RHS); + Oops, forgot this... I think the public API isn't quite r

[PATCH] D70594: [clangd] Implement range patching heuristics for cross-file rename.

2019-12-02 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. High level comments based on offline discussion: I think we want to define/formalize the concept of a near miss, to make precise the tradeoffs between false positives, false negatives, and implementability. Not just at the individual level (an index occurrence vs a lex

[PATCH] D70594: [clangd] Implement range patching heuristics for cross-file rename.

2019-11-29 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 231541. hokein added a comment. rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70594/new/ https://reviews.llvm.org/D70594 Files: clang-tools-extra/clangd/refactor/Rename.cpp clang-tools-extra/clangd/r

[PATCH] D70594: [clangd] Implement range patching heuristics for cross-file rename.

2019-11-22 Thread pre-merge checks [bot] via Phabricator via cfe-commits
merge_guards_bot added a comment. Build result: FAILURE - Could not check out parent git hash "6171238cb7e9e8616d21ce09d463e945ce0a9fb8". It was not found in the repository. Did you configure the "Parent Revision" in Phabricator properly? Trying to apply the patch to the master branch instead..

[PATCH] D70594: [clangd] Implement range patching heuristics for cross-file rename.

2019-11-22 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added reviewers: sammccall, ilya-biryukov. Herald added subscribers: usaxena95, kadircet, arphaman, mgrang, jkorous, MaskRay. Herald added a project: clang. The heuristic is simple, only for cases we are confident. Repository: rG LLVM Github Monorepo http