Closed frantisekhanzlikbl closed 1 year ago
Currently, it follow the order of assignment, one first writes the name of the variable before assigning it to a value. Lets see if anyone is interested in setting it this way by default.
Currently, it follow the order of assignment, one first writes the name of the variable before assigning it to a value. Lets see if anyone is interested in setting it this way by default.
I'm not sure that I understand you correctly. Do you mean that you mean that people first write the part after in
and only then the part between let
and in
? If that's the case, I wouldn't mind switching the $0
and $1
either. The important part for me is that I get to have the cursor in both of those places at some point, and that I don't have to hunt in{
all over my codebase all the time.
is there anything else I should change before this can move forward?
LGTM, Thanks @frantisekhanzlikbl !
This may be pretty subjective, but as a long time user of this extension, the built-in snippets for
let
andwith
are pretty annoying in that they don't add a space to the end of the expansion and don't move the cursor there.I believe there are two common use cases for the snippets, both of which are not very pleasant with the current version:
... which gets expanded to
... to which I add my desired bindings. Now I want to continue after the
in
, but I can't without manually moving my cursor there.... which gets expanded to
... to which I add my desired bindings. Now I have to move after the
in
and add a space, so the code looks nice. (yeah, this is kinda a job for a formatter, but I'm not satisfied with any of the currently available for nix)Pretty much the same applies to
with
.The proposed fix makes both of these use cases much more pleasant without being too annoying for any other. The only degradation I can think of is for people who like to keep the
in
/with
on separate lines and don't have trailing whitespace trimming on, who would now have to delete the space manually. Still, that is just one extra keypress, so it's probably not too bad.