Implement Split Multiple Declarations Refactoring#241
Implement Split Multiple Declarations Refactoring#241nicoespeon merged 16 commits intonicoespeon:masterfrom iulspop:split-multiple-declarations
Conversation
The 'simplifyTernary' import position wasn't alphabetical and inconsistent with the 'withActionProvider' list where 'simplifyTernary' is in correct order. This change fixed the position.
|
Is there anything else I should add to the pull request description? |
|
@iulspop it's perfect! Thank you for the PR, I'll review it this week 👍 |
nicoespeon
left a comment
There was a problem hiding this comment.
Everything looks great. Thanks for adding the docs and all these tests 👍
|
|
||
| > 💡 Available as Quick Fix (`Alt ↵`) | ||
|
|
||
| Splits multiple variables declarated together onto a single line each. |
There was a problem hiding this comment.
👍 Very great, thanks for adding docs too
| }, | ||
| { | ||
| "command": "abracadabra.splitMultipleDeclarations", | ||
| "when": "editorLangId == vue" |
There was a problem hiding this comment.
👍 Looks good. I agree that this part is a bit tricky and requires a lot of boilerplate. We'll eventually automate this so it's less error-prone.
| import removeRedundantElse from "./refactorings/remove-redundant-else"; | ||
| import renameSymbol from "./refactorings/rename-symbol"; | ||
| import replaceBinaryWithAssignment from "./refactorings/replace-binary-with-assignment"; | ||
| import simplifyTernary from "./refactorings/simplify-ternary"; |
There was a problem hiding this comment.
👍 Thanks for re-ordering this one
| "typescript multiple declarations split conserves type annotations", | ||
| code: `let firstName: string = 'John', age: number = 7`, | ||
| expected: `let firstName: string = 'John'; | ||
| let age: number = 7;` |
There was a problem hiding this comment.
👍 Perfect, you covered a lot of cases here!
|
@allcontributors please add iulspop for code, doc |
|
I've put up a pull request to add @iulspop! 🎉 |
Closes #130
Implemented the split multiple declarations refactoring.
Type annotations are preserved correctly for Typescript.
I'm not sure if the additions to the
package.jsonare correct