3 ms·
What are hypothetical benefits of using this versus Webstorm/Intellij with Vim mode?
by sesm 5y ago
What are hypothetical benefits of using this versus Webstorm/Intellij with Vim mode?
- gushogg-blake 5y agoOne example would be turning a group of statements "xyz" into "if (some condition) then xyz, else (something else)" - with a text editing interface you have to think a bit about the exact text selection you want (or enter visual mode in vi to get the lines), cut them, write the if statement, paste them in, and usually some reformatting, whereas with Tree mode (the dedicated mode for expressing meaningful edits to the code) you can do Esc-w for "wrap", type the if statement, and insert the original statements from a dedicated clipboard. Other cases are similar, e.g. being able to just drag and drop a div into another div without thinking about the exact text selection - the benefit is having to think slightly less about the mechanics of your editor or the particular data structure (text or ASTs).
- sesm 5y agoThanks for explanation! I think for the first case there is a ‘wrap in if-else’ refactoring in Webstorm/Intellij, but I rarely use it. Second case is interesting, I would be excited to have this for React components.
- RyEgswuCsn 5y agoIsn't this what the Intellij/Eclispe IDEs have been doing since the very beginning? All the powerful refactoring features are based on AST manipulation.
- gushogg-blake 5y agoYes, sort of, but they've always been added on top of a standard text editing interface so tend to be behind context menus (which is OK as they're also often high-level refactorings that aren't used that often). Treefrog's structure-aware edits are lower-level and more deeply integrated into the editing interface - there's a whole mode dedicated to them where the mouse and keyboard behave differently. The aim is to design an intuitive editing interface; the AST itself is just one tool to help with that.