Skip to content

Commit c9185bc

Browse files
committed
patch ast
1 parent ffef347 commit c9185bc

File tree

4 files changed

+2140
-3
lines changed

4 files changed

+2140
-3
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ import Data.Version (showVersion)
5656
import Development.IDE.Types.Shake (WithHieDb)
5757
import HieDb hiding (pointCommand)
5858
import System.Directory (doesFileExist)
59+
import Debug.Trace
5960

6061
-- | Gives a Uri for the module, given the .hie file location and the the module info
6162
-- The Bool denotes if it is a boot module
@@ -214,7 +215,7 @@ atPoint
214215
atPoint IdeOptions{} (HAR _ hf _ _ kind) (DKMap dm km) env pos = listToMaybe $ pointCommand hf pos hoverInfo
215216
where
216217
-- Hover info for values/data
217-
hoverInfo ast = (Just range, prettyNames ++ pTypes)
218+
hoverInfo ast = trace (T.unpack prettyAST) (Just range, prettyNames ++ pTypes)
218219
where
219220
pTypes
220221
| Prelude.length names == 1 = dropEnd1 $ map wrapHaskell prettyTypes
@@ -254,6 +255,10 @@ atPoint IdeOptions{} (HAR _ hf _ _ kind) (DKMap dm km) env pos = listToMaybe $ p
254255
HieFresh -> printOutputable t
255256
HieFromDisk full_file -> printOutputable $ hieTypeToIface $ recoverFullType t (hie_types full_file)
256257

258+
prettyAST = case kind of
259+
HieFresh -> printOutputable ast
260+
HieFromDisk full_file -> ""
261+
257262
definedAt name =
258263
-- do not show "at <no location info>" and similar messages
259264
-- see the code of 'pprNameDefnLoc' for more information

hie-compat/hie-compat.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ library
4747
if (impl(ghc > 8.9) && impl(ghc < 8.11))
4848
hs-source-dirs: src-ghc810 src-reexport
4949
if (impl(ghc >= 9.0) && impl(ghc < 9.1) || flag(ghc-lib))
50-
hs-source-dirs: src-reexport-ghc9
50+
hs-source-dirs: src-ghc90 src-reexport-ghc9
5151
if (impl(ghc >= 9.2) && impl(ghc < 9.3))
52-
hs-source-dirs: src-reexport-ghc9
52+
hs-source-dirs: src-ghc92 src-reexport-ghc9

0 commit comments

Comments
 (0)