Skip to content

Commit 3300763

Browse files
committed
Fix ghc-8.8 build
1 parent 25d1583 commit 3300763

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
@@ -201,17 +201,17 @@ getIdeas nfp = do
201201
Just <$> (liftIO $ parseModuleEx flags' fp contents')
202202

203203
setExtensions flags = do
204-
hlintExts <- getExtensions
204+
hlintExts <- getExtensions flags nfp
205205
logm $ "hlint:getIdeas:setExtensions:" ++ show hlintExts
206206
return $ flags { enabledExtensions = hlintExts }
207207

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

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

0 commit comments

Comments
 (0)