File tree Expand file tree Collapse file tree 2 files changed +21
-7
lines changed
ghcide/src/Development/IDE/Core Expand file tree Collapse file tree 2 files changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -137,16 +137,22 @@ kick = do
137
137
mRunLspT lspEnv $
138
138
LSP. sendNotification (LSP. SMethod_CustomMethod msg) $
139
139
toJSON $ map fromNormalizedFilePath files
140
+ isProjectFile :: NormalizedFilePath -> Bool
141
+ isProjectFile file = case getSourceFileOrigin file of
142
+ FromProject -> True
143
+ FromDependency -> False
144
+ projectFiles :: [NormalizedFilePath ]
145
+ projectFiles = filter isProjectFile files
140
146
141
147
signal (Proxy @ " kick/start" )
142
148
liftIO $ progressUpdate progress KickStarted
143
149
144
150
-- Update the exports map
145
- results <- uses GenerateCore files
151
+ results <- uses GenerateCore projectFiles
146
152
<* uses GetHieAst files
147
153
-- needed to have non local completions on the first edit
148
154
-- when the first edit breaks the module header
149
- <* uses NonLocalCompletions files
155
+ <* uses NonLocalCompletions projectFiles
150
156
let mguts = catMaybes results
151
157
void $ liftIO $ atomically $ modifyTVar' exportsMap (updateExportsMapMg mguts)
152
158
Original file line number Diff line number Diff line change @@ -1174,11 +1174,19 @@ defineEarlyCutoff' doDiagnostics cmp key file old mode action = do
1174
1174
Just (Succeeded ver v, _) -> Stale Nothing ver v
1175
1175
Just (Stale d ver v, _) -> Stale d ver v
1176
1176
Just (Failed b, _) -> Failed b
1177
- (bs, (diags, res)) <- actionCatch
1178
- (do v <- action staleV; liftIO $ evaluate $ force v) $
1179
- \ (e :: SomeException ) -> do
1180
- pure (Nothing , ([ideErrorText file $ T. pack $ show e | not $ isBadDependency e],Nothing ))
1181
-
1177
+ (bs, (diags, res)) <- do
1178
+ let doAction = actionCatch
1179
+ (do v <- action staleV; liftIO $ evaluate $ force v) $
1180
+ \ (e :: SomeException ) -> do
1181
+ pure (Nothing , ([ideErrorText file $ T. pack $ show e | not $ isBadDependency e],Nothing ))
1182
+ case getSourceFileOrigin file of
1183
+ FromProject -> doAction
1184
+ FromDependency -> case eqT @ k @ GetHieAst of
1185
+ Just Refl -> doAction
1186
+ Nothing -> error $
1187
+ " defineEarlyCutoff': Undefined action for dependency source files\n "
1188
+ ++ show file ++ " \n "
1189
+ ++ show key
1182
1190
ver <- estimateFileVersionUnsafely key res file
1183
1191
(bs, res) <- case res of
1184
1192
Nothing -> do
You can’t perform that action at this time.
0 commit comments