LSIF diagnostics GraphQL API proposal
Created by: felixfbecker
This is a GraphQL API to query LSIF diagnostics, which would be used by code insights and can also be displayed in the UI when browsing files (#4102).
Code insights will query diagnostics.pageInfo.totalCount
for 7 past revisions on the current directory (which may be the root directory of the repo), for a specific tool (e.g. the ESLint extension would filter to eslint
).
The blob component would query diagnostics on the current file with ranges, messages, source and severity.
References:
- https://microsoft.github.io/language-server-protocol/specifications/specification-current/#diagnostic
- https://github.com/microsoft/language-server-protocol/blob/master/indexFormat/specification.md#request-textdocumentdiagnostic
Differences:
- Used
Location
instead ofRange
to expose the file path - Omitted
relatedInformation
for now for simplicity - Made
code
always a string because GraphQL does not support scalar union types (backend can convert numbers to strings) - Enums are GraphQL enums
- Made
tags
non-nullable, they are only optional in LSP for BC, backend can fill them with empty list if not provided
Future extensions of this would be:
- Querying diagnostic counts across all repositories
- Easy/performant way to query data at multiple past points in time at once
- Filter by severity etc.