https://github.com/sourcegraph/lsif-test
Language Server Index Format Test Utilities
https://github.com/sourcegraph/lsif-test
graphviz-dot lsif validate visualize
Last synced: about 1 month ago
JSON representation
Language Server Index Format Test Utilities
- Host: GitHub
- URL: https://github.com/sourcegraph/lsif-test
- Owner: sourcegraph
- License: mit
- Archived: true
- Created: 2019-10-03T15:16:40.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-03-03T21:18:26.000Z (almost 5 years ago)
- Last Synced: 2025-10-20T07:42:53.786Z (4 months ago)
- Topics: graphviz-dot, lsif, validate, visualize
- Language: Go
- Homepage:
- Size: 138 KB
- Stars: 10
- Watchers: 60
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ⚠️ This project has been merged into [github.com/sourcegraph/sourcegraph](https://github.com/sourcegraph/sourcegraph) ⚠️
# LSIF development and testing utilities
## Install
Assumes a working Go installation:
```
# lsif-validate
go get github.com/sourcegraph/lsif-test/cmd/lsif-validate
# lsif-visualize
go get github.com/sourcegraph/lsif-test/cmd/lsif-visualize
```
Resulting binary should then be in your `$GOPATH/bin` (conventionally `$HOME/go/bin`), so make sure thats in your `$PATH` or else invoke using absolute/relative location.
Binary releases coming soon™️
## lsif-validate
This command validates the output of an LSIF indexer. The following properties are validated:
- Element IDs are unique
- All references of element occur after its definition
- A single metadata vertex exists and is the firsts element in the dump
- The project root is a valid URL
- Each document URI is a URL relative to the project root
- Each range vertex has sane bounds (non-negative line/character values and the ending position occurs strictly after the starting position)
- 1-to-n edges have a non-empty `inVs` array
- Edges refer to identifiers attached to the correct element type, as follows:
| label | inV(s) | outV | condition |
| ------------------------- | -------------------------- | ------------------- | --------- |
| `contains` | `range` | | if outV is a `document` |
| `item` | `range` | | |
| `item` | `referenceResult` | | if outV is a `referenceResult` |
| `next` | `resultSet` | `range`/`resultSet` | |
| `textDocument/definition` | `definitionResult` | `range`/`resultSet` | |
| `textDocument/references` | `referenceResult` | `range`/`resultSet` | |
| `textDocument/hover` | `hoverResult` | `range`/`resultSet` | |
| `moniker` | `moniker` | `range`/`resultSet` | |
| `nextMoniker` | `moniker` | `moniker` | |
| `packageInformation` | `packageInformation` | `moniker` | |
- Each vertex is reachable from a range or document vertex (*ignored: metadata, project, document, and event vertices*)
- Each range belongs to a unique document
- No two ranges belonging to the same document improperly overlap
- The inVs of each `item` edge belong to that document referred to by the edge's `document` field