Skip to content

Commit 3cb757a

Browse files
committed
Fix ghc-8.8 build
1 parent a10dc72 commit 3cb757a

File tree

1 file changed

+7
-7
lines changed
  • plugins/hls-hlint-plugin/src/Ide/Plugin

1 file changed

+7
-7
lines changed

plugins/hls-hlint-plugin/src/Ide/Plugin/Hlint.hs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,17 +202,17 @@ getIdeas nfp = do
202202
Just <$> (liftIO $ parseModuleEx flags' fp contents')
203203

204204
setExtensions flags = do
205-
hlintExts <- getExtensions
205+
hlintExts <- getExtensions flags nfp
206206
logm $ "hlint:getIdeas:setExtensions:" ++ show hlintExts
207207
return $ flags { enabledExtensions = hlintExts }
208208

209-
getExtensions :: Action [Extension]
210-
getExtensions = do
209+
getExtensions :: ParseFlags -> NormalizedFilePath -> Action [Extension]
210+
getExtensions pflags nfp = do
211211
hsc <- hscEnv <$> use_ GhcSession nfp
212212
let dflags = hsc_dflags hsc
213213
let hscExts = EnumSet.toList (extensionFlags dflags)
214214
let hscExts' = mapMaybe (GhclibParserEx.readExtension . show) hscExts
215-
let hlintExts = nub $ enabledExtensions flags ++ hscExts'
215+
let hlintExts = nub $ enabledExtensions pflags ++ hscExts'
216216
return hlintExts
217217
#endif
218218

@@ -378,9 +378,9 @@ applyHint ide nfp mhint =
378378
liftIO $ withSystemTempFile (takeFileName fp) $ \temp h -> do
379379
hClose h
380380
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`
384384
[ Handler $ \e -> return (Left (show (e :: IOException)))
385385
, Handler $ \e -> return (Left (show (e :: ErrorCall)))
386386
]

0 commit comments

Comments
 (0)