haskell / haskell-mode

Emacs mode for Haskell
http://haskell.github.io/haskell-mode/
GNU General Public License v3.0
1.33k stars 344 forks source link

Fix #1834: remove bad regex that was supposed to recognize a LANGUAGE suggestion #1835

Closed andreasabel closed 10 months ago

andreasabel commented 10 months ago

Remove bad regex that was supposed to recognize a LANGUAGE suggestion.

This regex fires unfortunately on GHC 9.8's new x-partial warning, destroying the UX with obnoxious questions whether to "add LANGUAGE Data".

Closes #1834.

purcell commented 10 months ago

Thanks. Better to remove this code completely: the comment in the commit message is sufficient. Even better would be to extend the existing message so that it matches its original targets but not the new "refactor" message. The tricky thing is finding examples of the former!

Bodigrim commented 10 months ago

(Just passing by) Is it difficult for haskell-mode to filter anything remotely suspicious to be a language extension through ghc --supported-extensions? This would be a more robust solution than adjusting regexps here and there.

andreasabel commented 10 months ago

@purcell : Thanks for the quick review. I will leave the decision to you how to fix the problem. @Bodigrim 's advice is good; the current heuristics is just too brittle.

purcell commented 10 months ago

Sounds reasonable. I think there may even be a list of supported extensions in the code which gets updated periodically — using that would be better than a fresh process invocation if so. I'm unlikely to work on this myself though, sorry.

andreasabel commented 10 months ago

@purcell : You may at least merge my hotfix...

purcell commented 10 months ago

You may at least merge my hotfix...

Thanks! 😉

Alright, have applied my suggestion above and will merge once CI passes. Might have to close and re-open this PR briefly to trigger a rebase on top of changes I just made in master to fix CI.

andreasabel commented 10 months ago

Thanks Steve @purcell!