From c3d0fdf4832d89e4e8587352cf80a24b2490dcaa Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Sun, 12 Dec 2021 10:53:12 +0000 Subject: [PATCH] use hostIsDynamic --- ghcide/src/Development/IDE/Core/Rules.hs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/ghcide/src/Development/IDE/Core/Rules.hs b/ghcide/src/Development/IDE/Core/Rules.hs index 451cca6cd50..756edad54ca 100644 --- a/ghcide/src/Development/IDE/Core/Rules.hs +++ b/ghcide/src/Development/IDE/Core/Rules.hs @@ -154,6 +154,7 @@ import System.Environment (getExecutablePath) import System.Process.Extra (readProcessWithExitCode) import Text.Read (readMaybe) import System.Info.Extra (isMac) +import HIE.Bios.Ghc.Gap (hostIsDynamic) templateHaskellInstructions :: T.Text templateHaskellInstructions = "https://haskell-language-server.readthedocs.io/en/latest/troubleshooting.html#support-for-template-haskell" @@ -830,15 +831,7 @@ isHiFileStableRule = defineEarlyCutoff $ RuleNoDiagnostics $ \IsHiFileStable f - displayTHWarning :: LspT c IO () displayTHWarning - | isMac = do - isDynamicBinary <- lift $ do - exe <- getExecutablePath - (_, out, _) <- readProcessWithExitCode exe ["+RTS", "--info"] "" - return $ fromMaybe False $ do - fields <- readMaybe out - rtsWay <- lookup ("RTS way" :: String) fields - return $ "dyn" `isInfixOf` rtsWay - unless isDynamicBinary $ + | isMac && not hostIsDynamic = do LSP.sendNotification SWindowShowMessage $ ShowMessageParams MtInfo $ T.unwords [ "This HLS binary does not support Template Haskell."