zed icon indicating copy to clipboard operation
zed copied to clipboard

Add Haskell buffer symbol search

Open pocaeus opened this issue 1 year ago • 2 comments

This PR is a follow-up from https://github.com/zed-industries/zed/pull/6786#issuecomment-1912912550 and adds an outline.scm file for buffer symbol search support in Haskell.

Release Notes:

  • Added buffer symbol search support for Haskell

pocaeus avatar Feb 03 '24 17:02 pocaeus

Screenshots

CleanShot 2024-02-03 at 12 18 21@2x CleanShot 2024-02-03 at 12 18 36@2x CleanShot 2024-02-03 at 12 18 55@2x CleanShot 2024-02-03 at 12 21 02@2x

Open Question

Since functions/signatures don't have a special syntax keyword in Haskell, signatures show up in symbol search as just the string name. This is probably fine, but I was wondering if there was a way to override this and show these prefixed with signature in the buffer symbol search popup? So it might show up as:

signature genDecodeErr

Additionally, I was trying to add the types from a signature which would be pretty useful IMO but I couldn't figure out how to do this in the outline.scm file. Below is a screenshot showing the syntax tree and I was hoping to show something like:

genDecodeErr
     DecodeErr -> Gen T.OnDecodeError

CleanShot 2024-02-03 at 12 37 45@2x

Which is the type: fun part in the syntax tree.

ghost avatar Feb 03 '24 17:02 ghost

cc @mikayla-maki, sorry the follow-up took me a bit 🙂

and thank you @huwaireb for the tips!

ghost avatar Feb 03 '24 17:02 ghost

@pseudomata This is awesome!

maxdeviant avatar Feb 05 '24 22:02 maxdeviant

Additionally, I was trying to add the types from a signature which would be pretty useful IMO but I couldn't figure out how to do this in the outline.scm file. Below is a screenshot showing the syntax tree and I was hoping to show something like:

AFAIK our other language outlines don't show type information in signatures.

I was trying to do the same thing in #6733 before I noticed that other languages didn't include the types.

It does seem like something that could be useful, but it seems like a change we'd want to make across the board (and it's possible it requires some changes in our outlining support).

maxdeviant avatar Feb 05 '24 22:02 maxdeviant