Open imuli opened 2 years ago
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 https://github.com/imuli/stylish-haskell/commit/22fd02d515394b3509e687f1e23b767399a4c07c 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:
data {-STYLISH ignore-} WorkAPI n mode = WorkAPI
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!).