Skip to content

Commit 2adfdc0

Browse files
Change HoverProvider on import to show path on disk (#4092)
1 parent 35668ca commit 2adfdc0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

private/buf/buflsp/symbol.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,9 @@ func (s *symbol) FormatDocs(ctx context.Context) string {
174174
switch s.kind.(type) {
175175
case *imported:
176176
imported, _ := s.kind.(*imported)
177-
// Provide a preview of the imported file.
178-
return fmt.Sprintf("```proto\n%s\n```", imported.file.file.Text())
177+
// Show the path to the file on disk, which is similar to how other LSP clients treat hovering
178+
// on an import file.
179+
return imported.file.file.Path()
179180
case *tag:
180181
plural := func(i int) string {
181182
if i == 1 {

0 commit comments

Comments
 (0)