Skip to content

Commit

Permalink
fix: other namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
siyul-park committed Nov 26, 2023
1 parent b16e7ac commit 35301b1
Showing 1 changed file with 19 additions and 23 deletions.
42 changes: 19 additions & 23 deletions pkg/symbol/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,32 +137,28 @@ func (t *Table) insert(sym *Symbol) error {
}
}

if id == (ulid.ULID{}) {
unlinks[name] = append(unlinks[name], location)
continue
}

if ref, ok := t.symbols[id]; ok {
if ref.Namespace() != sym.Namespace() {
continue
}

if p2, ok := ref.Port(location.Port); ok {
p1.Link(p2)

linked := t.linked[ref.ID()]
if linked == nil {
linked = make(map[string][]scheme.PortLocation)
if id != (ulid.ULID{}) {
if ref, ok := t.symbols[id]; ok {
if ref.Namespace() == sym.Namespace() {
if p2, ok := ref.Port(location.Port); ok {
p1.Link(p2)

linked := t.linked[ref.ID()]
if linked == nil {
linked = make(map[string][]scheme.PortLocation)
}
linked[location.Port] = append(linked[location.Port], scheme.PortLocation{
ID: sym.ID(),
Port: name,
})
t.linked[ref.ID()] = linked

continue
}
}
linked[location.Port] = append(linked[location.Port], scheme.PortLocation{
ID: sym.ID(),
Port: name,
})
t.linked[ref.ID()] = linked

continue
}
}

unlinks[name] = append(unlinks[name], location)
}
}
Expand Down

0 comments on commit 35301b1

Please sign in to comment.