MCPcopy Create free account
hub / github.com/nsf/gocode / lookup_path

Function lookup_path

decl.go:561–584  ·  view source on GitHub ↗
(tp type_path, scope *scope)

Source from the content-addressed store, hash-verified

559}
560
561func lookup_path(tp type_path, scope *scope) *decl {
562 if tp.is_nil() {
563 return nil
564 }
565 var decl *decl
566 if tp.pkg != "" {
567 decl = scope.lookup(tp.pkg)
568 // return nil early if the package wasn't found but it's part
569 // of the type specification
570 if decl == nil {
571 return nil
572 }
573 }
574
575 if decl != nil {
576 if tp.name != "" {
577 return decl.find_child(tp.name)
578 } else {
579 return decl
580 }
581 }
582
583 return scope.lookup(tp.name)
584}
585
586func lookup_pkg(tp type_path, scope *scope) string {
587 if tp.is_nil() {

Callers 1

type_to_declFunction · 0.85

Calls 3

find_childMethod · 0.95
is_nilMethod · 0.80
lookupMethod · 0.80

Tested by

no test coverage detected