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