Skip to content

Commit c3d0fdf

Browse files
committed
use hostIsDynamic
1 parent 34535e4 commit c3d0fdf

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

ghcide/src/Development/IDE/Core/Rules.hs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ import System.Environment (getExecutablePath)
154154
import System.Process.Extra (readProcessWithExitCode)
155155
import Text.Read (readMaybe)
156156
import System.Info.Extra (isMac)
157+
import HIE.Bios.Ghc.Gap (hostIsDynamic)
157158

158159
templateHaskellInstructions :: T.Text
159160
templateHaskellInstructions = "https://haskell-language-server.readthedocs.io/en/latest/troubleshooting.html#support-for-template-haskell"
@@ -830,15 +831,7 @@ isHiFileStableRule = defineEarlyCutoff $ RuleNoDiagnostics $ \IsHiFileStable f -
830831

831832
displayTHWarning :: LspT c IO ()
832833
displayTHWarning
833-
| isMac = do
834-
isDynamicBinary <- lift $ do
835-
exe <- getExecutablePath
836-
(_, out, _) <- readProcessWithExitCode exe ["+RTS", "--info"] ""
837-
return $ fromMaybe False $ do
838-
fields <- readMaybe out
839-
rtsWay <- lookup ("RTS way" :: String) fields
840-
return $ "dyn" `isInfixOf` rtsWay
841-
unless isDynamicBinary $
834+
| isMac && not hostIsDynamic = do
842835
LSP.sendNotification SWindowShowMessage $
843836
ShowMessageParams MtInfo $ T.unwords
844837
[ "This HLS binary does not support Template Haskell."

0 commit comments

Comments
 (0)