Releases: nicoespeon/abracadabra
9.4.6
Fixed
- Made Abracadabra parse
<X> y
type assertions on regular TS files. It was failing to handle these as it was considering them as invalid JSX code. It won't break anymore with this syntax.
9.4.5
No user-visible change. Attempting to fix CI deployments with vsce not being compatible with Yarn v4.
9.4.4
No user-visible change. Attempting to fix CI deployments with vsce not being compatible with Yarn v4.
9.4.3
No user-visible change. Attempting to fix CI deployments with vsce not being compatible with Yarn v4.
9.4.2
Fixed
Extracting a variable (Ctrl + Alt + V
/ ⌥ ⌘ V
) while selecting a portion of the value may result in a partial selection when you get to name the extracted variable. Annoying!
Not anymore… The whole identifier is now selected, so you can just write the name right away 😉
Before:
before.mp4
After:
after.mp4
9.4.1
Fixed
The extension stopped working because the tool we are using to package it (esbuild) had a change that was incompatible with our code. The upgrade from 0.19 to 0.22 broke the extension.
Fortunately, that was fixed with esbuild 0.23, and upgrading to this latest version seems to have fixed the build.
Boolean Mine 🐘
Added
- [New Refactoring] "Simplify Boolean" thanks to @ipanasenko suggestion. Some refactorings may left you with logical expressions that look like
someCondition && true
and that can be simplified. This refactoring will take care of figuring out how.
Fixed
- @j4k0xb fixed "Inline Variable" when there was a shadowed parameter involved.
You've Got a Type in Me 🚀
Added
- "Extract Type" can now extract type literals. This is particularly handy when you have such a union type:
type Context =
| { state: "reading"; value: string }
| {
state: "editing";
value: string;
draftValue: string;
};
Put your cursor wherever within { state: "reading"; value: string }
, hit Ctrl+Shift+V (⌘ ⇧ V) and there you have it:
type ReadingContext = { state: "reading"; value: string };
type Context =
| ReadingContext
| {
state: "editing";
value: string;
draftValue: string;
};
The ReadingContext
name was inferred, it it can be. In any case, you are in "rename mode" right away so you can type whatever is better, press Enter, be done.
In action:
extract.types.mp4
9.2.1
Fixed
- The cursorless fix wasn't actually working because the underlying cursor position was mutated. This has been properly fixed and it's now working as expected!
Grim Grinning Literals 👻
Changed
- When triggering a refactoring from a quick fix (the 💡 icon), Abracadabra will use the code and position you were on when the fix was suggested. This should be invisible for most use-case, but will play nicely with extensions like cursorless. Thanks @jaresty for reporting, and @pokey for adding more context 😉
- "Convert to Template String" will now preserve
${}
and${someValue}
as-is, without escaping it. It's technically a bug (= changes the behavior of the code) but usage indicates these are meant to become interpolated variables. So it's more likely to do what you want.