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 cdefac2 commit cf69ce5Copy full SHA for cf69ce5
ghcide/src/Development/IDE/Spans/AtPoint.hs
@@ -316,7 +316,10 @@ atPoint IdeOptions{} (HAR _ hf _ _ (kind :: HieKind hietype)) (DKMap dm km) env
316
instancesForName :: IO (Maybe [ClsInst])
317
instancesForName = runMaybeT $ do
318
typ <- MaybeT . pure $ lookupNameEnv km n >>= tyThingAsDataType
319
- liftIO $ evalGhcEnv env $ getInstancesForType typ
+ clsInst <- liftIO $ evalGhcEnv env $ getInstancesForType typ
320
+ -- Avoid creating an empty wrapped section if no instances are found
321
+ guard $ not $ null clsInst
322
+ return clsInst
323
324
-- | Gets the datatype `Type` corresponding to a TyThing, if it repressents a datatype or
325
-- a data constructor.
0 commit comments