Skip to content
This repository was archived by the owner on Sep 26, 2023. It is now read-only.

Spike adding deprecations to document symbols #141

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

seanburke-wf
Copy link

@seanburke-wf seanburke-wf commented Apr 8, 2021

While the LSP and LSIF support marking definitions as deprecated, and sourcegraph appears capable of ingesting this data, this is currently not supported by the go indexer.

This PR is not intended for merge; instead, it is meant to provide a proof of concept and forum for discussion. It has several serious shortcomings:

  • Tags are only emitted for top-level definitions (sufficient for deprecation marking but not for the general case)
    Because the indexer uses p.TypesInfo instead of walking the AST, it's unable (as far as I can see) to access the AST to get the necessary information for more tightly-scoped definitions without an ~O(n) tree walk every time we need to look up a definition. I think the AST would be usable for the indexer, but it seems like a sizeable refactor.
  • Label definitions are ignored for tagging purposes due to a lack of appropriate SymbolKind in the spec; type aliases are not ignored, but the mapping is less than ideal
    Collect new SymbolKinds microsoft/language-server-protocol#344 gathers some requested SymbolKind extensions (including typeAlias), but also indicates that the team isn't really looking to expand that list at present.
  • It's incomplete; it's missing some vertices/edges to agree with the LSIF specification
    I think I know what would need to be done for that, but I'm not that well-versed in the spec and it's just a spike, so I figured I could handwave it.
  • It's a spike; it ain't pretty
    Okay, this one is easier to solve.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant