File tree 1 file changed +11
-5
lines changed
ghcide/src/Development/IDE/Core 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -134,11 +134,17 @@ getModificationTimeImpl vfs isWatched missingFileDiags file = do
134
134
pure (Just $ LBS. toStrict $ B. encode ver, ([] , Just $ VFSVersion ver))
135
135
Nothing -> do
136
136
isWF <- isWatched file
137
- unless (isWF || isInterface file)
138
- -- If the file is watched, we don't need alwaysRerun.
139
- -- Interface files are not watched by the LSP client but
140
- -- we keep track of their freshness, so no alwaysRerun
141
- alwaysRerun
137
+ if isWF
138
+ then -- the file is watched so we can rely on FileWatched notifications,
139
+ -- but also need a dependency on IsFileOfInterest to reinstall
140
+ -- alwaysRerun when the file becomes VFS
141
+ void (use_ IsFileOfInterest file)
142
+ else if isInterface file
143
+ then -- interface files are tracked specially using the closed world assumption
144
+ pure ()
145
+ else -- in all other cases we will need to freshly check the file system
146
+ alwaysRerun
147
+
142
148
when (isWF && not (isInterface file)) $
143
149
-- we use 'getVirtualFile' to discriminate FOIs so make that dependency explicit
144
150
void $ use_ IsFileOfInterest file
You can’t perform that action at this time.
0 commit comments