summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/refactor/tweaks
Commit message (Collapse)AuthorAgeFilesLines
...
* [clangd] Update a stale comment, NFC.Haojian Wu2019-07-241-1/+1
| | | | llvm-svn: 366875
* [Clangd] Fixed ExtractVariable for certain types of ExprsShaurya Gupta2019-07-241-27/+84
| | | | | | | | | | | | | | | | | | Summary: - Modified ExtractVariable for extraction of MemberExpr, DeclRefExpr and Assignment Expr - Removed extraction from label statements. - Fixed unittests Reviewers: sammccall, kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64717 llvm-svn: 366869
* [Clangd] NFC: Fixed tweaks CMakeLists order to alphabeticalShaurya Gupta2019-07-181-2/+2
| | | | llvm-svn: 366452
* [Clangd] Changed ExtractVariable to only work on non empty selectionsShaurya Gupta2019-07-181-1/+2
| | | | | | | | | | | | | | | | Summary: - For now, we don't trigger in any case if it's an empty selection - Fixed unittests Reviewers: kadircet, sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64912 llvm-svn: 366451
* [clangd] Disable DumpRecordLayout by default per ↵Sam McCall2019-07-181-0/+5
| | | | | | https://bugs.llvm.org/show_bug.cgi?id=42670 llvm-svn: 366443
* [clangd] Move the expandAuto tweak from global namespace into annoymous ↵Haojian Wu2019-07-121-1/+3
| | | | | | namespace. llvm-svn: 365885
* [clangd] Implementation of auto type expansion.Sam McCall2019-07-112-0/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add a tweak for clangd to replace an auto keyword to the deduced type. This way a user can declare something with auto and then have the IDE/clangd replace auto with whatever type clangd thinks it is. In case of long/complext types this makes is reduces writing effort for the user. The functionality is similar to the hover over the auto keyword. Example (from the header): ``` /// Before: /// auto x = Something(); /// ^^^^ /// After: /// MyClass x = Something(); /// ^^^^^^^ ``` Patch by kuhnel! (Christian Kühnel) Differential Revision: https://reviews.llvm.org/D62855 llvm-svn: 365792
* [clangd] Fix an assertion crash in "ExtractVariable" tweakHaojian Wu2019-07-111-1/+1
| | | | | | | | | | | | | | | | Summary: GetTypePtr requires that the type should not be null, otherwise we hit an assertion, we should use getTypePtrOrNull instead. Reviewers: sammccall, SureYeaah Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64556 llvm-svn: 365763
* Fixed assertionShaurya Gupta2019-07-091-1/+1
| | | | llvm-svn: 365460
* dummy variable extraction on a function scopeShaurya Gupta2019-07-092-0/+244
| | | | | | | | | | | | | | | | | | | Summary: - Added extraction to a dummy variable - using auto for the dummy variable type for now - Works on a function scope - Adding braces to create a compound statement not supported yet - added unit tests Reviewers: sammccall, kadircet Subscribers: mgorny, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63773 llvm-svn: 365453
* [clangd] A code tweak to expand a macroIlya Biryukov2019-07-082-0/+138
| | | | | | | | | | | | | | Reviewers: sammccall Reviewed By: sammccall Subscribers: mgorny, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61681 llvm-svn: 365331
* [clangd] Some tweaks on semantic highlighting lookuptable.Haojian Wu2019-07-041-9/+0
| | | | | | | | | | | | | | | | Summary: - move toTextMateScope to SemanticHighlighting.h; - move the buildLookupTable to LSP layer (as LSP requires such form); Reviewers: sammccall, jvikstrom Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64202 llvm-svn: 365135
* [clangd] Add a hidden tweak to annotate all highlighting tokens of the file.Haojian Wu2019-07-042-0/+83
| | | | | | | | | | | | Reviewers: sammccall, jvikstrom Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64137 llvm-svn: 365130
* [clangd] Remove the extra ";", NFCHaojian Wu2019-06-181-2/+2
| | | | llvm-svn: 363681
* [clangd] Add hidden tweaks to dump AST/selection.Sam McCall2019-06-184-14/+151
| | | | | | | | | | | | | | | | | | | | | | | Summary: This introduces a few new concepts: - tweaks have an Intent (they don't all advertise as refactorings) - tweaks may produce messages (for ShowMessage notification). Generalized Replacements -> Effect. - tweaks (and other features) may be hidden (clangd -hidden-features flag). We may choose to promote these one day. I'm not sure they're worth their own feature flags though. Verified it in vim-clangd (not yet open source), curious if the UI is ok in VSCode. Reviewers: ilya-biryukov Subscribers: mgorny, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62538 llvm-svn: 363680
* Test commitShaurya Gupta2019-06-141-1/+0
| | | | llvm-svn: 363365
* [clangd] Add SourceManager accessor to ParsedAST. NFCSam McCall2019-05-282-4/+3
| | | | llvm-svn: 361883
* [clangd] tweaks: Add clangBasic dependency to LINK_LIBSHeejin Ahn2019-05-251-0/+1
| | | | | | This is necessary to make builds with `-DBUILD_SHARED_LIBS=ON` work. llvm-svn: 361687
* [clangd] Add tweak to convert normal to raw string literal, when it contains ↵Sam McCall2019-05-212-0/+104
| | | | | | | | | | | | | | escapes. Reviewers: ilya-biryukov Subscribers: mgorny, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62151 llvm-svn: 361252
* gn build: Add some build files for clangdNico Weber2019-03-281-2/+2
| | | | | | | | | | | | | | Enough to build the clangd binaries, but this is still missing build files for: - fuzzer - indexer - index/dex/dexp - benchmarks - xpc Differential Revision: https://reviews.llvm.org/D59899 llvm-svn: 357182
* Revamp the "[clangd] Format tweak's replacements"Haojian Wu2019-02-111-5/+2
| | | | | | | | | | | | | | | | | | | | Summary: This patch contains two parts: 1) reverts commit r353306. 2) move the format logic out from tweaks, keep tweaks API unchanged. Reviewers: sammccall, ilya-biryukov Reviewed By: ilya-biryukov Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58051 llvm-svn: 353712
* [clangd] Format tweak's replacements.Haojian Wu2019-02-061-2/+5
| | | | llvm-svn: 353306
* Remove trailing semicolon. NFCI.Simon Pilgrim2019-02-031-1/+1
| | | | llvm-svn: 352991
* [clangd] Expose SelectionTree to code tweaks, and use it for swap if branches.Sam McCall2019-02-011-44/+11
| | | | | | | | | | | | | | | | | Summary: This reduces the per-check implementation burden and redundant work. It also makes checks range-aware by default (treating the commonAncestor as if it were a point selection should be good baseline behavior). Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet Tags: #clang Differential Revision: https://reviews.llvm.org/D57570 llvm-svn: 352876
* [clangd] clangDaemonTweaks - fix -DBUILD_SHARED_LIBS=ON buildRoman Lebedev2019-02-011-0/+9
| | | | | | Followup for rL352841. llvm-svn: 352843
* [clangd] Fix crash in applyTweak, remove TweakID alias.Sam McCall2019-02-011-1/+1
| | | | | | | Strings are complicated, giving them opaque names makes us forget they're complicated. llvm-svn: 352837
* [clangd] A code action to swap branches of an if statementIlya Biryukov2019-01-313-11/+133
| | | | | | | | | | | | | | Reviewers: sammccall Reviewed By: sammccall Subscribers: llvm-commits, mgorny, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D56611 llvm-svn: 352796
* [clangd] Interfaces for writing code tweaksIlya Biryukov2019-01-292-0/+22
Summary: The code tweaks are an implementation of mini-refactorings exposed via the LSP code actions. They run in two stages: - Stage 1. Decides whether the action is available to the user and collects all the information required to finish the action. Should be cheap, since this will run over all the actions known to clangd on each textDocument/codeAction request from the client. - Stage 2. Uses information from stage 1 to produce the actual edits that the code action should perform. This stage can be expensive and will only run if the user chooses to perform the specified action in the UI. One unfortunate consequence of this change is increased latency of processing the textDocument/codeAction requests, which now wait for an AST. However, we cannot avoid this with what we have available in the LSP today. Reviewers: kadircet, ioeric, hokein, sammccall Reviewed By: sammccall Subscribers: mgrang, mgorny, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D56267 llvm-svn: 352494
OpenPOWER on IntegriCloud