File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -612,16 +612,21 @@ func typeReferencesToCompletionItems(
612612 }
613613 }
614614 }
615+ parentPrefix := string (parentFullName ) + "."
616+ packagePrefix := string (current .ir .Package ()) + "."
615617 return func (yield func (protocol.CompletionItem ) bool ) {
616618 editRange := reportSpanToProtocolRange (span )
617619 prefix , suffix := splitSpan (span , offset )
618620 for _ , symbol := range fileSymbolTypesIter {
619621 if ! symbol .ir .Kind ().IsType () {
620622 continue
621623 }
622- label := strings .TrimPrefix (string (symbol .ir .FullName ()), string (parentFullName ))
623- label = strings .TrimPrefix (label , string (current .ir .Package ()))
624- label = strings .TrimPrefix (label , "." )
624+ label := string (symbol .ir .FullName ())
625+ if strings .HasPrefix (label , parentPrefix ) {
626+ label = label [len (parentPrefix ):]
627+ } else if strings .HasPrefix (label , packagePrefix ) {
628+ label = label [len (packagePrefix ):]
629+ }
625630 if ! strings .HasPrefix (label , prefix ) || ! strings .HasSuffix (label , suffix ) {
626631 continue
627632 }
You can’t perform that action at this time.
0 commit comments