@@ -15,7 +15,8 @@ import Data.Maybe (catMaybes, fromMaybe,
15
15
import qualified Data.Text as T
16
16
import qualified Data.Text.IO as T
17
17
import Development.IDE (Action , Rules )
18
- import Development.IDE.Core.Debouncer (newAsyncDebouncer )
18
+ import Development.IDE.Core.Debouncer (Debouncer ,
19
+ newAsyncDebouncer )
19
20
import Development.IDE.Core.FileStore (makeVFSHandle )
20
21
import Development.IDE.Core.IdeConfiguration (IdeConfiguration (.. ),
21
22
registerIdeConfiguration )
@@ -43,7 +44,8 @@ import Development.IDE.Session (SessionLoadingOptions,
43
44
loadSessionWithOptions ,
44
45
runWithDb ,
45
46
setInitialDynFlags )
46
- import Development.IDE.Types.Location (toNormalizedFilePath' )
47
+ import Development.IDE.Types.Location (NormalizedUri ,
48
+ toNormalizedFilePath' )
47
49
import Development.IDE.Types.Logger (Logger (Logger ))
48
50
import Development.IDE.Types.Options (IdeGhcSession ,
49
51
IdeOptions (optCheckParents , optCheckProject , optReportProgress ),
@@ -86,6 +88,7 @@ data Arguments = Arguments
86
88
, argsLspOptions :: LSP. Options
87
89
, argsDefaultHlsConfig :: Config
88
90
, argsGetHieDbLoc :: FilePath -> IO FilePath -- ^ Map project roots to the location of the hiedb for the project
91
+ , argsDebouncer :: IO (Debouncer NormalizedUri ) -- ^ Debouncer used for diagnostics
89
92
}
90
93
91
94
instance Default Arguments where
@@ -101,6 +104,7 @@ instance Default Arguments where
101
104
, argsLspOptions = def {LSP. completionTriggerCharacters = Just " ." }
102
105
, argsDefaultHlsConfig = def
103
106
, argsGetHieDbLoc = getHieDbLoc
107
+ , argsDebouncer = newAsyncDebouncer
104
108
}
105
109
106
110
-- | Cheap stderr logger that relies on LineBuffering
@@ -123,6 +127,8 @@ defaultMain Arguments{..} = do
123
127
argsOnConfigChange _ide = pure . getConfigFromNotification argsDefaultHlsConfig
124
128
rules = argsRules >> pluginRules plugins
125
129
130
+ debouncer <- argsDebouncer
131
+
126
132
case argFiles of
127
133
Nothing -> do
128
134
t <- offsetTime
@@ -148,7 +154,6 @@ defaultMain Arguments{..} = do
148
154
{ optReportProgress = clientSupportsProgress caps
149
155
}
150
156
caps = LSP. resClientCapabilities env
151
- debouncer <- newAsyncDebouncer
152
157
initialise
153
158
argsDefaultHlsConfig
154
159
rules
@@ -184,7 +189,6 @@ defaultMain Arguments{..} = do
184
189
when (n > 0 ) $ putStrLn $ " (" ++ intercalate " , " (catMaybes ucradles) ++ " )"
185
190
putStrLn " \n Step 3/4: Initializing the IDE"
186
191
vfs <- makeVFSHandle
187
- debouncer <- newAsyncDebouncer
188
192
sessionLoader <- loadSessionWithOptions argsSessionLoadingOptions dir
189
193
let options = (argsIdeOptions Nothing sessionLoader)
190
194
{ optCheckParents = pure NeverCheck
0 commit comments