Skip to content

codeintel: add explicit support for MarkupContent in lsif/protocol & optimize hover ingestion

Warren Gifford requested to merge nsc/codeintel-markup-content into main

Created by: Strum355

This PR looks like it does a lot more than it actually does. Its mostly a minor reorganization, allowing for a nicer unmarshalling into either a MarkedString or MarkupContent (sum types when 😿).

As part of the reorganization, it has been made (almost) possible for lsif-go to also adopt MarkupContent instead, by changing hoverResult to take an fmt.Stringer and making the three types implement it (sum types/sealed types when 😿). The API which lsif-go currently uses to emit hovers still expects MarkedStrings, we can change that too in this PR if so desired.

There are ramifications of course, if someone uses an indexer that emits MarkupContent but is on an older sourcegraph instance that was not MarkupContent aware. Im not sure how we can tackle that without never being able to move indexers away from MarkedString.

Note: this is a first draft and is a bit rough on the eyes in certain areas. Ill revisit again tomorrow to slap some makeup on it

Obligatory screenie: image

Merge request reports

Loading