Skip to content

Commit

Permalink
Stan: Avoid terminal colors in messages (#3090)
Browse files Browse the repository at this point in the history
  • Loading branch information
andys8 authored Aug 11, 2022
1 parent 0e74593 commit 3b2f9f6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions plugins/hls-stan-plugin/src/Ide/Plugin/Stan.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,11 @@ import Ide.Types (PluginDescriptor (..),
defaultPluginDescriptor)
import qualified Language.LSP.Types as LSP
import Stan.Analysis (Analysis (..), runAnalysis)
import Stan.Category (prettyShowCategory)
import Stan.Category (Category (..))
import Stan.Core.Id (Id (..))
import Stan.Inspection (Inspection (..))
import Stan.Inspection.All (inspectionsIds, inspectionsMap)
import Stan.Observation (Observation (..))
import Stan.Severity (prettyShowSeverity)

descriptor :: Recorder (WithPriority Log) -> PluginId -> PluginDescriptor IdeState
descriptor recorder plId = (defaultPluginDescriptor plId) {pluginRules = rules recorder}
Expand Down Expand Up @@ -94,15 +93,16 @@ rules recorder = do
let
-- Looking similar to Stan CLI output
-- We do not use `prettyShowInspection` cuz Id is redundant here
-- `prettyShowSeverity` and `prettyShowCategory` would contain color
-- codes and are replaced, too
message :: T.Text
message =
T.unlines $
[ " ✲ Name: " <> inspectionName inspection,
" ✲ Description: " <> inspectionDescription inspection,
" ✲ Severity: " <> (prettyShowSeverity $
inspectionSeverity inspection),
" ✲ Severity: " <> (T.pack $ show $ inspectionSeverity inspection),
" ✲ Category: " <> T.intercalate " "
(map prettyShowCategory $ toList $ inspectionCategory inspection),
(map (("#" <>) . unCategory) $ toList $ inspectionCategory inspection),
"Possible solutions:"
]
++ map (" - " <>) (inspectionSolution inspection)
Expand Down

0 comments on commit 3b2f9f6

Please sign in to comment.