Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My pragmas keep shouting at me #729

Open
emilypi opened this issue Oct 16, 2020 · 11 comments
Open

My pragmas keep shouting at me #729

emilypi opened this issue Oct 16, 2020 · 11 comments

Comments

@emilypi
Copy link
Member

emilypi commented Oct 16, 2020

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

@ndmitchell
Copy link
Collaborator

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.

@emilypi
Copy link
Member Author

emilypi commented Oct 16, 2020

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

@wz1000
Copy link
Collaborator

wz1000 commented Oct 16, 2020

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, haskell/ghcide#857 should fix it.

@pepeiborra
Copy link
Collaborator

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

@alanz
Copy link
Collaborator

alanz commented Oct 17, 2020

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.

@wz1000
Copy link
Collaborator

wz1000 commented Oct 19, 2020

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).

@ndmitchell
Copy link
Collaborator

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

@georgefst
Copy link
Collaborator

haskell/ghcide#897 uses OPTIONS_GHC in all caps as well. Just another one to bear in mind.

@michaelpj
Copy link
Collaborator

Generally I think we're trying to avoid configuration, and nobody else has asked for this, so closing.

@georgefst
Copy link
Collaborator

Generally I think we're trying to avoid configuration

Why exactly? I don't think I've seen any discussion around that. I am aware that adding options is currently quite onerous, from how long it took to resolve #2827. But there are various suggestions in linked threads about how that situation could be improved.

In general, I'm not sure about the wisdom of closing unresolved issues like this, as opposed to just marking them low-priority. I do still care slightly about this, and presumably so does @emilypi. (This is essentially the "stale bot" debate, where I can see the logic in tagging "stale" issues, but not in auto-closing them as some do.)

@michaelpj
Copy link
Collaborator

Why exactly? I don't think I've seen any discussion around that.

Perhaps it's folklore. But generally: configuration means a bigger state space, means more to test, and gives users more choices (which is not necessarily good for them). If it's possible to get something that's good enough and doesn't require configuration, I think that's usually better (sometimes it's not possible!).

In general, I'm not sure about the wisdom of closing unresolved issues like this, as opposed to just marking them low-priority.

Okay, we can keep it open! But I've generally found that issues that people care about even slightly tend to have some additional comments on them. This one is very old, and my reading of it was that nobody except @emilypi cared about it (you commented but I wasn't sure if you were in favour!).

The reality is that we have a lot of issues for things that somebody maybe wanted once. I'm leaving a lot of them, but I am trying to cut down on ones that are particularly dead or don't seem popular.

@michaelpj michaelpj reopened this Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants