@@ -3,6 +3,7 @@ module Development.IDE.Core.Actions
33( getAtPoint
44, getDefinition
55, getTypeDefinition
6+ , getImplementationDefinition
67, highlightAtPoint
78, refsAtPoint
89, workspaceSymbols
@@ -98,7 +99,7 @@ getDefinition :: NormalizedFilePath -> Position -> IdeAction (Maybe [(Location,
9899getDefinition file pos = runMaybeT $ do
99100 ide@ ShakeExtras { withHieDb, hiedbWriter } <- ask
100101 opts <- liftIO $ getIdeOptionsIO ide
101- (HAR _ hf _ _ _ , mapping) <- useWithStaleFastMT GetHieAst file
102+ (hf , mapping) <- useWithStaleFastMT GetHieAst file
102103 (ImportMap imports, _) <- useWithStaleFastMT GetImportMap file
103104 ! pos' <- MaybeT (pure $ fromCurrentPosition mapping pos)
104105 locationsWithIdentifier <- AtPoint. gotoDefinition withHieDb (lookupMod hiedbWriter) opts imports hf pos'
@@ -120,6 +121,15 @@ getTypeDefinition file pos = runMaybeT $ do
120121 pure $ Just (fixedLocation, identifier)
121122 ) locationsWithIdentifier
122123
124+ getImplementationDefinition :: NormalizedFilePath -> Position -> IdeAction (Maybe [Location ])
125+ getImplementationDefinition file pos = runMaybeT $ do
126+ ide@ ShakeExtras { withHieDb, hiedbWriter } <- ask
127+ opts <- liftIO $ getIdeOptionsIO ide
128+ (hf, mapping) <- useWithStaleFastMT GetHieAst file
129+ ! pos' <- MaybeT (pure $ fromCurrentPosition mapping pos)
130+ locs <- AtPoint. gotoImplementation withHieDb (lookupMod hiedbWriter) opts hf pos'
131+ traverse (MaybeT . toCurrentLocation mapping file) locs
132+
123133highlightAtPoint :: NormalizedFilePath -> Position -> IdeAction (Maybe [DocumentHighlight ])
124134highlightAtPoint file pos = runMaybeT $ do
125135 (HAR _ hf rf _ _,mapping) <- useWithStaleFastMT GetHieAst file
0 commit comments