File tree 2 files changed +6
-4
lines changed
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1652,7 +1652,7 @@ lookupName :: HscEnv
1652
1652
-> IO (Maybe TyThing )
1653
1653
lookupName _ name
1654
1654
| Nothing <- nameModule_maybe name = pure Nothing
1655
- lookupName hsc_env name = do
1655
+ lookupName hsc_env name = handle $ do
1656
1656
#if MIN_VERSION_ghc(9,2,0)
1657
1657
mb_thing <- liftIO $ lookupType hsc_env name
1658
1658
#else
@@ -1671,6 +1671,8 @@ lookupName hsc_env name = do
1671
1671
case res of
1672
1672
Util. Succeeded x -> return (Just x)
1673
1673
_ -> return Nothing
1674
+ where
1675
+ handle x = x `catch` \ (_ :: IOEnvFailure ) -> pure Nothing
1674
1676
1675
1677
pathToModuleName :: FilePath -> ModuleName
1676
1678
pathToModuleName = mkModuleName . map rep
Original file line number Diff line number Diff line change @@ -1983,7 +1983,7 @@ completionDocTests =
1983
1983
, " foo = ()"
1984
1984
, " bar = fo"
1985
1985
]
1986
- test doc (Position 3 8 ) " foo" Nothing [" *Defined at line 3, column 1 in this module*\n * * *\n docdoc\n " ]
1986
+ test doc (Position 3 8 ) " foo" Nothing [" *Defined at line 3, column 1 in this module*\n * * *\n\n\ n docdoc\n " ]
1987
1987
, testSession " local multi line doc with '\\ n'" $ do
1988
1988
doc <- createDoc " A.hs" " haskell" $ T. unlines
1989
1989
[ " module A where"
@@ -1992,7 +1992,7 @@ completionDocTests =
1992
1992
, " foo = ()"
1993
1993
, " bar = fo"
1994
1994
]
1995
- test doc (Position 4 8 ) " foo" Nothing [" *Defined at line 4, column 1 in this module*\n * * *\n abcabc \n " ]
1995
+ test doc (Position 4 8 ) " foo" Nothing [" *Defined at line 4, column 1 in this module*\n * * *\n\n\n abcabc \n " ]
1996
1996
, testSession " local multi line doc without '\\ n'" $ do
1997
1997
doc <- createDoc " A.hs" " haskell" $ T. unlines
1998
1998
[ " module A where"
@@ -2002,7 +2002,7 @@ completionDocTests =
2002
2002
, " foo = ()"
2003
2003
, " bar = fo"
2004
2004
]
2005
- test doc (Position 5 8 ) " foo" Nothing [" *Defined at line 5, column 1 in this module*\n * * *\n abcabc \n\n def\n " ]
2005
+ test doc (Position 5 8 ) " foo" Nothing [" *Defined at line 5, column 1 in this module*\n * * *\n\n\n abcabc \n\n def\n " ]
2006
2006
, testSession " extern empty doc" $ do
2007
2007
doc <- createDoc " A.hs" " haskell" $ T. unlines
2008
2008
[ " module A where"
You can’t perform that action at this time.
0 commit comments