haskell / haskell/haskell-language-server

Suggestions or actions to use type synonyms

Đang mở
#506 5 bình luận 2 reaction 0 người được giao Xem trên GitHub
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ả

It would perhaps be nice if HLS suggested using in scope type synonyms sometimes.

To make an example using the `hnix` package: if I use the excellent code action `Define funArity :: Fix (Compose (Ann SrcSpan) NExprF) -> Int` I end up with the unhuman given type sig, when `funArity :: NExprLoc -> Int` would be much nicer.

It's probably quite hard to come up with the perfect rule here, but how do people feel about a heuristic along the lines of:

- The sig is in scope
- The types are equal
- Using the synonym is much shorter

(Better but more difficult would be to calculate the preference in existing code (user and library) between the synonym and the expanded version)

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.