Skip to content

Commit

Permalink
Add thread id in ghcide tests log (haskell#4204)
Browse files Browse the repository at this point in the history
* add threadId to ghcide test

* add threadId to ghcide test

* add thread id by default in ghcide-tests

* remove redundant log
  • Loading branch information
soulomoon authored May 4, 2024
1 parent 75cb0b9 commit ced09a7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ghcide/exe/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import qualified Development.IDE.Main as IDEMain
import qualified Development.IDE.Monitoring.OpenTelemetry as OpenTelemetry
import qualified Development.IDE.Plugin.HLS.GhcIde as GhcIde
import Development.IDE.Types.Options
import Ide.Logger (LoggingColumn (DataColumn, PriorityColumn),
import Ide.Logger (LoggingColumn (..),
Pretty (pretty),
Priority (Debug, Error, Info),
WithPriority (WithPriority, priority),
Expand Down Expand Up @@ -73,7 +73,7 @@ main = withTelemetryRecorder $ \telemetryRecorder -> do
-- stderr recorder just for plugin cli commands
pluginCliRecorder <-
cmapWithPrio pretty
<$> makeDefaultStderrRecorder (Just [PriorityColumn, DataColumn])
<$> makeDefaultStderrRecorder (Just [ThreadIdColumn, PriorityColumn, DataColumn])

let hlsPlugins = pluginDescToIdePlugins (GhcIde.descriptors (cmapWithPrio LogGhcIde pluginCliRecorder))
-- WARNING: If you write to stdout before runLanguageServer
Expand Down
3 changes: 2 additions & 1 deletion ghcide/test/exe/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import CompletionTests
import CPPTests
import CradleTests
import DependentFileTest
import Development.IDE (LoggingColumn (..))
import DiagnosticTests
import ExceptionTests
import FindDefinitionAndHoverTests
Expand All @@ -74,7 +75,7 @@ import WatchedFileTests

main :: IO ()
main = do
docWithPriorityRecorder <- makeDefaultStderrRecorder (Just [PriorityColumn, DataColumn])
docWithPriorityRecorder <- makeDefaultStderrRecorder (Just [ThreadIdColumn, PriorityColumn, DataColumn])

let docWithFilteredPriorityRecorder =
docWithPriorityRecorder
Expand Down
1 change: 0 additions & 1 deletion hls-test-utils/src/Test/Hls/FileSystem.hs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ materialise rootDir' fileTree testDataDir' = do
copyDir' root dir = do
files <- fmap FP.normalise . lines <$> withCurrentDirectory (testDataDir </> dir) (readProcess "git" ["ls-files", "--cached", "--modified", "--others"] "")
mapM_ (createDirectoryIfMissing True . ((root </>) . takeDirectory)) files
mapM_ (\f -> putStrLn $ (testDataDir </> dir </> f) <> ":" <> (root </> f) ) files
mapM_ (\f -> copyFile (testDataDir </> dir </> f) (root </> f)) files
return ()

Expand Down

0 comments on commit ced09a7

Please sign in to comment.