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

Support for 9.10 #4233

Open
wants to merge 69 commits into
base: master
Choose a base branch
from
Open

Support for 9.10 #4233

wants to merge 69 commits into from

Conversation

wz1000
Copy link
Collaborator

@wz1000 wz1000 commented May 15, 2024

This includes supports for all plugins, other than formatters and hlint.

We need ghc-exactprint and retrie release before merging this.
@michaelpj
Copy link
Collaborator

If anyone wants to help, chasing up any of the allow-newers would be helpful (get upstream to release/make a revision).

@jhrcek jhrcek requested a review from eddiemundo as a code owner May 17, 2024 05:37
@michaelpj
Copy link
Collaborator

I've revised the lsp packages

#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? -}
Copy link
Collaborator

@jhrcek jhrcek May 28, 2024

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.

Copy link
Collaborator

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.

@@ -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" $
Copy link
Collaborator

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

@soulomoon soulomoon self-requested a review as a code owner May 29, 2024 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants