Skip to content

Commit afb8dfb

Browse files
committed
Development.IDE.Spans.AtPoint: atPoint: clarify local fun
1 parent 1f37f66 commit afb8dfb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ghcide/src/Development/IDE/Spans/AtPoint.hs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,12 +209,12 @@ atPoint
209209
-> Maybe (Maybe Range, [T.Text])
210210
atPoint IdeOptions{} (HAR _ hf _ _ kind) (DKMap dm km) env pos = listToMaybe $ pointCommand hf pos hoverInfo
211211
where
212-
-- Hover info for values/data
212+
-- | Get hover info for values/data
213213
hoverInfo ast = (Just range, prettyNames ++ pTypes)
214214
where
215215
pTypes
216-
| Prelude.length names == 1 = dropEnd1 $ map wrapHaskell prettyTypes
217-
| otherwise = map wrapHaskell prettyTypes
216+
| Prelude.length names == 1 = dropEnd1 $ map wrapHaskell prettyConcreteTypes
217+
| otherwise = map wrapHaskell prettyConcreteTypes
218218

219219
range = realSrcSpanToRange $ nodeSpan ast
220220

@@ -242,11 +242,13 @@ atPoint IdeOptions{} (HAR _ hf _ _ kind) (DKMap dm km) env pos = listToMaybe $ p
242242
version = T.pack $ showVersion (unitPackageVersion conf)
243243
pure $ " *(" <> pkgName <> "-" <> version <> ")*"
244244

245-
prettyTypes = map (("_ :: "<>) . prettyType) types
246245
prettyType t = case kind of
247246
HieFresh -> showGhc t
248247
HieFromDisk full_file -> showGhc $ hieTypeToIface $ recoverFullType t (hie_types full_file)
249248

249+
-- | Local inferred most concrete type signature.
250+
prettyConcreteTypes = map (("_ :: "<>) . prettyType) types
251+
250252
definedAt name =
251253
-- do not show "at <no location info>" and similar messages
252254
-- see the code of 'pprNameDefnLoc' for more information

0 commit comments

Comments
 (0)