Skip to content

Commit 3ebe65d

Browse files
committed
disable run subset if the client doesn't support file watches
1 parent 63e4fda commit 3ebe65d

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

ghcide/src/Development/IDE/Main.hs

+10-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ import Development.IDE (Action, Rules,
2626
hDuplicateTo')
2727
import Development.IDE.Core.Debouncer (Debouncer,
2828
newAsyncDebouncer)
29-
import Development.IDE.Core.FileStore (makeVFSHandle)
29+
import Development.IDE.Core.FileStore (isWatchSupported,
30+
makeVFSHandle)
3031
import Development.IDE.Core.IdeConfiguration (IdeConfiguration (..),
3132
registerIdeConfiguration)
3233
import Development.IDE.Core.OfInterest (FileOfInterestStatus (OnDisk),
@@ -58,7 +59,7 @@ import Development.IDE.Types.Location (NormalizedUri,
5859
toNormalizedFilePath')
5960
import Development.IDE.Types.Logger (Logger (Logger))
6061
import 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

Comments
 (0)