@@ -26,7 +26,8 @@ import Development.IDE (Action, Rules,
26
26
hDuplicateTo' )
27
27
import Development.IDE.Core.Debouncer (Debouncer ,
28
28
newAsyncDebouncer )
29
- import Development.IDE.Core.FileStore (makeVFSHandle )
29
+ import Development.IDE.Core.FileStore (isWatchSupported ,
30
+ makeVFSHandle )
30
31
import Development.IDE.Core.IdeConfiguration (IdeConfiguration (.. ),
31
32
registerIdeConfiguration )
32
33
import Development.IDE.Core.OfInterest (FileOfInterestStatus (OnDisk ),
@@ -58,7 +59,7 @@ import Development.IDE.Types.Location (NormalizedUri,
58
59
toNormalizedFilePath' )
59
60
import Development.IDE.Types.Logger (Logger (Logger ))
60
61
import Development.IDE.Types.Options (IdeGhcSession ,
61
- IdeOptions (optCheckParents , optCheckProject , optReportProgress ),
62
+ IdeOptions (optCheckParents , optCheckProject , optReportProgress , optRunSubset ),
62
63
clientSupportsProgress ,
63
64
defaultIdeOptions ,
64
65
optModifyDynFlags )
@@ -215,12 +216,18 @@ defaultMain Arguments{..} = do
215
216
setInitialDynFlags argsSessionLoadingOptions
216
217
`catchAny` (\ e -> (hPutStrLn stderr $ " setInitialDynFlags: " ++ displayException e) >> pure Nothing )
217
218
219
+
218
220
sessionLoader <- loadSessionWithOptions argsSessionLoadingOptions $ fromMaybe dir rootPath
219
221
config <- LSP. runLspT env LSP. getConfig
220
222
let def_options = argsIdeOptions config sessionLoader
221
- options = def_options
223
+
224
+ -- disable runSubset if the client doesn't support watched files
225
+ runSubset <- (optRunSubset def_options && ) <$> LSP. runLspT env isWatchSupported
226
+
227
+ let options = def_options
222
228
{ optReportProgress = clientSupportsProgress caps
223
229
, optModifyDynFlags = optModifyDynFlags def_options <> pluginModifyDynflags plugins
230
+ , optRunSubset = runSubset
224
231
}
225
232
caps = LSP. resClientCapabilities env
226
233
initialise
0 commit comments