Skip to content

Commit 61eb263

Browse files
committed
Use ghcide with getParsedModuleWithComments in hlint
1 parent e42f72e commit 61eb263

File tree

1 file changed

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

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import qualified Data.Text as T
3434
import qualified Data.Text.IO as T
3535
import Data.Typeable
3636
import Development.IDE
37-
import Development.IDE.Core.Rules (defineNoFile)
37+
import Development.IDE.Core.Rules (getParsedModuleWithComments, defineNoFile)
3838
import Development.IDE.Core.Shake (getDiagnostics)
3939

4040
#ifdef HLINT_ON_GHC_LIB
@@ -395,7 +395,7 @@ applyHint ide nfp mhint =
395395
(Right <$> applyRefactorings Nothing commands temp refactExts)
396396
`catches` errorHandlers
397397
#else
398-
mbParsedModule <- liftIO $ runAction' $ getParsedModule nfp
398+
mbParsedModule <- liftIO $ runAction' $ getParsedModuleWithComments nfp
399399
res <-
400400
case mbParsedModule of
401401
Nothing -> throwE "Apply hint: error parsing the module"
@@ -404,6 +404,7 @@ applyHint ide nfp mhint =
404404
let modu = pm_parsed_source pm
405405
(modsum, _) <- liftIO $ runAction' $ use_ GetModSummary nfp
406406
let dflags = ms_hspp_opts modsum
407+
-- apply-refact uses RigidLayout
407408
let rigidLayout = deltaOptions RigidLayout
408409
(anns', modu') <-
409410
ExceptT $ return $ postParseTransform (Right (anns, [], dflags, modu)) rigidLayout

0 commit comments

Comments
 (0)