@@ -58,7 +58,10 @@ import Ide.Plugin.Cabal.Completion.Types
58
58
( ParseCabalCommonSections (ParseCabalCommonSections ),
59
59
ParseCabalFields (.. ),
60
60
ParseCabalFile (.. ),
61
- ParsePlanJson (.. ), BuildDependencyVersionMapping (.. ), Versioned (.. ),
61
+ ParsePlanJson (.. ),
62
+ BuildDependencyVersionMapping (.. ),
63
+ Positioned (.. ),
64
+ SimpleDependency (.. )
62
65
)
63
66
import Ide.Plugin.Cabal.Completion.Types qualified as Types
64
67
import Ide.Plugin.Cabal.Definition (gotoDefinition )
@@ -76,7 +79,6 @@ import Language.LSP.Protocol.Message qualified as LSP
76
79
import Language.LSP.Protocol.Types
77
80
import Language.LSP.VFS qualified as VFS
78
81
import Text.Regex.TDFA
79
- import Debug.Trace
80
82
import System.FilePath ((</>) )
81
83
82
84
data Log
@@ -449,15 +451,15 @@ lens state _plId clp = do
449
451
planDeps <- runActionE " cabal.cabal-lens" state $ useE BuildDependencyVersionMapping planJson
450
452
451
453
let lenses = Maybe. mapMaybe
452
- ( \ p @ ( PositionedDependency _ name) -> getCodeLens . Versioned p <$> Map. lookup name planDeps)
453
- positionedDeps
454
+ ( \ ( Positioned pos name) -> getCodeLens . Positioned pos . Dependency name <$> Map. lookup name planDeps)
455
+ positionedDeps
454
456
455
457
pure $ InL lenses
456
458
else
457
459
pure $ InL []
458
460
where
459
- getCodeLens :: Versioned PositionedDependency -> CodeLens
460
- getCodeLens (Versioned ( PositionedDependency pos _) v ) =
461
+ getCodeLens :: Positioned SimpleDependency -> CodeLens
462
+ getCodeLens (Positioned pos ( Dependency _ v) ) =
461
463
let cPos = Types. cabalPositionToLSPPosition pos in CodeLens
462
464
{ _range = Range cPos cPos
463
465
, _command = Just $ mkActionlessCommand v
@@ -490,16 +492,16 @@ hint state _plId clp =
490
492
let planJson = toNormalizedFilePath $ rfp </> planJsonPath
491
493
planDeps <- runActionE " cabal.cabal-lens" state $ useE BuildDependencyVersionMapping planJson
492
494
493
- let hints = Maybe. mapMaybe
494
- (\ p @ ( PositionedDependency _ name) -> getInlayHint . Versioned p <$> Map. lookup name planDeps)
495
+ let lenses = Maybe. mapMaybe
496
+ (\ ( Positioned pos name) -> getInlayHint . Positioned pos . Dependency name <$> Map. lookup name planDeps)
495
497
positionedDeps
496
498
497
- pure $ InL hints
499
+ pure $ InL lenses
498
500
else
499
501
pure $ InL []
500
502
where
501
- getInlayHint :: Versioned PositionedDependency -> InlayHint
502
- getInlayHint (Versioned ( PositionedDependency pos _) v ) = InlayHint
503
+ getInlayHint :: Positioned SimpleDependency -> InlayHint
504
+ getInlayHint (Positioned pos ( Dependency _ v) ) = InlayHint
503
505
{ _position = Types. cabalPositionToLSPPosition pos
504
506
, _label = InL v
505
507
, _kind = Nothing
0 commit comments