Skip to content

Commit

Permalink
Added go-to definition for function aliases and composites
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacShelton committed Feb 12, 2024
1 parent f7070cc commit 985d45a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/main.adept
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,26 @@ func getDefinitionsFor(document *Document, identifier String) JSON {
}
}

each FunctionAlias in document.function_aliases {
if it.symbol.name == identifier {
location <Location> Optional = it.symbol.source.toLocation()

if location.has {
result.add(location.value.toJSON())
}
}
}

each Composite in document.composites {
if it.symbol.name == identifier {
location <Location> Optional = it.symbol.source.toLocation()

if location.has {
result.add(location.value.toJSON())
}
}
}

return result.commit()
}

0 comments on commit 985d45a

Please sign in to comment.