You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I occasionally run into situations where I want to manually format a block, e.g. with servant-openapi3:
--| The Work API-- ...dataWorkAPInmode=WorkAPI{workCreate::mode:-Summary"Create a work from a design.":>Description"...":>NamedRoutes (RunAPI (Designn) (WorkIdn))
, workIdDesignGet::mode:-Summary"Fetch the most recent design on a work.":>Description"...":>WorkIdn:>"design":>NamedRoutes (GetAPI (Designn))
}deriving (Generic)
stylish-haskell, of course, will reformat that so each type definition is on a single line, which is what I want in most cases. This would also provide a workaround while waiting on a bug fix (or for me in the case of record GADTs with docs, bug filing!).
{- STYLISH ignore -}-- no special highlighting.
{-# STYLISH ignore #-} -- special highlighting, but makes ghc noisy without `-Wno-unrecognized-pragmas`
{-# ANN myDef ("STYLISH ignore" :: String) #-} -- extra special highlighting, but not usable for imports, verbose.
The text was updated successfully, but these errors were encountered:
Would help with the haskell-language-server project where stylish-haskell is in use but fails to parse some files. Skipping these sections would format the rest of the file and help with failing pre-commit tasks.
plugins/hls-refactor-plugin/src/Development/IDE/Plugin/CodeAction/ExactPrint.hs: <string>:442:26: error: parse error on input `='
ghcide/src/Development/IDE/Import/FindImports.hs: <string>:127:5: error:
parse error (possibly incorrect indentation or mismatched brackets)
plugins/hls-refactor-plugin/src/Development/IDE/GHC/Compat/ExactPrint.hs: <string>:4:1: error: parse error on input `module'
ghcide/src/Development/IDE/Core/Compile.hs: <string>:372:7: error: parse error on input `go'
This imuli@22fd02d commit in my personal version is the minimal thing that meets (some) of my needs. It only handles the comment inside the data declaration though:
I occasionally run into situations where I want to manually format a block, e.g. with
servant-openapi3
:stylish-haskell
, of course, will reformat that so each type definition is on a single line, which is what I want in most cases. This would also provide a workaround while waiting on a bug fix (or for me in the case of record GADTs with docs, bug filing!).The text was updated successfully, but these errors were encountered: