haskell / haskell/haskell-language-server
Implement some of VSC's Java CodeActions
- Dominant language
- Haskell
- Stars
- 3k
- Forks
- 455
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 11
Description
Full list here: https://code.visualstudio.com/docs/java/java-refactoring
A couple ideas listed below...
----------------------
https://code.visualstudio.com/docs/java/java-refactoring#_invert-conditions
```java
// Before
public void method(int value) {
if (value > 5 && value < 15) {
// do something
}
}
// After
public void method(int value) {
if (value <= 5 || value >= 15) {
// do something
}
}
```
Or also a "flip if branches" action:
```Haskell
-- Before
if bool then tBranch else fBranch
-- After
if not bool then fBranch else tBranch
```
-----------------
https://code.visualstudio.com/docs/java/java-refactoring#_generate-constructors
We could have a code action for "create smart constructor template", which is a pretty common boilerplate in Haskell...
```
-- Before
data Foo = Foo {f1 :: Int, f2 :: Bool}
-- After
data Foo = Foo {f1 :: Int, f2 :: Bool}
mkFoo :: Int -> Bool -> Foo
mkFoo f1 f2 = _
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.