Skip to content

Commit 40ba154

Browse files
committed
lsp: add API flags support for endpoint/token override
1 parent ef93434 commit 40ba154

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cmd/src/lsp.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66
"io"
77

8+
"github.com/sourcegraph/src-cli/internal/api"
89
"github.com/sourcegraph/src-cli/internal/lsp"
910
)
1011

@@ -38,18 +39,20 @@ Example Neovim configuration (0.11+):
3839
`
3940

4041
flagSet := flag.NewFlagSet("lsp", flag.ExitOnError)
42+
apiFlags := api.NewFlags(flagSet)
43+
4144
usageFunc := func() {
45+
fmt.Println(usage)
4246
fmt.Fprintf(flag.CommandLine.Output(), "Usage of 'src %s':\n", flagSet.Name())
4347
flagSet.PrintDefaults()
44-
fmt.Println(usage)
4548
}
4649

4750
handler := func(args []string) error {
4851
if err := flagSet.Parse(args); err != nil {
4952
return err
5053
}
5154

52-
client := cfg.apiClient(nil, io.Discard)
55+
client := cfg.apiClient(apiFlags, io.Discard)
5356

5457
srv, err := lsp.NewServer(client)
5558
if err != nil {

0 commit comments

Comments
 (0)