Skip to content

Commit bc37452

Browse files
Reformat + fix end char bug
1 parent 2a6a7ed commit bc37452

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

cmd/scip/convert.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ func DeserializeOccurrencesFromBlob(blob []byte) ([]OccurrenceInfo, error) {
316316
for i, occ := range doc.Occurrences {
317317
// Extract range information
318318
startLine, startChar := occ.Range[0], occ.Range[1]
319-
endLine, endChar := startLine, startChar
319+
endLine, endChar := startLine, occ.Range[2]
320320
if len(occ.Range) >= 4 {
321321
endLine, endChar = occ.Range[2], occ.Range[3]
322322
}

cmd/scip/query.go

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -505,19 +505,19 @@ func buildFlatCallHierarchy(db *sqlite.Conn, rootSymbol string, maxDepth int) ([
505505

506506
// Create new entry
507507
entry = &FlatCallHierarchyEntry{
508-
Callee: current.symbol,
509-
Caller: CallerInfo{
510-
Symbol: ref.CallerSymbol,
511-
RelativePath: ref.FilePath,
512-
Range: Range{
513-
StartLine: callerLocation.Line,
514-
StartChar: callerLocation.Character,
515-
EndLine: callerLocation.EndLine,
516-
EndChar: callerLocation.EndChar,
517-
},
508+
Callee: current.symbol,
509+
Caller: CallerInfo{
510+
Symbol: ref.CallerSymbol,
511+
RelativePath: ref.FilePath,
512+
Range: Range{
513+
StartLine: callerLocation.Line,
514+
StartChar: callerLocation.Character,
515+
EndLine: callerLocation.EndLine,
516+
EndChar: callerLocation.EndChar,
518517
},
519-
CallSites: []CallSite{},
520-
}
518+
},
519+
CallSites: []CallSite{},
520+
}
521521

522522
relationshipMap[pair] = entry
523523
}
@@ -544,17 +544,17 @@ func buildFlatCallHierarchy(db *sqlite.Conn, rootSymbol string, maxDepth int) ([
544544
// Convert map to slice and sort in BFS order
545545
// Track the symbols in BFS order to ensure proper ordering
546546
orderedSymbols := []string{rootSymbol} // Start with root symbol
547-
547+
548548
// Add remaining symbols in the order they were discovered
549549
for i := 0; i < len(orderedSymbols); i++ {
550550
symbol := orderedSymbols[i]
551-
551+
552552
// First, add entries where this symbol is the callee
553553
for pair, entry := range relationshipMap {
554554
// Caller filtering (for method/function symbols) is done in SQL
555555
if pair.callee == symbol {
556556
result = append(result, *entry)
557-
557+
558558
// Add caller to ordered symbols if not already there
559559
alreadyAdded := false
560560
for _, s := range orderedSymbols {
@@ -563,14 +563,14 @@ func buildFlatCallHierarchy(db *sqlite.Conn, rootSymbol string, maxDepth int) ([
563563
break
564564
}
565565
}
566-
566+
567567
if !alreadyAdded {
568568
orderedSymbols = append(orderedSymbols, pair.caller)
569569
}
570570
}
571571
}
572572
}
573-
573+
574574
return result, nil
575575
}
576576

cmd/scip/query_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ func TestCallerFilteringCallHierarchy(t *testing.T) {
354354
// Run call hierarchy query for target symbol
355355
var output strings.Builder
356356
symbol := "go package example/targetFunc()."
357-
357+
358358
// Use the direct query function
359359
err = callHierarchyQuery(dbPath, symbol, 3, &output)
360360
if err != nil {

0 commit comments

Comments
 (0)