Open
Description
Implement functionality to rename a symbol in region, by default a single function definition.
This should adjust indentation as needed so that the program parses the same before and after.
All instances of the symbol should be renamed, even if those define different variables (so no need to fully analyze binding scopes).
Case to watch out for (everywhere rename h
to helper
).
Adjust layout-rule:
x = h $ do print 123
print 456
Adjust double layout-rule:
x = h # do withX $ do print 123
print 456
print 789
We might want to also preserve indentation for lists, tuples and records:
x = h [ 123
, 456
]
Qualified symbols should not be confused:
x = h $ (Text.Html.h "xxx")
It is ok to confuse scopes:
x :: forall h . h -> Int
x h = h (let h = 123 in f h)