Skip to content

Commit 8935ee3

Browse files
committed
internal/gopls: renaming of gopls to cuelsp
Replacing gopls with cuelsp in help text and other strings. Signed-off-by: Matthew Sackman <[email protected]> Change-Id: I2f2efcdc712dccf1ba1b96572600628a204052d4 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1218086 Unity-Result: CUE porcuepine <[email protected]> Reviewed-by: Daniel Martí <[email protected]> TryBot-Result: CUEcueckoo <[email protected]>
1 parent 3fb3043 commit 8935ee3

File tree

5 files changed

+30
-30
lines changed

5 files changed

+30
-30
lines changed

internal/golangorgx/gopls/cmd/cmd.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5-
// Package cmd handles the gopls command line.
5+
// Package cmd handles the cuelsp command line.
66
// It contains a handler for each of the modes, along with all the flag handling
77
// and the command line output format.
88
package cmd
@@ -105,7 +105,7 @@ func New(options func(*settings.Options)) *Application {
105105
}
106106

107107
// Name implements tool.Application returning the binary name.
108-
func (app *Application) Name() string { return "gopls" }
108+
func (app *Application) Name() string { return "cuelsp" }
109109

110110
// Usage implements tool.Application returning empty extra argument usage.
111111
func (app *Application) Usage() string { return "" }
@@ -122,14 +122,14 @@ func (app *Application) DetailedHelp(f *flag.FlagSet) {
122122
defer w.Flush()
123123

124124
fmt.Fprint(w, `
125-
gopls is a Go language server.
125+
cuelsp is a CUE language server.
126126
127127
It is typically used with an editor to provide language features. When no
128-
command is specified, gopls will default to the 'serve' command. The language
129-
features can also be accessed via the gopls command-line interface.
128+
command is specified, cuelsp will default to the 'serve' command. The language
129+
features can also be accessed via the cuelsp command-line interface.
130130
131131
Usage:
132-
gopls help [<subject>]
132+
cuelsp help [<subject>]
133133
134134
Command:
135135
`)
@@ -239,7 +239,7 @@ func (app *Application) Run(ctx context.Context, args ...string) error {
239239
return tool.CommandLineErrorf("Unknown command %v", command)
240240
}
241241

242-
// Commands returns the set of commands supported by the gopls tool on the
242+
// Commands returns the set of commands supported by the cuelsp tool on the
243243
// command line.
244244
// The command is specified by the first non flag argument.
245245
func (app *Application) Commands() []tool.Application {
@@ -276,7 +276,7 @@ var (
276276
internalConnections = make(map[string]*connection)
277277
)
278278

279-
// connect creates and initializes a new in-process gopls session.
279+
// connect creates and initializes a new in-process cuelsp session.
280280
//
281281
// If onProgress is set, it is called for each new progress notification.
282282
func (app *Application) connect(ctx context.Context, onProgress func(*protocol.ProgressParams)) (*connection, error) {
@@ -360,7 +360,7 @@ type connection struct {
360360
client *cmdClient
361361
}
362362

363-
// cmdClient defines the protocol.Client interface behavior of the gopls CLI tool.
363+
// cmdClient defines the protocol.Client interface behavior of the cuelsp CLI tool.
364364
type cmdClient struct {
365365
app *Application
366366
onProgress func(*protocol.ProgressParams)
@@ -448,7 +448,7 @@ func (c *cmdClient) WorkspaceFolders(ctx context.Context) ([]protocol.WorkspaceF
448448
func (c *cmdClient) Configuration(ctx context.Context, p *protocol.ParamConfiguration) ([]interface{}, error) {
449449
results := make([]interface{}, len(p.Items))
450450
for i, item := range p.Items {
451-
if item.Section != "gopls" {
451+
if item.Section != "cuelsp" {
452452
continue
453453
}
454454
m := map[string]interface{}{

internal/golangorgx/gopls/cmd/format.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"cuelang.org/go/internal/golangorgx/gopls/protocol"
1313
)
1414

15-
// format implements the format verb for gopls.
15+
// format implements the format verb for cuelsp.
1616
type format struct {
1717
EditFlags
1818
app *Application
@@ -28,7 +28,7 @@ The arguments supplied may be simple file names, or ranges within files.
2828
2929
Example: reformat this file:
3030
31-
$ gopls format -w internal/cmd/check.go
31+
$ cuelsp format -w internal/cmd/check.go
3232
3333
format-flags:
3434
`)

internal/golangorgx/gopls/cmd/info.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ func (h *help) DetailedHelp(f *flag.FlagSet) {
3131
fmt.Fprint(f.Output(), `
3232
3333
Examples:
34-
$ gopls help # main gopls help message
35-
$ gopls help remote # help on 'remote' command
36-
$ gopls help remote sessions # help on 'remote sessions' subcommand
34+
$ cuelsp help # main cuelsp help message
35+
$ cuelsp help remote # help on 'remote' command
36+
$ cuelsp help remote sessions # help on 'remote sessions' subcommand
3737
`)
3838
printFlagDefaults(f)
3939
}
@@ -59,7 +59,7 @@ func (h *help) Run(ctx context.Context, args ...string) error {
5959
}
6060
}
6161

62-
// 'gopls help cmd subcmd' is equivalent to 'gopls cmd subcmd -h'.
62+
// 'cuelsp help cmd subcmd' is equivalent to 'cuelsp cmd subcmd -h'.
6363
// The flag package prints the usage information (defined by tool.Run)
6464
// when it sees the -h flag.
6565
fs := flag.NewFlagSet(cmd.Name(), flag.ExitOnError)
@@ -73,7 +73,7 @@ type apiJSON struct {
7373
func (j *apiJSON) Name() string { return "api-json" }
7474
func (j *apiJSON) Parent() string { return j.app.Name() }
7575
func (j *apiJSON) Usage() string { return "" }
76-
func (j *apiJSON) ShortHelp() string { return "print JSON describing gopls API" }
76+
func (j *apiJSON) ShortHelp() string { return "print JSON describing cuelsp API" }
7777
func (j *apiJSON) DetailedHelp(f *flag.FlagSet) {
7878
fmt.Fprint(f.Output(), ``)
7979
printFlagDefaults(f)

internal/golangorgx/gopls/cmd/remote.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func (r *remote) Name() string {
5050
func (r *remote) Parent() string { return r.app.Name() }
5151

5252
func (r *remote) ShortHelp() string {
53-
short := "interact with the gopls daemon"
53+
short := "interact with the cuelsp daemon"
5454
if r.alias != "" {
5555
short += " (deprecated: use 'remote')"
5656
}
@@ -66,21 +66,21 @@ func (c *listSessions) Name() string { return "sessions" }
6666
func (c *listSessions) Parent() string { return c.app.Name() }
6767
func (c *listSessions) Usage() string { return "" }
6868
func (c *listSessions) ShortHelp() string {
69-
return "print information about current gopls sessions"
69+
return "print information about current cuelsp sessions"
7070
}
7171

7272
const listSessionsExamples = `
7373
Examples:
7474
7575
1) list sessions for the default daemon:
7676
77-
$ gopls -remote=auto remote sessions
77+
$ cuelsp -remote=auto remote sessions
7878
or just
79-
$ gopls remote sessions
79+
$ cuelsp remote sessions
8080
8181
2) list sessions for a specific daemon:
8282
83-
$ gopls -remote=localhost:8082 remote sessions
83+
$ cuelsp -remote=localhost:8082 remote sessions
8484
`
8585

8686
func (c *listSessions) DetailedHelp(f *flag.FlagSet) {
@@ -120,13 +120,13 @@ Examples:
120120
121121
1) start a debug server for the default daemon, on an arbitrary port:
122122
123-
$ gopls -remote=auto remote debug
123+
$ cuelsp -remote=auto remote debug
124124
or just
125-
$ gopls remote debug
125+
$ cuelsp remote debug
126126
127127
2) start for a specific daemon, on a specific port:
128128
129-
$ gopls -remote=localhost:8082 remote debug localhost:8083
129+
$ cuelsp -remote=localhost:8082 remote debug localhost:8083
130130
`
131131

132132
func (c *startDebugging) DetailedHelp(f *flag.FlagSet) {

internal/golangorgx/gopls/cmd/serve.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
type Serve struct {
2727
Logfile string `flag:"logfile" help:"filename to log to. if value is \"auto\", then logging to a default output file is enabled"`
2828
Mode string `flag:"mode" help:"no effect"`
29-
Port int `flag:"port" help:"port on which to run gopls for debugging purposes"`
29+
Port int `flag:"port" help:"port on which to run cuelsp for debugging purposes"`
3030
Address string `flag:"listen" help:"address on which to listen for remote connections. If prefixed by 'unix;', the subsequent address is assumed to be a unix domain socket. Otherwise, TCP is used."`
3131
IdleTimeout time.Duration `flag:"listen.timeout" help:"when used with -listen, shut down the server when there are no connected clients for this duration"`
3232

@@ -44,7 +44,7 @@ func (s *Serve) ShortHelp() string {
4444
return "run a server for Go code using the Language Server Protocol"
4545
}
4646
func (s *Serve) DetailedHelp(f *flag.FlagSet) {
47-
fmt.Fprint(f.Output(), ` gopls [flags] [server-flags]
47+
fmt.Fprint(f.Output(), ` cuelsp [flags] [server-flags]
4848
4949
The server communicates using JSONRPC2 on stdin and stdout, and is intended to be run directly as
5050
a child of an editor process.
@@ -95,7 +95,7 @@ func (s *Serve) Run(ctx context.Context, args ...string) error {
9595
}
9696
if s.Port != 0 {
9797
network = "tcp"
98-
// TODO(adonovan): should gopls ever be listening on network
98+
// TODO(adonovan): should cuelsp ever be listening on network
9999
// sockets, or only local ones?
100100
//
101101
// Ian says this was added in anticipation of
@@ -115,8 +115,8 @@ func (s *Serve) Run(ctx context.Context, args ...string) error {
115115
addr = fmt.Sprintf(":%v", s.Port)
116116
}
117117
if addr != "" {
118-
log.Printf("cue lsp daemon: listening on %s network, address %s...", network, addr)
119-
defer log.Printf("cue lsp daemon: exiting")
118+
log.Printf("cuelsp daemon: listening on %s network, address %s...", network, addr)
119+
defer log.Printf("cuelsp daemon: exiting")
120120
return jsonrpc2.ListenAndServe(ctx, network, addr, ss, s.IdleTimeout)
121121
}
122122
stream := jsonrpc2.NewHeaderStream(fakenet.NewConn("stdio", os.Stdin, os.Stdout))

0 commit comments

Comments
 (0)