Skip to content
This repository was archived by the owner on Feb 1, 2019. It is now read-only.

Commit 8180950

Browse files
committed
Only display check mark if result is blank.
1 parent f3242f1 commit 8180950

File tree

5 files changed

+69
-60
lines changed

5 files changed

+69
-60
lines changed

haskell.behaviors

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
:lt.plugins.haskell/editor-lint-result
1414

1515
:lt.plugins.haskell/on-eval-one
16+
:lt.plugins.haskell/haskell-success
1617
:lt.plugins.haskell/haskell-result
1718
:lt.plugins.haskell/haskell-exception
1819
:lt.plugins.haskell/on-eval-type

haskell/LTHaskellClient.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import Language.Haskell.GhcMod (check, defaultOptions, findCradle,
2222

2323
import Language.Haskell.Stylish
2424

25+
import Data.Char (isSpace)
2526
import ReplSession
2627

2728
main :: IO ()
@@ -88,11 +89,15 @@ execCommand state (LTCommand (cId, command, Just ltPayload)) =
8889
let line = ltLine ltPayload
8990
case result of
9091
Left msg -> respond "editor.eval.haskell.exception" $ LTPayload msg line
92+
Right msg | isBlank msg -> respond "editor.eval.haskell.success" $ LTPayload "" line
9193
Right msg -> respond "editor.eval.haskell.result" $ LTPayload msg line
9294

9395
respond :: (ToJSON a) => Command -> a -> IO ()
9496
respond respCommand respPayload = sendResponse (ltHandle state) $ LTCommand (cId, respCommand, respPayload)
9597

98+
isBlank :: String -> Bool
99+
isBlank = all isSpace
100+
96101
-- API types
97102

98103
type Client = Int

0 commit comments

Comments
 (0)