Skip to content

Commit

Permalink
fix:remove trans test info from symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
luoliwoshang committed Apr 28, 2024
1 parent 7e1f1b8 commit cc25419
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions gopls/internal/lsp/source/symbols_gox.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func GopDocumentSymbols(ctx context.Context, snapshot Snapshot, fh FileHandle) (
return nil, fmt.Errorf("getting file for GopDocumentSymbols: %w", err)
}
file := pgf.File
classType, isTest := parserutil.GetClassType(file, fh.URI().Filename())
classType, _ := parserutil.GetClassType(file, fh.URI().Filename())
// Build symbols for file declarations. When encountering a declaration with
// errors (typically because positions are invalid), we skip the declaration
// entirely. VS Code fails to show any symbols if one of the top-level
Expand All @@ -50,9 +50,6 @@ func GopDocumentSymbols(ctx context.Context, snapshot Snapshot, fh FileHandle) (
name = "Main"
}
}
if decl.Shadow && name == "Main" && isTest {
name = "TestMain" //test gox file
}
if !decl.IsClass && decl.Recv != nil && len(decl.Recv.List) > 0 {
fs.Name = fmt.Sprintf("(%s).%s", typesutil.ExprString(decl.Recv.List[0].Type), fs.Name)
} else {
Expand Down

0 comments on commit cc25419

Please sign in to comment.