Skip to content

Commit

Permalink
use hostIsDynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
pepeiborra committed Dec 12, 2021
1 parent 34535e4 commit c3d0fdf
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions ghcide/src/Development/IDE/Core/Rules.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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."
Expand Down

0 comments on commit c3d0fdf

Please sign in to comment.