atom-haskell / ide-haskell

Haskell IDE plugin for Atom editor
https://atom.io/packages/ide-haskell
Other
233 stars 30 forks source link

Do not prettify Literate Haskell #216

Closed cblp closed 6 years ago

cblp commented 6 years ago

Until stylish-haskell supports it.

lierdakil commented 6 years ago

Hmm. This is a bit of a questionable case. Since we support other prettifiers, and apparently there is (if rudimentary) support for literate Haskell in hindent, it's not immediately obvious how this should be handled.

cblp commented 6 years ago

Currently, default settings lead to a guaranteed error on .lhs files.

What about adding some ticks?

[_] prettify Haskell source files [_] prettify Literate Haskell source files [_] prettify Cabal files

lierdakil commented 6 years ago

A canonical way of addressing it would be to provide configurable list of scopes that prettifier should activate on, but I'm not sure it would be immediately obvious what that means. Besides, there's an issue of Cabal files, since those are handled by cabal format rather than a "normal" prettifier.

Tics would be a fine entry-level option, but those could be unnecessarily rigid and need to be updated to match language-haskell to be useful.

A more flexible option would be to have scopes-to-binaries mapping in config, but that's not configurable through GUI.

Probably doing both tics and flexible scopes-to-binary mapping is a reasonable middle ground?

cblp commented 6 years ago

Yet another solution is to split the prettifying function into a separate package (or packages).

Want to prettify Cabal files? Install pretty-cabal package.

Want to prettify Haskell files? Install pretty-haskell, configure command for each type.

cblp commented 6 years ago

See also #181

lierdakil commented 6 years ago

I feel like splitting prettifier packages would be a bit weird at this point. Still might be done one day, but not today, I don't think. Anyway, I'm going to try to implement ticks for the time being, and see about a more flexible configuration at a later date. Does that sound reasonable?

cblp commented 6 years ago

Yes, I think so.

lierdakil commented 6 years ago

Okay, done in v2.2.0. Also worth mentioning: https://atom-haskell.github.io/core-packages/ide-haskell/#advanced-configuration-since-v2-2-0