vscode-haskell icon indicating copy to clipboard operation
vscode-haskell copied to clipboard

Add support for folding user specified regions

Open bonds opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe.

I want to be able to collapse the long boilerplate of language pragma at the start of my cabal scripts.

Describe the solution you'd like

This block of code is foldable:

-- region "name of the region"
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE BinaryLiterals #-}
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
-- endregion

See also: https://code.visualstudio.com/docs/editor/codebasics#_folding

Describe alternatives you've considered

Continue to live without this feature. :)

Additional context

IMO this is a pretty low priority feature, but I thought I'd ask just so y'all know at least one person would use it. And in case I'm not the only person interested, it gives others a place find whatever the decision is. Please feel free to close the ticket if y'all aren't interested in implementing this...at least those who find their way to this ticket will be able to find that decision!

And thank you for your consideration and thank you for your contributions to this project, its great!

bonds avatar Aug 01 '22 05:08 bonds

Hi, that sounds like a nice addition! I am unsure at the moment whether we can do this at the client vscode level, or whether this feature request has to be moved to HLS.

Maybe this extension can provide some insights: https://marketplace.visualstudio.com/items?itemName=zokugun.explicit-folding

fendor avatar Aug 01 '22 10:08 fendor

VSCode already supports custom folding ranges in its latest version: https://code.visualstudio.com/updates/v1_70#_fold-selection. Maybe it's okay to close this issue?

kokobd avatar Aug 07 '22 02:08 kokobd

VSCode already supports custom folding ranges in its latest version: https://code.visualstudio.com/updates/v1_70#_fold-selection. Maybe it's okay to close this issue?

Not really sure this is the same thing? How would these folds show up in a respository so that they're available for other readers on the team? C# regions also have specific names, which show up in the editor, so that you know where to go to look for what you want to unfold.

barendventer avatar Nov 23 '22 01:11 barendventer

@barendventer Looks like I misunderstood it. Here is a workaround I found later: https://marketplace.visualstudio.com/items?itemName=zokugun.explicit-folding

kokobd avatar Nov 23 '22 07:11 kokobd

Closed as either not our responsibility and something was implemented in HLS.

fendor avatar Dec 05 '22 09:12 fendor