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

Skip types without defInfo #210

Merged
merged 1 commit into from
Nov 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 11 additions & 2 deletions internal/indexer/implementation.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ func (i *Indexer) indexImplementations() {
func (i *Indexer) emitLocalImplementation(from implDef, tos []implDef) {
typeDefDocToInVs := map[uint64][]uint64{}
for _, to := range tos {
if to.defInfo == nil {
continue
}

documentID := to.defInfo.DocumentID

if _, ok := typeDefDocToInVs[documentID]; !ok {
Expand All @@ -194,8 +198,10 @@ func (i *Indexer) emitLocalImplementation(from implDef, tos []implDef) {
typeDefDocToInVs[documentID] = append(typeDefDocToInVs[documentID], to.defInfo.RangeID)
}

// Emit implementation for the typeDefs directly
i.emitLocalImplementationRelation(from.defInfo.ResultSetID, typeDefDocToInVs)
if from.defInfo != nil {
// Emit implementation for the typeDefs directly
i.emitLocalImplementationRelation(from.defInfo.ResultSetID, typeDefDocToInVs)
}

// Emit implementation for each of the methods on typeDefs
for fromName, fromMethod := range from.methodsByName {
Expand Down Expand Up @@ -239,6 +245,9 @@ func (i *Indexer) emitLocalImplementationRelation(defResultSetID uint64, documen
// (kind: "implementation") to connect remote implementations
func (i *Indexer) emitRemoteImplementation(from implDef, tos []implDef) {
for _, to := range tos {
if from.defInfo == nil {
continue
}
i.emitImplementationMoniker(from.defInfo.ResultSetID, to.pkg, to.typeName)
}

Expand Down