sourcegraph / scip

SCIP Code Intelligence Protocol
Apache License 2.0
231 stars 32 forks source link

Include diagnostics in snapshot output #226

Closed jtibshirani closed 6 months ago

jtibshirani commented 6 months ago

This change adds diagnostic information to the snapshot output to support testing. To make it possible to test this in the SCIP repo, it updates the reprolang generator to output a diagnostic for every identifier that starts with 'deprecated'.

Example output:

 reference deprecatedMethod.
#          ^^^^^^^^^^^^^^^^^ reference diagnostics.repro/deprecatedMethod.
#          diagnostic Warning: deprecated identifier

Closes #213

Test plan

New snapshot test to check diagnostics output

jtibshirani commented 6 months ago

This PR is based on https://github.com/sourcegraph/scip/pull/220, with the following differences:

varungandhi-src commented 6 months ago

Nice work. I noticed that we were truncating the multiline output for docs (and you probably copied that for the diagnostic message), which seems like undesirable behavior from the POV of an indexer as you want to make sure the full contents are correct. So I've tweaked that.

varungandhi-src commented 6 months ago

Rebased on include the build failure fix from https://github.com/sourcegraph/scip/pull/228