Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Move Statements UX #58

Closed
4 of 5 tasks
nicoespeon opened this issue Dec 13, 2019 · 1 comment
Closed
4 of 5 tasks

Improve Move Statements UX #58

nicoespeon opened this issue Dec 13, 2019 · 1 comment
Assignees
Labels
💪 Improvement Refactoring doesn't run on a specific case or result could be optimized

Comments

@nicoespeon
Copy link
Owner

nicoespeon commented Dec 13, 2019

Describe what's missing

The current UX of "Move Statements" refactorings is not as good as I'd expect.

Few things that needs to be improved:

  • On some patterns, the refactoring would add unexpected blank spaces. That's the case when we move objects / classes attributes or methods.
  • The refactoring bubbles up to the parent, and that's sometimes unexpected. For example, if we move down a method of a class it will move the whole class down if we reach the end and the method can't be moved down anymore => the command bubbled up to the whole class, and that was not expected
  • Overall, moving statements should feel fluid and the scrolling should follow accordingly

Expected behavior

Webstorm does it very well. What I want is to feel the same comfort in moving statements within VS Code, thanks to Abracadabra.

Let's do some usability tests (e.g. try to move statements on some patterns and see if it doesn't feel perfect) and fix the issues.

I'll close the issue when I feel Move Statements UX is so good that I would only use that to move things up and down.

To Do

After playing with current implementation, here are the things we want to improve:

  • block scope (don't move parent!)
  • only scroll when it's necessary
  • Arrays, just like object properties
  • fix cursor position after moving statement (fix the edge cases: comments, blank spaces, methods, functions, etc.)
  • refactor duplication between slide up and slide down I didn't find the correct abstraction yet, so I'll keep it like that
@nicoespeon nicoespeon added the 💪 Improvement Refactoring doesn't run on a specific case or result could be optimized label Dec 13, 2019
@nicoespeon
Copy link
Owner Author

We gave Move Statements enough love for the moment. Let's see how it feels in practice and iterate on the edge cases.

I'll ship a release soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💪 Improvement Refactoring doesn't run on a specific case or result could be optimized
Projects
None yet
Development

No branches or pull requests

2 participants