-
-
Notifications
You must be signed in to change notification settings - Fork 347
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
Support for 9.10 #4233
base: master
Are you sure you want to change the base?
Support for 9.10 #4233
Conversation
This includes supports for all plugins, other than formatters and hlint. We need ghc-exactprint and retrie release before merging this.
If anyone wants to help, chasing up any of the allow-newers would be helpful (get upstream to release/make a revision). |
I've revised the |
#if MIN_VERSION_ghc(9,9,0) | ||
in L (noAnnSrcSpanDP dp <> l) e | ||
newLine (L _ e) = | ||
let dp = deltaPos 1 (defaultIndent + 1) {- TODO why is this +1 needed? -} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alanz this is curious:
This code is responsible for adding typeclass method placeholders to typeclass instance declarations.
In ghc 9.10, in order to indent the method declarations by 2 spaces I effectively have to create DeltaPos like this:
dp :: DeltaPos
dp = DifferentLine 1 3
where the previous code was using DifferentLine 1 2
(but also the previous code called makeDeltaAst
on the whole module whereas I removed this call for GHC 9.10)
ditto in gadt plugin tests below where
delta = EpaDelta (DifferentLine 1 3) []
fixed all test failures.
Could this be an exactprint bug?
I have trouble reasoning about the expected behavior when you have
bunch of declarations with absolute positions and you insert some nodes with DeltaPos positions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There were changes in ghc-exactprint, to harmonise the treatment of delta values at the top level and inside the AST. So they are all coherent now, but I guess the column is now off by one, consistently for DifferentLine
.
plugins/hls-eval-plugin/test/Main.hs
Outdated
@@ -85,7 +85,8 @@ tests = | |||
, goldenWithEval "Shows a kind with :kind" "T12" "hs" | |||
, goldenWithEval "Reports an error for an incorrect type with :kind" "T13" "hs" | |||
, goldenWithEval' "Returns a fully-instantiated type for :type" "T14" "hs" (if ghcVersion >= GHC98 then "ghc98.expected" else "expected") -- See https://gitlab.haskell.org/ghc/ghc/-/issues/24069 | |||
, knownBrokenForGhcVersions [GHC92, GHC94, GHC96, GHC98] "type +v does not work anymore with 9.2" $ goldenWithEval "Returns an uninstantiated type for :type +v, admitting multiple whitespaces around arguments" "T15" "hs" | |||
, knownBrokenForGhcVersions [GHC92, GHC94, GHC96, GHC98, GHC910] "type +v does not work anymore with 9.2" $ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to me that we should just remove this testcase, since all supported GHCs now say:
:type +v 123
`:type +v' has gone; use `:type' instead
This includes supports for all plugins, other than formatters and hlint.
We need ghc-exactprint and retrie release before landing this.