Skip to content

Commit 55893d7

Browse files
committed
Fix unrelated hlints
Not sure why these are triggering now. Linting should be restricted to the Diff ...
1 parent 4f1edbb commit 55893d7

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

ghcide/src/Development/IDE/Plugin/Completions/Logic.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import ConLike
5353
import GhcPlugins (
5454
flLabel,
5555
unpackFS)
56+
import Data.Either (fromRight)
5657

5758
-- From haskell-ide-engine/hie-plugin-api/Haskell/Ide/Engine/Context.hs
5859

@@ -337,14 +338,14 @@ cacheDataProducer packageState curMod rdrEnv limports deps = do
337338
name' <- lookupName packageState m n
338339
return $ name' >>= safeTyThingForRecord
339340

340-
let recordCompls = case either (const Nothing) id record_ty of
341+
let recordCompls = case fromRight Nothing record_ty of
341342
Just (ctxStr, flds) -> case flds of
342343
[] -> []
343344
_ -> [mkRecordSnippetCompItem ctxStr flds (ppr mn) docs imp']
344345
Nothing -> []
345346

346-
return $ [mkNameCompItem n mn (either (const Nothing) id ty) Nothing docs imp'] ++
347-
recordCompls
347+
return $ mkNameCompItem n mn (fromRight Nothing ty) Nothing docs imp'
348+
: recordCompls
348349

349350
(unquals,quals) <- getCompls rdrElts
350351

ghcide/src/Development/IDE/Spans/Documentation.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ mkDocMap env sources rm this_mod =
6969

7070
lookupKind :: HscEnv -> Module -> Name -> IO (Maybe TyThing)
7171
lookupKind env mod =
72-
fmap (either (const Nothing) id) . catchSrcErrors (hsc_dflags env) "span" . lookupName env mod
72+
fmap (fromRight Nothing) . catchSrcErrors (hsc_dflags env) "span" . lookupName env mod
7373

7474
getDocumentationTryGhc :: HscEnv -> Module -> [ParsedModule] -> Name -> IO SpanDoc
7575
getDocumentationTryGhc env mod deps n = head <$> getDocumentationsTryGhc env mod deps [n]
@@ -88,7 +88,7 @@ getDocumentationsTryGhc env mod sources names = do
8888

8989
mkSpanDocText name =
9090
SpanDocText (getDocumentation sources name) <$> getUris name
91-
91+
9292
-- Get the uris to the documentation and source html pages if they exist
9393
getUris name = do
9494
let df = hsc_dflags env
@@ -221,6 +221,6 @@ lookupHtmlForModule mkDocPath df m = do
221221

222222
lookupHtmls :: DynFlags -> UnitId -> Maybe [FilePath]
223223
lookupHtmls df ui =
224-
-- use haddockInterfaces instead of haddockHTMLs: GHC treats haddockHTMLs as URL not path
224+
-- use haddockInterfaces instead of haddockHTMLs: GHC treats haddockHTMLs as URL not path
225225
-- and therefore doesn't expand $topdir on Windows
226226
map takeDirectory . haddockInterfaces <$> lookupPackage df ui

0 commit comments

Comments
 (0)