Skip to content

Commit

Permalink
cuepls: renaming gopls -> cuepls
Browse files Browse the repository at this point in the history
Various temp files/directories etc contain the name "gopls". Rename a
number of those that we have encountered at this point to "cuepls". Much
more tidy up and renaming will following in later CLs. Again, the focus
is on minimal changes to get a working cuepls.

For #142

Signed-off-by: Paul Jolly <paul@myitcv.io>
Change-Id: I1c10236b5e8b012030b405307aa870637a93e83d
  • Loading branch information
myitcv committed Feb 14, 2024
1 parent db1618f commit b359aab
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions internal/golangorgx/gopls/debug/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,9 @@ func (i *Instance) SetLogFile(logfile string, isDaemon bool) (func(), error) {
if logfile != "" {
if logfile == "auto" {
if isDaemon {
logfile = filepath.Join(os.TempDir(), fmt.Sprintf("gopls-daemon-%d.log", os.Getpid()))
logfile = filepath.Join(os.TempDir(), fmt.Sprintf("cuepls-daemon-%d.log", os.Getpid()))
} else {
logfile = filepath.Join(os.TempDir(), fmt.Sprintf("gopls-%d.log", os.Getpid()))
logfile = filepath.Join(os.TempDir(), fmt.Sprintf("cuepls-%d.log", os.Getpid()))
}
}
f, err := os.Create(logfile)
Expand Down
4 changes: 2 additions & 2 deletions internal/golangorgx/gopls/golang/gc_annotations.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ func GCOptimizationDetails(ctx context.Context, snapshot *cache.Snapshot, mp *me
return nil, nil
}
pkgDir := filepath.Dir(mp.CompiledGoFiles[0].Path())
outDir := filepath.Join(os.TempDir(), fmt.Sprintf("gopls-%d.details", os.Getpid()))
outDir := filepath.Join(os.TempDir(), fmt.Sprintf("cuepls-%d.details", os.Getpid()))

if err := os.MkdirAll(outDir, 0700); err != nil {
return nil, err
}
tmpFile, err := os.CreateTemp(os.TempDir(), "gopls-x")
tmpFile, err := os.CreateTemp(os.TempDir(), "cuepls-x")
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion internal/golangorgx/gopls/server/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ func (c *commandHandler) StartDebugging(ctx context.Context, args command.Debugg
}

func (c *commandHandler) StartProfile(ctx context.Context, args command.StartProfileArgs) (result command.StartProfileResult, _ error) {
file, err := os.CreateTemp("", "gopls-profile-*")
file, err := os.CreateTemp("", "cuepls-profile-*")
if err != nil {
return result, fmt.Errorf("creating temp profile file: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/golangorgx/gopls/server/general.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (s *server) Initialize(ctx context.Context, params *protocol.ParamInitializ
// pid). Some clients might start multiple gopls servers, though they
// probably shouldn't.
pid := os.Getpid()
s.tempDir = filepath.Join(os.TempDir(), fmt.Sprintf("gopls-%d.%s", pid, s.session.ID()))
s.tempDir = filepath.Join(os.TempDir(), fmt.Sprintf("cuepls-%d.%s", pid, s.session.ID()))
err := os.Mkdir(s.tempDir, 0700)
if err != nil {
// MkdirTemp could fail due to permissions issues. This is a problem with
Expand Down
4 changes: 2 additions & 2 deletions internal/golangorgx/gopls/test/integration/fake/sandbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func NewSandbox(config *SandboxConfig) (_ *Sandbox, err error) {

rootDir := config.RootDir
if rootDir == "" {
rootDir, err = os.MkdirTemp(config.RootDir, "gopls-sandbox-")
rootDir, err = os.MkdirTemp(config.RootDir, "cuepls-sandbox-")
if err != nil {
return nil, fmt.Errorf("creating temporary workdir: %v", err)
}
Expand Down Expand Up @@ -149,7 +149,7 @@ func NewSandbox(config *SandboxConfig) (_ *Sandbox, err error) {
// is the responsibility of the caller to call os.RemoveAll on the returned
// file path when it is no longer needed.
func Tempdir(files map[string][]byte) (string, error) {
dir, err := os.MkdirTemp("", "gopls-tempdir-")
dir, err := os.MkdirTemp("", "cuepls-tempdir-")
if err != nil {
return "", err
}
Expand Down
2 changes: 1 addition & 1 deletion internal/golangorgx/gopls/test/integration/regtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func Main(m *testing.M, hook func(*settings.Options)) {
}
}

dir, err := os.MkdirTemp("", "gopls-test-")
dir, err := os.MkdirTemp("", "cuepls-test-")
if err != nil {
panic(fmt.Errorf("creating temp directory: %v", err))
}
Expand Down
4 changes: 2 additions & 2 deletions internal/golangorgx/gopls/test/integration/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,12 @@ func (r *Runner) separateProcessServer(optsHook func(*settings.Options)) jsonrpc
}

r.startRemoteOnce.Do(func() {
socketDir, err := os.MkdirTemp(r.tempDir, "gopls-test-socket")
socketDir, err := os.MkdirTemp(r.tempDir, "cuepls-test-socket")
if err != nil {
r.remoteErr = err
return
}
r.remoteSocket = filepath.Join(socketDir, "gopls-test-daemon")
r.remoteSocket = filepath.Join(socketDir, "cuepls-test-daemon")

// The server should be killed by when the test runner exits, but to be
// conservative also set a listen timeout.
Expand Down
2 changes: 1 addition & 1 deletion internal/golangorgx/gopls/util/goversion/goversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func Message(goVersion int, fromBuild bool) (string, bool) {
}
fmt.Fprintf(&msgBuilder, "Please upgrade to Go 1.%d or later and reinstall gopls. ", OldestSupported())
fmt.Fprintf(&msgBuilder, "If you can't upgrade and want this message to go away, please install gopls %s. ", v.InstallGoplsVersion)
fmt.Fprint(&msgBuilder, "See https://go.dev/s/gopls-support-policy for more details.")
fmt.Fprint(&msgBuilder, "See https://go.dev/s/cuepls-support-policy for more details.")

return msgBuilder.String(), isError
}
Expand Down

0 comments on commit b359aab

Please sign in to comment.