haskell / haskell/haskell-language-server

Enhance simple eval plugin to allow evaluating within scope of functions

Đang mở
#368 2 bình luận 4 reaction 0 người được giao Xem trên GitHub
component: hls-eval-plugin type: enhancement
Ngôn ngữ chính
Haskell
Star
3k
Fork
455
Merge trung bình
2 ngày 19 giờ
Pull request đã merge (30 ngày)
11

Mô tả

Given this:

```haskell
main = do
let name = "codygman"
-- >>> name
in pure ()
```

I'd want the evaluation of name to work resulting in:

```haskell
main = do
let name = "codygman"
-- >>> name
-- codygman
in pure ()
```

This would require bringing all bindings up to that point into scope. Typically I copy paste definitions in ghci like:

```
> let name = "codygman"
> name
```

I can see how this could be complex and have some edge cases, but the value of it would be immense especially for new Haskell users.

In fact this request comes because I was making an intro video "0 to Haskell ide in 5 minutes" type video and this feature was going to be the sort of centerpoint/ending to that video.

This would allow not really needing to use anything but haskell-language-server for development as well instead of having to open ghci for many cases. Regardless of whether that's always better, I think it's a good option to have.

I think this might be blocked or more difficult to implement if the current implementation isn't using `-fexternal-interpreter` as described [here](https://github.com/haskell/haskell-ide-engine/issues/1257).

related: #94 #191 #51

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.