Skip to content

Commit

Permalink
fix: infinite loop when installing new function
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusfpleite committed Jun 18, 2024
1 parent 211ad0e commit 3da46dc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Install/Function.elm
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,14 @@ declarationVisitor context (Config config) declaration =
(Install.Library.getExpressionFromString context confg.functionImplementation)
== Just Normalize.ConfirmedEquality
|> not

isImplemented =
not (isNotImplemented function config)
in
if name == config.functionName && isInCorrectModule && isNotImplemented function config then
if isImplemented then
( [], { contextWithLastDeclarationRange | appliedFix = True } )

else if name == config.functionName && isInCorrectModule && isNotImplemented function config then
replaceFunction { range = Node.range declaration, functionName = config.functionName, functionImplementation = config.functionImplementation } context

else
Expand Down

0 comments on commit 3da46dc

Please sign in to comment.