Skip to content

Commit 49c867a

Browse files
committed
formatting
1 parent 8d4a603 commit 49c867a

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

internal/tools/find-references.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,15 @@ func FindReferences(ctx context.Context, client *lsp.Client, args FindReferences
6161
refsByFile[ref.URI] = append(refsByFile[ref.URI], ref)
6262
}
6363

64+
banner := strings.Repeat("=", 80) + "\n"
65+
header := fmt.Sprintf("References for symbol: %s\n", args.SymbolName)
66+
allReferences = append(allReferences, banner+header+banner)
67+
6468
// Process each file's references
6569
for uri, fileRefs := range refsByFile {
66-
fileInfo := fmt.Sprintf("\nReferences in %s:\n", strings.TrimPrefix(string(uri), "file://"))
70+
fileInfo := fmt.Sprintf("\nFile: %s\n%s\n",
71+
strings.TrimPrefix(string(uri), "file://"),
72+
strings.Repeat("-", 80))
6773
allReferences = append(allReferences, fileInfo)
6874

6975
for _, ref := range fileRefs {
@@ -77,7 +83,7 @@ func FindReferences(ctx context.Context, client *lsp.Client, args FindReferences
7783
snippet = addLineNumbers(snippet, int(ref.Range.Start.Line)+1)
7884
}
7985

80-
refInfo := fmt.Sprintf(" Line %d, Column %d:\n%s\n",
86+
refInfo := fmt.Sprintf("Reference at Line %d, Column %d:\n%s\n",
8187
ref.Range.Start.Line+1,
8288
ref.Range.Start.Character+1,
8389
snippet,
@@ -89,7 +95,9 @@ func FindReferences(ctx context.Context, client *lsp.Client, args FindReferences
8995
}
9096

9197
if len(allReferences) == 0 {
92-
return fmt.Sprintf("No references found for %s", args.SymbolName), nil
98+
banner := strings.Repeat("=", 80) + "\n"
99+
return fmt.Sprintf("%sNo references found for symbol: %s\n%s",
100+
banner, args.SymbolName, banner), nil
93101
}
94102

95103
return strings.Join(allReferences, "\n"), nil

0 commit comments

Comments
 (0)