We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e80d081 commit 39a6e25Copy full SHA for 39a6e25
ghcide/src/Development/IDE/Spans/AtPoint.hs
@@ -318,7 +318,10 @@ atPoint IdeOptions{} (HAR _ hf _ _ (kind :: HieKind hietype)) (DKMap dm km) env
318
instancesForName :: IO (Maybe [ClsInst])
319
instancesForName = runMaybeT $ do
320
typ <- MaybeT . pure $ lookupNameEnv km n >>= tyThingAsDataType
321
- liftIO $ evalGhcEnv env $ getInstancesForType typ
+ clsInst <- liftIO $ evalGhcEnv env $ getInstancesForType typ
322
+ -- Avoid creating an empty wrapped section if no instances are found
323
+ guard $ not $ null clsInst
324
+ return clsInst
325
326
-- | Gets the datatype `Type` corresponding to a TyThing, if it repressents a datatype or
327
-- a data constructor.
0 commit comments