Documentation
¶
Overview ¶
Package scipgraph parses SCIP indexes into storage rows.
Index ¶
- Variables
- func VersionlessSymbolKey(symbol string) ([]byte, error)
- type Definitions
- type DependencyReader
- type Document
- type Location
- type Occurrence
- type OccurrencePosition
- type Package
- type PackageMapping
- type Range
- type Relationship
- type Service
- func (service *Service) Navigate(ctx context.Context, principal authn.Principal, ...) (api.SCIPNavigationResponse, error)
- func (service *Service) RefreshGitHubDependencies(ctx context.Context, principal authn.Principal, repositoryID int64) (api.DependencyRefreshResponse, error)
- func (service *Service) SetDependencies(ctx context.Context, principal authn.Principal, repositoryID int64, ...) error
- func (service *Service) Upload(ctx context.Context, principal authn.Principal, repositoryID int64, ...) error
- func (service *Service) ValidateUpload(ctx context.Context, principal authn.Principal, repositoryID int64, ...) error
- type ServiceStore
- type StoredOccurrence
- type SymbolInformation
- type Upload
Constants ¶
This section is empty.
Variables ¶
var ( ErrForbidden = errors.New("forbidden") ErrInvalidRequest = errors.New("invalid_request") ErrNotIndexed = errors.New("not_indexed") ErrIndexPending = errors.New("index_pending") // Navigate used to collapse all four conditions below into ErrNotIndexed, which // reported a healthy, search-indexed repository as unindexed. They are distinct // causes with distinct operator remedies, so they get distinct sentinels. ErrStaleCommit = errors.New("stale_commit") ErrSCIPStale = errors.New("scip_stale") ErrSymbolNotFound = errors.New("symbol_not_found") )
var ( ErrOccurrenceNotFound = errors.New("SCIP occurrence not found") ErrStaleIndex = errors.New("stale SCIP index") )
var ErrInvalidIndex = errors.New("invalid SCIP index")
Functions ¶
func VersionlessSymbolKey ¶
Types ¶
type Definitions ¶ added in v0.10.0
type Definitions map[string][]Occurrence
Definitions indexes, per document, the non-local definition occurrences that carry an enclosing range, so a reference can be attributed to the declaration whose body contains it.
func (Definitions) Enclosing ¶ added in v0.10.0
func (definitions Definitions) Enclosing(occurrence Occurrence) (Occurrence, bool)
Enclosing returns the innermost definition whose enclosing range contains the occurrence, in the same document. A definition does not enclose its own name token.
type DependencyReader ¶
type Occurrence ¶
type Occurrence struct {
Path, Symbol string
StartLine, StartCharacter, EndLine, EndCharacter int32
PositionEncoding int32
Roles int32
Local bool
// Enclosing is the producer's enclosing_range of a definition: the whole
// declaration, not just its name token. Nil when the producer omits it.
Enclosing *Range
}
func (Occurrence) Definition ¶ added in v0.10.0
func (occurrence Occurrence) Definition() bool
Definition reports whether the occurrence carries the definition role.
type OccurrencePosition ¶
type OccurrencePosition struct {
UTF8, UTF16, UTF32 int
}
type PackageMapping ¶
type Range ¶ added in v0.10.0
type Range struct {
StartLine, StartCharacter, EndLine, EndCharacter int32
}
Range is a zero-based source extent in the document's position encoding.
type Relationship ¶
type Service ¶
type Service struct {
Store ServiceStore
GitHub DependencyReader
MaxResults int
}
func (*Service) Navigate ¶
func (service *Service) Navigate(ctx context.Context, principal authn.Principal, request api.SCIPNavigationRequest) (api.SCIPNavigationResponse, error)
func (*Service) RefreshGitHubDependencies ¶
func (*Service) SetDependencies ¶
type ServiceStore ¶
type ServiceStore interface {
AuthorizedRepository(context.Context, int64, []int64, int64) (repository.Repository, error)
AnyAuthorizedRepository(context.Context, int64) (repository.Repository, error)
ReplaceSCIP(context.Context, int64, string, Upload) error
OccurrenceAt(context.Context, int64, string, string, int, OccurrencePosition) (StoredOccurrence, error)
// SCIPIndexCommit reports the commit of the most recent SCIP upload for a
// repository, or "" when none exists. Consulted only on the error path.
SCIPIndexCommit(context.Context, int64) (string, error)
Locations(context.Context, authn.Principal, StoredOccurrence, string, int) ([]Location, bool, error)
ReplacePackages(context.Context, int64, string, []PackageMapping) error
}
type StoredOccurrence ¶
type SymbolInformation ¶ added in v0.10.0
type SymbolInformation struct {
Symbol, Kind, DisplayName, Documentation, Signature string
}
SymbolInformation is the producer's description of one symbol: its SCIP kind name, display name, joined documentation and signature text.
type Upload ¶
type Upload struct {
ProjectRoot, IndexerName, IndexerVersion string
Documents []Document
Occurrences []Occurrence
Relationships []Relationship
Symbols []SymbolInformation
}
func (Upload) Definitions ¶ added in v0.10.0
func (upload Upload) Definitions() Definitions
Definitions collects the upload's enclosing-range definitions by document.