Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: goplus/tools
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a1907d5ff3a61386b94e3251b76afdcf5f9d3c60
Choose a base ref
..
head repository: goplus/tools
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f97d0b4bff8800c88888c54d2656493f4cc3a33c
Choose a head ref
Showing with 12 additions and 13 deletions.
  1. +12 −13 gopls/internal/lsp/source/code_lens_gox.go
25 changes: 12 additions & 13 deletions gopls/internal/lsp/source/code_lens_gox.go
Original file line number Diff line number Diff line change
@@ -215,13 +215,14 @@ func goxTestCodeLens(pgf *ParsedGopFile, classType string) ([]protocol.CodeLens,
if err != nil {
return nil, err
}
codelens := []protocol.CodeLens{
{Range: rng, Command: &protocol.Command{
Title: "run test package",
Command: "gop.test.package",
}},
}
if pgf.File.IsProj && classType == "main" { //goxls:proj gox test
return []protocol.CodeLens{
{Range: rng, Command: &protocol.Command{
Title: "run test",
Command: "gop.test",
}},
}, nil
return codelens, nil
}
args, err := command.MarshalArgs(
map[string]string{
@@ -231,15 +232,13 @@ func goxTestCodeLens(pgf *ParsedGopFile, classType string) ([]protocol.CodeLens,
if err != nil {
return nil, err
}
codelens := []protocol.CodeLens{
{Range: rng, Command: &protocol.Command{
Title: "run test package",
Command: "gop.test.package",
}},
{Range: rng, Command: &protocol.Command{ // goxls: add test cursor as test file
codelens = append(codelens, protocol.CodeLens{
Range: rng,
Command: &protocol.Command{
Title: "run file tests",
Command: "gop.test.cursor",
Arguments: args,
}}}
},
})
return codelens, nil
}