Skip to content

Leverage last apply-refact improvements in hlint plugin (include getParsedModuleWithComments in ghcide) #635

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Jan 14, 2021
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5be067e
Use last apply-refact for cabal
jneira Nov 17, 2020
cf508ba
Add ghc-exactprint as dependency
jneira Nov 21, 2020
9b6395f
Leverage apply-refact improvements
jneira Nov 21, 2020
1416d62
Inline utility function
jneira Nov 21, 2020
aa2dd1a
Fix build for ghc < 8.10
jneira Nov 23, 2020
7328e3b
Fix ghc-8.8 build
jneira Nov 26, 2020
cffaa4f
Reparse extensions to remove invalid ones
jneira Nov 27, 2020
899230d
Restore hlint test changing doc content
jneira Dec 19, 2020
6db91f3
Remove knownBroken for ghc < 8.10
jneira Dec 19, 2020
d02380d
Rename GHC_LIB cpp option
jneira Dec 19, 2020
86d1efe
Extract dflags from ModSummary
jneira Dec 22, 2020
0fecd88
Catch errors in the 8.10 code path
jneira Dec 22, 2020
1dace14
Test apply-refact preserve comments
jneira Dec 23, 2020
f6c5d77
Use rigidLayout (like apply-refact itself)
jneira Dec 23, 2020
940f414
Create shake getParsedModuleWithCommentsRule
jneira Dec 29, 2020
ceeeabc
Use ghcide with getParsedModuleWithComments in hlint
jneira Dec 29, 2020
8a7f68c
Restore utility function
jneira Jan 8, 2021
f17448e
Fix getParsedModuleWithComments and add comments
jneira Jan 12, 2021
df20702
Used apply-refact HEAD
jneira Jan 13, 2021
7144430
Use again apply-refact 4fbd3a
jneira Jan 13, 2021
88852f0
Use ghc-exactprint-0.6.3.3
jneira Jan 13, 2021
decf082
Test comment inside refactoring
jneira Jan 13, 2021
8434386
Merge branch 'master' into apply-refact-exts
jneira Jan 14, 2021
c16f516
Update hackage index to invalidate gha cache
jneira Jan 14, 2021
a0b3e4d
Invalidate cache using versioning
jneira Jan 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Reparse extensions to remove invalid ones
  • Loading branch information
jneira committed Jan 11, 2021
commit cffaa4fc05b6be565bc0601dcdcbcc63f34a0bdf
5 changes: 4 additions & 1 deletion plugins/hls-hlint-plugin/src/Ide/Plugin/Hlint.hs
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,10 @@ applyHint ide nfp mhint =
writeFileUTF8NoNewLineTranslation temp oldContent
(pflags, _, _) <- runAction' $ useNoFile_ GetHlintSettings
exts <- runAction' $ getExtensions pflags nfp
(Right <$> applyRefactorings Nothing commands temp (map show exts)) `catches`
-- We have to reparse extensions to remove the invalid ones
let (enabled, disabled, _invalid) = parseExtensions $ map show exts
let refactExts = map show $ enabled ++ disabled
(Right <$> applyRefactorings Nothing commands temp refactExts) `catches`
[ Handler $ \e -> return (Left (show (e :: IOException)))
, Handler $ \e -> return (Left (show (e :: ErrorCall)))
]
Expand Down