Skip to content

Commit

Permalink
Fix unrelated hlints
Browse files Browse the repository at this point in the history
Not sure why these are triggering now.

Linting should be restricted to the Diff ...
  • Loading branch information
pepeiborra committed Dec 30, 2020
1 parent 4f1edbb commit 55893d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions ghcide/src/Development/IDE/Plugin/Completions/Logic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import ConLike
import GhcPlugins (
flLabel,
unpackFS)
import Data.Either (fromRight)

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

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

let recordCompls = case either (const Nothing) id record_ty of
let recordCompls = case fromRight Nothing record_ty of
Just (ctxStr, flds) -> case flds of
[] -> []
_ -> [mkRecordSnippetCompItem ctxStr flds (ppr mn) docs imp']
Nothing -> []

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

(unquals,quals) <- getCompls rdrElts

Expand Down
6 changes: 3 additions & 3 deletions ghcide/src/Development/IDE/Spans/Documentation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ mkDocMap env sources rm this_mod =

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

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

mkSpanDocText name =
SpanDocText (getDocumentation sources name) <$> getUris name

-- Get the uris to the documentation and source html pages if they exist
getUris name = do
let df = hsc_dflags env
Expand Down Expand Up @@ -221,6 +221,6 @@ lookupHtmlForModule mkDocPath df m = do

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

0 comments on commit 55893d7

Please sign in to comment.