mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-02 03:12:20 +00:00
Correctly format abilities with comments
This commit is contained in:
parent
f145610be0
commit
f6c21cc933
3 changed files with 54 additions and 9 deletions
|
@ -1257,8 +1257,17 @@ mod ability {
|
|||
IndentLevel::Exact(wanted) if state.column() > wanted => {
|
||||
// This demand is not indented correctly
|
||||
let indent_difference = state.column() as i32 - wanted as i32;
|
||||
|
||||
// We might be trying to parse at EOF, at which case the indent level
|
||||
// will be off, but there is actually nothing left.
|
||||
let progress = if state.has_reached_end() {
|
||||
NoProgress
|
||||
} else {
|
||||
MadeProgress
|
||||
};
|
||||
|
||||
Err((
|
||||
MadeProgress,
|
||||
progress,
|
||||
EAbility::DemandAlignment(indent_difference, state.pos()),
|
||||
initial,
|
||||
))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue