Skip to content

API docs: LSIF: add GraphQL backend for "Go to code" / "Usage examples"

Created by: slimsag

Stacked on #22902

This PR adds the GraphQL backend needed to perform definition/references requests on the symbol described in documentation, i.e. at a given pathID like /auth#AuthInfo instead of a regular definition/references request which operates on a file line/column.

This effectively gives us everything we need to add a "Go to code" option to API docs, as well as usage examples (including cross-repo.)

I've chosen to use LSIF references as usage examples, because it gives us all the existing infrastructure and we can defer any complex ranking/upvoting/downvoting/etc of usage examples. Plus, if we do eventually add those, it would benefit both codeintel references and API docs usage examples at the same time. I also plan to share the UI components for displaying these.

Here's an example of a documentationDefinitions request:

image

And here's an example of a documentationReferences request:

image

Signed-off-by: Stephen Gutekanst [email protected]

Merge request reports

Loading