-
-
Notifications
You must be signed in to change notification settings - Fork 368
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
complex type variables in hover with GHC 9.2 #2716
Comments
It seems likely that something changed in GHC upstream. |
The following code looks incorrect:
Because of https://gitlab.haskell.org/ghc/ghc/-/commit/8d401e50ce35525dcdc6a21fcf952c3cbf3a72d4, a name is always printed with its unique except with "user" style, but Something like this should fix it: renderWithContext (defaultSDocContext { sdocSuppressUniques = True, sdocStyle = defaultUserStyle }) . ppr |
Well, that's a golden test that's just waiting to get written. :) |
I wrote a failing test, PR incoming.
Unfortunately, that's not it. I think the real issue is that we pervasively use |
Could you replace all uses of showSDocForUser :: SDoc -> String
showSDocForUser = renderWithContext $ defaultSDocContext
{ sdocStyle = defaultUserStyle
, sdocCanUseUnicode = True -- I guess?
, sdocPrintUnicodeSyntax = True -- maybe
, sdocSuppressUniques = True
} |
Witnesses #2716. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Pepe Iborra <[email protected]>
Witnesses haskell#2716. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Pepe Iborra <[email protected]>
Type signature in hover with GHC 9.2 are longer what they used to be.
See for example:
See the
a_aI0wB
. With GHC 8.10.7, it wasa
:Your environment
Which OS do you use:
Linux
Which LSP client (editor/plugin) do you use:
neovim + lsp-config
Describe your project (alternative: link to the project):
Huge proprietary codebase built with bazel with a custom HLS hie setup.
Steps to reproduce
Use hover on a type. However that's not always clear, because sometimes I can observe "short" type variable. In my example, it appen on
class
andnewtype
which have type parameters.Expected behaviour
Type variable should be short. They were used to be named as the type variable in the associated
newtype
orclass
.Actual behaviour
Type variables are long and complex. The starts with the original name, but a noisy suffix is appended.
Include debug information
The text was updated successfully, but these errors were encountered: