mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 20:51:43 +00:00
codeintel: Fix reference moniker translation (#46391)
This commit is contained in:
parent
47716b109f
commit
542e437ce9
@ -77,7 +77,7 @@ func TestSCIPMigrator(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error counting symbols: %s", err)
|
||||
}
|
||||
if expected := 3307; symbolsCount != expected {
|
||||
if expected := 4221; symbolsCount != expected {
|
||||
t.Fatalf("unexpected number of documents. want=%d have=%d", expected, symbolsCount)
|
||||
}
|
||||
}
|
||||
|
||||
@ -227,11 +227,11 @@ func convertRange(
|
||||
for _, targetRangeID := range targetRangeFetcher(r.DefinitionResultID) {
|
||||
// Add reference to the defining range identifier
|
||||
addOccurrence(constructSymbolName(uploadID, targetRangeID), role)
|
||||
}
|
||||
|
||||
// Add reference to each moniker
|
||||
for _, moniker := range monikers {
|
||||
addOccurrence(moniker, role)
|
||||
}
|
||||
// Add reference to each moniker
|
||||
for _, moniker := range monikers {
|
||||
addOccurrence(moniker, role)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -46,11 +46,13 @@ func TestConvertLSIF(t *testing.T) {
|
||||
{
|
||||
RelativePath: "bar.go",
|
||||
Occurrences: []*scip.Occurrence{
|
||||
{Range: []int32{4, 5, 6, 7}, Symbol: "scheme A . pkg A v0.1.0 `ident A`."},
|
||||
{Range: []int32{6, 7, 8, 9}, Symbol: "lsif . 42 . `7`."},
|
||||
{Range: []int32{6, 7, 8, 9}, Symbol: "scheme B . pkg B v1.2.3 `ident B`."},
|
||||
},
|
||||
Symbols: []*scip.SymbolInformation{
|
||||
{Symbol: "lsif . 42 . `7`.", Documentation: []string{"```go\ntext A\n```"}},
|
||||
{Symbol: "scheme A . pkg A v0.1.0 `ident A`."},
|
||||
{Symbol: "scheme B . pkg B v1.2.3 `ident B`.", Documentation: []string{"```go\ntext A\n```"}},
|
||||
},
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user