haskell / haskell/haskell-mode

Local symbol rename

Open
#829 0 comments 0 reactions 0 assignees View on GitHub
well-defined-task
Dominant language
Emacs Lisp
Stars
1.4k
Forks
354
Avg merge
5d 10h
Merged PRs (30d)
2

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)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.