@@ -201,17 +201,17 @@ getIdeas nfp = do
201
201
Just <$> (liftIO $ parseModuleEx flags' fp contents')
202
202
203
203
setExtensions flags = do
204
- hlintExts <- getExtensions
204
+ hlintExts <- getExtensions flags nfp
205
205
logm $ " hlint:getIdeas:setExtensions:" ++ show hlintExts
206
206
return $ flags { enabledExtensions = hlintExts }
207
207
208
- getExtensions :: Action [Extension ]
209
- getExtensions = do
208
+ getExtensions :: ParseFlags -> NormalizedFilePath -> Action [Extension ]
209
+ getExtensions pflags nfp = do
210
210
hsc <- hscEnv <$> use_ GhcSession nfp
211
211
let dflags = hsc_dflags hsc
212
212
let hscExts = EnumSet. toList (extensionFlags dflags)
213
213
let hscExts' = mapMaybe (GhclibParserEx. readExtension . show ) hscExts
214
- let hlintExts = nub $ enabledExtensions flags ++ hscExts'
214
+ let hlintExts = nub $ enabledExtensions pflags ++ hscExts'
215
215
return hlintExts
216
216
#endif
217
217
@@ -377,9 +377,9 @@ applyHint ide nfp mhint =
377
377
liftIO $ withSystemTempFile (takeFileName fp) $ \ temp h -> do
378
378
hClose h
379
379
writeFileUTF8NoNewLineTranslation temp oldContent
380
- let exts = runAction' getExtensions
381
- ( Right <$> applyRefactorings Nothing commands temp exts)
382
- `catches`
380
+ (pflags, _, _) <- runAction' $ useNoFile_ GetHlintSettings
381
+ exts <- runAction' $ getExtensions pflags nfp
382
+ ( Right <$> applyRefactorings Nothing commands temp ( map show exts)) `catches`
383
383
[ Handler $ \ e -> return (Left (show (e :: IOException )))
384
384
, Handler $ \ e -> return (Left (show (e :: ErrorCall )))
385
385
]
0 commit comments