@@ -26,7 +26,8 @@ import Development.IDE (Action, Rules,
2626 hDuplicateTo' )
2727import Development.IDE.Core.Debouncer (Debouncer ,
2828 newAsyncDebouncer )
29- import Development.IDE.Core.FileStore (makeVFSHandle )
29+ import Development.IDE.Core.FileStore (isWatchSupported ,
30+ makeVFSHandle )
3031import Development.IDE.Core.IdeConfiguration (IdeConfiguration (.. ),
3132 registerIdeConfiguration )
3233import Development.IDE.Core.OfInterest (FileOfInterestStatus (OnDisk ),
@@ -58,7 +59,7 @@ import Development.IDE.Types.Location (NormalizedUri,
5859 toNormalizedFilePath' )
5960import Development.IDE.Types.Logger (Logger (Logger ))
6061import Development.IDE.Types.Options (IdeGhcSession ,
61- IdeOptions (optCheckParents , optCheckProject , optReportProgress ),
62+ IdeOptions (optCheckParents , optCheckProject , optReportProgress , optRunSubset ),
6263 clientSupportsProgress ,
6364 defaultIdeOptions ,
6465 optModifyDynFlags )
@@ -215,12 +216,18 @@ defaultMain Arguments{..} = do
215216 setInitialDynFlags argsSessionLoadingOptions
216217 `catchAny` (\ e -> (hPutStrLn stderr $ " setInitialDynFlags: " ++ displayException e) >> pure Nothing )
217218
219+
218220 sessionLoader <- loadSessionWithOptions argsSessionLoadingOptions $ fromMaybe dir rootPath
219221 config <- LSP. runLspT env LSP. getConfig
220222 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
222228 { optReportProgress = clientSupportsProgress caps
223229 , optModifyDynFlags = optModifyDynFlags def_options <> pluginModifyDynflags plugins
230+ , optRunSubset = runSubset
224231 }
225232 caps = LSP. resClientCapabilities env
226233 initialise
0 commit comments