Comments (9)
I don't really have an opinion, I usually press F1 to use a refactoring (I need mouse for quick fixes, and I'm lazy ^^ (and yes, I probably just missed the quickfix shortcut))
To be less opinated, we could add this in the config, so every refactoring can be a quickfix or not. So the user can have the wanted noise that he want.
from abracadabra.
Enabled by default seams reasonable π I will talk about this with @nicoespeon tomorrow π
from abracadabra.
To be honest, current UX was inspired from Webstorm. The rationale is that any variable could be inlined, so that would add a lot of "noise". Instead, it's a first-class refactoring that has a dedicated keyboard shortcut.
I understand the need for discovery though. But I wonder if that's something that wouldn't be too noisy.
What do you think @fabien0102 ? @visusnet ?
from abracadabra.
I understand this reasoning. AndroidStudio doesn't offer it as a Quick Fix (or whatever it's called) either, contrary to what I remember. On the other hand, the split declaration and initialization
refactoring is already provided at each variable declaration, so you'll get a "Show fixes" button anyway.
There's also the Refactoring menu (CTRL + Shift + R) which appears to have slightly different entries. Perhaps it would be more appropriate there. Currently it's not included in there either. I feel that this refactoring should be at least available in the refactoring menu, but I don't know how much control we have about that.
from abracadabra.
@nicoespeon Iβm kinda biased because I have been using IntelliJ for years and I am used to the special binding. I personally would not need it in the quick action menu, however discoverability is a good reason to have it. I generally think that decreasing cognitive load is important for good UX. This includes the number of shortcuts that are necessary in your memory. I would vote for having both, the quick action (mostly for people who donβt have an IDEA bias) and the special keyboard shortcut (for people who are already used to it from other IDEs).
from abracadabra.
@fabien0102 What would the default be? I guess everything should be enabled by default and opt-out for more experienced people.
from abracadabra.
I was thinking about providing a config to disable it too. I also think that will help discoverability indeed.
As Fabien said, we'll discuss that tomorrow. Thanks for your inputs, that's helpful π
from abracadabra.
Hey @automatensalat π
So we dig into this with @fabien0102 and we've decided that we won't do it, but I'm open to PRs to implement that.
The rationale:
- we don't have a strong motivation to do it
- we think it's ok to expect people who install the extension to read the docs and learn the shortcuts (unlike native editor features)
- we understand the benefits it could bring (discoverability)
- it would be OK to propose these as Quick Fixes if we give a boolean option to deactivate that for users who prefer to use the shortcut only
- to make it work, we should first refator the code and it's not a trivial task
- the refactorings should expose an Action Provider, using the
createVisitor()
pattern like the others - there's a bit of added complexity since 2 refactorings are exposed as one ("Inline Variable or Function")
- it's totally do-able, just non-trivial
- the refactorings should expose an Action Provider, using the
- we want to focus on other features like
Therefore, it doesn't worth the effort for us, but I will review and accept a PR that implements it π
In the meantime, I'm closing the issue as I don't expect it to be addressed. If someone wants to tackle it, you can open a draft PR to discuss the details.
from abracadabra.
That's alright. It's just a minor issue and I can see your points. Thanks for thinking about this though π
from abracadabra.
Related Issues (20)
- Automatically "Convert to Template String" if we write ${} in a string HOT 2
- Abracadabra does not play nice with cursorless HOT 29
- Inline variable overwrites unrelated parameter
- New refactoring: Simplify boolean logic HOT 9
- abracadabra renameSymbol not found HOT 6
- Refactorings don't work on a specific .ts file HOT 6
- Extract Variable insert position doesn't right HOT 2
- change activationEvent to onLanguage
- Idea: Migrate to TypeScript plugin HOT 4
- "Change Signature" doesn't work on a nested function HOT 3
- "Add explicit type" refactoring HOT 1
- Inline variable if ternary misses parens HOT 5
- split declaration & init when working inside class
- JS and TS code without `;` is broken after refactoring HOT 3
- Abracadabra extension causes performance issues with other extensions (prettier formatting, etc.) HOT 7
- More inline variable missing parentheses edge-cases HOT 1
- Can't move class to an existing file HOT 2
- Move to new file: configure case of the new filename HOT 3
- Upgrade babel/traverse ti eliminate vulnerability. HOT 1
- Convert to Arrow Function: Does not work with a `export default function` HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from abracadabra.