File tree 2 files changed +7
-6
lines changed
ghcide/src/Development/IDE
2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ import ConLike
53
53
import GhcPlugins (
54
54
flLabel ,
55
55
unpackFS )
56
+ import Data.Either (fromRight )
56
57
57
58
-- From haskell-ide-engine/hie-plugin-api/Haskell/Ide/Engine/Context.hs
58
59
@@ -337,14 +338,14 @@ cacheDataProducer packageState curMod rdrEnv limports deps = do
337
338
name' <- lookupName packageState m n
338
339
return $ name' >>= safeTyThingForRecord
339
340
340
- let recordCompls = case either ( const Nothing ) id record_ty of
341
+ let recordCompls = case fromRight Nothing record_ty of
341
342
Just (ctxStr, flds) -> case flds of
342
343
[] -> []
343
344
_ -> [mkRecordSnippetCompItem ctxStr flds (ppr mn) docs imp']
344
345
Nothing -> []
345
346
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
348
349
349
350
(unquals,quals) <- getCompls rdrElts
350
351
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ mkDocMap env sources rm this_mod =
69
69
70
70
lookupKind :: HscEnv -> Module -> Name -> IO (Maybe TyThing )
71
71
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
73
73
74
74
getDocumentationTryGhc :: HscEnv -> Module -> [ParsedModule ] -> Name -> IO SpanDoc
75
75
getDocumentationTryGhc env mod deps n = head <$> getDocumentationsTryGhc env mod deps [n]
@@ -88,7 +88,7 @@ getDocumentationsTryGhc env mod sources names = do
88
88
89
89
mkSpanDocText name =
90
90
SpanDocText (getDocumentation sources name) <$> getUris name
91
-
91
+
92
92
-- Get the uris to the documentation and source html pages if they exist
93
93
getUris name = do
94
94
let df = hsc_dflags env
@@ -221,6 +221,6 @@ lookupHtmlForModule mkDocPath df m = do
221
221
222
222
lookupHtmls :: DynFlags -> UnitId -> Maybe [FilePath ]
223
223
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
225
225
-- and therefore doesn't expand $topdir on Windows
226
226
map takeDirectory . haddockInterfaces <$> lookupPackage df ui
You can’t perform that action at this time.
0 commit comments