@@ -128,17 +128,20 @@ getModificationTimeImpl vfs isWatched missingFileDiags file = do
128
128
let file' = fromNormalizedFilePath file
129
129
let wrap time@ (l,s) = (Just $ LBS. toStrict $ B. encode time, ([] , Just $ ModificationTime l s))
130
130
mbVirtual <- liftIO $ getVirtualFile vfs $ filePathToUri' file
131
- -- we use 'getVirtualFile' to discriminate FOIs so make that
132
- -- dependency explicit by using the IsFileOfInterest rule
133
- isWF <- isWorkspaceFile file
134
- when isWF $ void $ use_ IsFileOfInterest file
135
131
case mbVirtual of
136
132
Just (virtualFileVersion -> ver) -> do
137
133
alwaysRerun
138
134
pure (Just $ LBS. toStrict $ B. encode ver, ([] , Just $ VFSVersion ver))
139
135
Nothing -> do
140
136
isWF <- isWatched file
141
- unless (isWF || isInterface file) alwaysRerun
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
142
+ when (isWF && not (isInterface file)) $
143
+ -- we use 'getVirtualFile' to discriminate FOIs so make that dependency explicit
144
+ void $ use_ IsFileOfInterest file
142
145
liftIO $ fmap wrap (getModTime file')
143
146
`catch` \ (e :: IOException ) -> do
144
147
let err | isDoesNotExistError e = " File does not exist: " ++ file'
0 commit comments