-
-
Notifications
You must be signed in to change notification settings - Fork 368
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
Enable pedantic for more components #4061
Conversation
@@ -72,5 +72,3 @@ if impl(ghc >= 9.7) | |||
-- this is okay | |||
allow-newer: | |||
ekg-core:text, | |||
-- https://github.com/haskell-primitive/primitive-unlifted/issues/39 | |||
primitive-unlifted:bytestring, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like primitive-unlifted is not used by anything anymore, so removing it from here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a transitive dependency, but if it works then it works!
indirectOldNames <- concat . filter ((>1) . Prelude.length) <$> | ||
mapM (uncurry (getNamesAtPos state) . locToFilePos) directRefs | ||
indirectOldNames <- concat . filter notNull <$> | ||
mapM (uncurry (getNamesAtPos state)) (mapMaybe locToFilePos directRefs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed locToFilePos (see definition below) to return Maybe.
I hope that silently ignoring paths for which uriToNormalizedFilePath
returns Nothing, rather than crashing is ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I think we might want to fail the rename, because that means there's a potential reference that we couldn't resolve, so we might not be doing a correct rename.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just add a comment at least.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, will dive a bit into how this works and get back to this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I found there's a dedicated getNormalizedFilePathE
that does Uri -> NormalizeFilePath translation and throws PluginError when this fails. I switched to using that because it sounds cleaner/more informative than pattern match error..
indirectOldNames <- concat . filter ((>1) . Prelude.length) <$> | ||
mapM (uncurry (getNamesAtPos state) . locToFilePos) directRefs | ||
indirectOldNames <- concat . filter notNull <$> | ||
mapM (uncurry (getNamesAtPos state)) (mapMaybe locToFilePos directRefs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I think we might want to fail the rename, because that means there's a potential reference that we couldn't resolve, so we might not be doing a correct rename.
indirectOldNames <- concat . filter ((>1) . Prelude.length) <$> | ||
mapM (uncurry (getNamesAtPos state) . locToFilePos) directRefs | ||
indirectOldNames <- concat . filter notNull <$> | ||
mapM (uncurry (getNamesAtPos state)) (mapMaybe locToFilePos directRefs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just add a comment at least.
cbfe71a
to
1391769
Compare
No description provided.