haskell / haskell/haskell-language-server

Add Haddock hyperlinks to hover for type holes

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

I would find it very helpful if the hover information could include links to Haddock documentation (if documentation is available).

A common situation when working with an unfamiliar library is needing to pass an argument to a function say `foo`, and a typical workflow would be to start writing:

```haskell
where
x = foo a b _notsure ( d e )
```

then hover over `_notsure` to find its expected type. Ideally then I'd be able to see the type needed, and be able to click on it for the documentation. For instance:

![hover_hyperlink](https://user-images.githubusercontent.com/1297748/92642531-9e42de80-f2e0-11ea-88c3-8b44c02f1b84.png)

I'd like to be able to open up this documentation:

![gdk_windowhints](https://user-images.githubusercontent.com/1297748/92642659-d518f480-f2e0-11ea-8134-1be6f9b01046.png)

Having taken a quick look at how hover information is created, I don't see how to simultaneously include hyperlinks and have syntax highlighting, as the current hover information is typeset by encoding it in a Haskell markdown codeblock.

Currently, hover information is available for set functions, e.g.:

![hover_doc](https://user-images.githubusercontent.com/1297748/92643179-9fc0d680-f2e1-11ea-888d-6d867a49e3be.png)

Something similar could be done in the previous situation, including a link to `WindowHints`, but that still seems a bit limited to me as the type might be something more complex and I might want to click on some component of it. It's especially annoying as if I click on the documentation for `windowSetGeometryHints` in the previous example, I can't then click on `Geometry` or `WindowHints` to get to that part of the documentation because of [`ghcide` !61](https://github.com/haskell/ghcide/issues/61), as those are part of the `gi-gdk` package (whereas `windowSetGeometryHints` comes from the `gi-gtk` package).

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.