haskell / haskell/haskell-language-server

Suggestions or actions to use type synonyms

未关闭
#506 5 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看
type: enhancement
主要语言
Haskell
星标
3k
派生
455
平均合并
2 天 19 小时
30 天内合并 PR
11

描述

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)

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。