Ghcide: My pragmas keep shouting at me

Created on 16 Oct 2020  路  8Comments  路  Source: haskell/ghcide

Hey all, you have a great project here, and I'm liking the progress. My only gripe so far is that whenever ghcide prompts me to add an extension, it inserts a very loud pragma LANGUAGE or INLINE or MINIMAL etc. This is a very low priority feature request, but you could add the ability to write lower-case extensions so that I can have an indoor conversation with my compiler?

Thanks

enhancement

Most helpful comment

I suspect the "ideal" solution would be a setting, with three values - SHOUT, whisper and FollowThisFile.

All 8 comments

Since Haskell users tend to default to SHOUTY by a significant margin, I think it would have to be a preference - but not an unreasonable one to add. Our preference handling is not something we've invested much in, so that might be a prerequisite.

Point me in the write direction and I can do it for you guys 馃槃

The code action is generated here: https://github.com/haskell/ghcide/blob/master/src/Development/IDE/Plugin/CodeAction.hs#L512

The preferences mechanism is a bit more involved and doesn't currently work, #857 should fix it.

Easiest thing to do is to generate two code actions, one SHOUTY and one not

Easiest thing to do is to generate two code actions, one SHOUTY and one not

We already have too many, cluttering the UI

I think it would be better to make this configurable. Default as current, but you can set it.

Another option would be to detect the style being used in the file, and then respect that. This way we do not need a configuration option, and things just work (except for the first time you add a language extension).

I suspect the "ideal" solution would be a setting, with three values - SHOUT, whisper and FollowThisFile.

897 uses OPTIONS_GHC in all caps as well. Just another one to bear in mind.

Was this page helpful?
0 / 5 - 0 ratings