Skip to content

Commit 8821bba

Browse files
committed
run notification handlers sequentially
1 parent 530dd4e commit 8821bba

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

exe/Plugins.hs

+3-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ idePlugins includeExamples = pluginDescToIdePlugins allPlugins
8989
then basePlugins ++ examplePlugins
9090
else basePlugins
9191
basePlugins =
92-
GhcIde.descriptors ++
9392
#if pragmas
9493
Pragmas.descriptor "pragmas" :
9594
#endif
@@ -135,7 +134,9 @@ idePlugins includeExamples = pluginDescToIdePlugins allPlugins
135134
#if splice
136135
Splice.descriptor "splice" :
137136
#endif
138-
[]
137+
-- The ghcide descriptors should come last so that the notification handlers
138+
-- (which restart the Shake build) run after everything else
139+
GhcIde.descriptors
139140
examplePlugins =
140141
[Example.descriptor "eg"
141142
,Example2.descriptor "eg2"

ghcide/src/Development/IDE/Plugin/HLS.hs

+5-8
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ import Language.LSP.Types
3737
import qualified Language.LSP.Types as J
3838
import Text.Regex.TDFA.Text ()
3939
import UnliftIO (MonadUnliftIO)
40-
import UnliftIO.Async (forConcurrently,
41-
mapConcurrently_)
40+
import UnliftIO.Async (forConcurrently)
4241
import UnliftIO.Exception (catchAny)
4342

4443
-- ---------------------------------------------------------------------
@@ -179,13 +178,11 @@ extensibleNotificationPlugins defaultConfig xs = Plugin mempty handlers
179178
Nothing -> do
180179
liftIO $ logInfo (ideLogger ide) "extensibleNotificationPlugins no enabled plugins"
181180
pure ()
182-
-- We run the notifications in order, so the built-in ghcide
183-
-- processing (which restarts the shake process) comes last
184-
-- Just fs -> void $ runConcurrentlyNotification (show m) fs ide params
185181
Just fs -> do
186-
liftIO $ logInfo (ideLogger ide) $ "extensibleNotificationPlugins number of plugins:" <> T.pack (show (length fs))
187-
-- run notification handlers in parallel
188-
mapConcurrently_ (\(_pid,f) -> f ide params) fs
182+
-- We run the notifications in order, so the core ghcide provider
183+
-- (which restarts the shake process) hopefully comes last
184+
-- TODO tracing
185+
mapM_ (\(_pid,f) -> f ide params) fs
189186

190187
-- ---------------------------------------------------------------------
191188

0 commit comments

Comments
 (0)