mirror of
https://github.com/RGBCube/alejandra
synced 2025-07-30 12:07:46 +00:00
Merge pull request #143 from kamadorueda/kamadorueda
feat: continue lambda on the same line
This commit is contained in:
commit
81ce4c563f
4 changed files with 63 additions and 33 deletions
13
CHANGELOG.md
13
CHANGELOG.md
|
@ -60,6 +60,19 @@ Types of changes
|
|||
+ {pkgs, ...}:
|
||||
```
|
||||
|
||||
- Pattern matching lambdas now follow the equal sign:
|
||||
```diff
|
||||
- fnLocationRelative =
|
||||
- {
|
||||
- name,
|
||||
- value,
|
||||
- }:
|
||||
+ fnLocationRelative = {
|
||||
+ name,
|
||||
+ value,
|
||||
+ }:
|
||||
```
|
||||
|
||||
## [0.2.0] - 2022-02-17
|
||||
|
||||
### Added
|
||||
|
|
|
@ -65,23 +65,7 @@ pub fn rule(
|
|||
let child = children.get_next().unwrap();
|
||||
match layout {
|
||||
crate::config::Layout::Tall => {
|
||||
if is_pattern_type
|
||||
|| comment
|
||||
|| (matches!(
|
||||
child.element.kind(),
|
||||
rnix::SyntaxKind::NODE_LAMBDA
|
||||
) && matches!(
|
||||
child
|
||||
.element
|
||||
.clone()
|
||||
.into_node()
|
||||
.unwrap()
|
||||
.children()
|
||||
.next()
|
||||
.unwrap()
|
||||
.kind(),
|
||||
rnix::SyntaxKind::NODE_PATTERN
|
||||
))
|
||||
if comment
|
||||
|| !matches!(
|
||||
child.element.kind(),
|
||||
rnix::SyntaxKind::NODE_ATTR_SET
|
||||
|
|
|
@ -16,4 +16,21 @@
|
|||
{ }:
|
||||
a: b: c:
|
||||
a)
|
||||
|
||||
({pkgs, ...}: {
|
||||
# Stuff
|
||||
})
|
||||
|
||||
({pkgs, ...}: let
|
||||
in pkgs)
|
||||
|
||||
(a: {b,
|
||||
...}: c: {
|
||||
# Stuff
|
||||
})
|
||||
|
||||
(a: {b, c,
|
||||
...}: d: {
|
||||
# Stuff
|
||||
})
|
||||
]
|
||||
|
|
|
@ -4,18 +4,16 @@
|
|||
c
|
||||
*/
|
||||
d)
|
||||
({}:
|
||||
b:
|
||||
/*
|
||||
c
|
||||
*/
|
||||
d)
|
||||
(a:
|
||||
{}:
|
||||
/*
|
||||
c
|
||||
*/
|
||||
d)
|
||||
({}: b:
|
||||
/*
|
||||
c
|
||||
*/
|
||||
d)
|
||||
(a: {}:
|
||||
/*
|
||||
c
|
||||
*/
|
||||
d)
|
||||
(a: d)
|
||||
(a:
|
||||
/*
|
||||
|
@ -48,8 +46,26 @@
|
|||
locationsXml,
|
||||
}:
|
||||
null)
|
||||
(a: b: c:
|
||||
{}:
|
||||
a: b: c:
|
||||
a)
|
||||
(a: b: c: {}: a: b: c:
|
||||
a)
|
||||
|
||||
({pkgs, ...}: {
|
||||
# Stuff
|
||||
})
|
||||
|
||||
({pkgs, ...}: let
|
||||
in
|
||||
pkgs)
|
||||
|
||||
(a: {b, ...}: c: {
|
||||
# Stuff
|
||||
})
|
||||
|
||||
(a: {
|
||||
b,
|
||||
c,
|
||||
...
|
||||
}: d: {
|
||||
# Stuff
|
||||
})
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue