We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a46f0a2 commit 25bfcb3Copy full SHA for 25bfcb3
ghcide/src/Development/IDE/Types/Diagnostics.hs
@@ -72,12 +72,16 @@ ideErrorFromLspDiag lspDiag fdFilePath origMsg =
72
Nothing -> NoStructuredMessage
73
Just msg -> SomeStructuredMessage msg
74
fdLspDiagnostic = lspDiag
75
+#if MIN_VERSION_ghc(9,6,1)
76
{ _code = fmap ghcCodeToLspCode . diagnosticCode . errMsgDiagnostic =<< origMsg
77
}
78
+#endif
79
+#if MIN_VERSION_ghc(9,8,1)
80
ghcCodeToLspCode :: DiagnosticCode -> Int32 LSP.|? T.Text
-#if MIN_VERSION_ghc(9,10,1)
81
ghcCodeToLspCode = InR . T.pack . show
-#else
82
+#elif MIN_VERSION_ghc(9,6,1)
83
+ -- DiagnosticCode only got a show instance in 9.8.1
84
+ ghcCodeToLspCode :: DiagnosticCode -> Int32 LSP.|? T.Text
85
ghcCodeToLspCode (DiagnosticCode prefix c) = InR $ T.pack $ prefix ++ "-" ++ printf "%05d" c
86
#endif
87
in
0 commit comments