From 6383d517d3f417f0b445574fcc771f497dd76ab0 Mon Sep 17 00:00:00 2001 From: luoliwoshang <2643523683@qq.com> Date: Tue, 9 Apr 2024 21:45:38 +0800 Subject: [PATCH] fix:ignore 'run main package' codelens of _ytest.gox --- gopls/internal/lsp/source/code_lens_gox.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gopls/internal/lsp/source/code_lens_gox.go b/gopls/internal/lsp/source/code_lens_gox.go index fe5ea5433ed..ce8bd53a92a 100644 --- a/gopls/internal/lsp/source/code_lens_gox.go +++ b/gopls/internal/lsp/source/code_lens_gox.go @@ -182,7 +182,7 @@ func gopToggleDetailsCodeLens(ctx context.Context, snapshot Snapshot, fh FileHan func gopCommandCodeLens(ctx context.Context, snapshot Snapshot, fh FileHandle) ([]protocol.CodeLens, error) { filename := fh.URI().Filename() - if strings.HasSuffix(filename, "_test.go") || strings.HasSuffix(filename, "_test.gop") { + if strings.HasSuffix(filename, "_test.go") || strings.HasSuffix(filename, "_test.gop") || strings.HasSuffix(filename, "_ytest.gox") { return nil, nil } pgf, err := snapshot.ParseGop(ctx, fh, parser.PackageClauseOnly)