Skip to content

Fix -Wall and -Wunused-packages in hls-class-plugin #3972

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 3 commits into from
Jan 17, 2024

Conversation

jhrcek
Copy link
Collaborator

@jhrcek jhrcek commented Jan 17, 2024

No description provided.

addMethodDecls ps mDecls range withSig
| withSig = go (concatMap (\(decl, sig) -> [sig, decl]) mDecls)
| otherwise = go (map fst mDecls)
where
go inserting = do
allDecls <- hsDecls ps
let (before, ((L l inst): after)) = break (inRange range . getLoc) allDecls
replaceDecls ps (before ++ (L l (addWhere inst)): (map newLine inserting ++ after))
case break (inRange range . getLoc) allDecls of
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and next hunk fix incomplete-uni-patterns warnings.

@@ -190,7 +190,6 @@ getInstanceBindLensRule recorder = do
(locA l) -- bindSpan
(locA l') -- bindNameSpan
in toBindInfo <$> filter (\(L _ name) -> unLoc name `notElem` sigNames) bindNames
getBindSpanWithoutSig _ = []
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing overlapping pattern match.

@michaelpj michaelpj merged commit 78dacc5 into haskell:master Jan 17, 2024
@jhrcek jhrcek deleted the jhrcek/unused-packages-class branch January 19, 2024 04:14
josephsumabat pushed a commit to josephsumabat/haskell-language-server that referenced this pull request Jan 22, 2024
* Fix -Wunused-packages in class plugin

* -Wall and hlint fixes

* Fix type annotation for ghc 9.6+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants