@@ -13,7 +13,6 @@ import (
13
13
"fmt"
14
14
"go/ast"
15
15
"go/token"
16
- "path/filepath"
17
16
"slices"
18
17
"strings"
19
18
@@ -58,7 +57,7 @@ func contextHandler(ctx context.Context, session *cache.Session, params *mcp.Cal
58
57
fmt .Fprintf (& result , "Current package %q (package %s) declares the following symbols:\n \n " , pkg .Metadata ().PkgPath , pkg .Metadata ().Name )
59
58
// Write context of the current file.
60
59
{
61
- fmt .Fprintf (& result , "%s (current file):\n " , filepath . Base ( pgf .URI .Path () ))
60
+ fmt .Fprintf (& result , "%s (current file):\n " , pgf .URI .Base ( ))
62
61
result .WriteString ("--->\n " )
63
62
if err := writeFileSummary (ctx , snapshot , pgf .URI , & result , false ); err != nil {
64
63
return nil , err
@@ -73,7 +72,7 @@ func contextHandler(ctx context.Context, session *cache.Session, params *mcp.Cal
73
72
continue
74
73
}
75
74
76
- fmt .Fprintf (& result , "%s:\n " , filepath . Base ( file .URI .Path () ))
75
+ fmt .Fprintf (& result , "%s:\n " , file .URI .Base ( ))
77
76
result .WriteString ("--->\n " )
78
77
if err := writeFileSummary (ctx , snapshot , file .URI , & result , false ); err != nil {
79
78
return nil , err
@@ -86,7 +85,7 @@ func contextHandler(ctx context.Context, session *cache.Session, params *mcp.Cal
86
85
if len (pgf .File .Imports ) > 0 {
87
86
// Write import decls of the current file.
88
87
{
89
- fmt .Fprintf (& result , "Current file %q contains this import declaration:\n " , filepath . Base ( pgf .URI .Path () ))
88
+ fmt .Fprintf (& result , "Current file %q contains this import declaration:\n " , pgf .URI .Base ( ))
90
89
result .WriteString ("--->\n " )
91
90
// Add all import decl to output including all floating comment by
92
91
// using GenDecl's start and end position.
@@ -127,7 +126,7 @@ func contextHandler(ctx context.Context, session *cache.Session, params *mcp.Cal
127
126
128
127
fmt .Fprintf (& result , "%q (package %s)\n " , importPath , impMetadata .Name )
129
128
for _ , f := range impMetadata .CompiledGoFiles {
130
- fmt .Fprintf (& result , "%s:\n " , filepath .Base (f . Path () ))
129
+ fmt .Fprintf (& result , "%s:\n " , f .Base ())
131
130
result .WriteString ("--->\n " )
132
131
if err := writeFileSummary (ctx , snapshot , f , & result , true ); err != nil {
133
132
return nil , err
0 commit comments