Skip to content

oracle: add function to find all definitionsΒ #8247

@anderseknert

Description

@anderseknert

The entry point to the oracle API is currently the FindDefinition function, which when provided a ref returns the location of its definition.

Both packages and rules can however be defined incrementally across any number of locations, and both the language server protocol and most editors allow a list of locations in response to GTD queries. I suggest we extend the oracle API with a new FindDefinitions function, that does what FindDefinition currently does, but returning all definitions found instead of the first one in the list.

Personally I'm not sure that I'd prefer always getting back a list of locations when clicking to GTD, but probably only in cases where a rule or package is defined across multiple files. But exactly how clients should handle this can be both tweaked and made configurable. OPA should simply allow them to decide for themselves πŸ™‚

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions