diff options
Diffstat (limited to 'gopls/internal/lsp/lsprpc/autostart_default.go')
-rw-r--r-- | gopls/internal/lsp/lsprpc/autostart_default.go | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/gopls/internal/lsp/lsprpc/autostart_default.go b/gopls/internal/lsp/lsprpc/autostart_default.go new file mode 100644 index 000000000..20b974728 --- /dev/null +++ b/gopls/internal/lsp/lsprpc/autostart_default.go @@ -0,0 +1,39 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package lsprpc + +import ( + "fmt" + + exec "golang.org/x/sys/execabs" +) + +var ( + daemonize = func(*exec.Cmd) {} + autoNetworkAddress = autoNetworkAddressDefault + verifyRemoteOwnership = verifyRemoteOwnershipDefault +) + +func runRemote(cmd *exec.Cmd) error { + daemonize(cmd) + if err := cmd.Start(); err != nil { + return fmt.Errorf("starting remote gopls: %w", err) + } + return nil +} + +// autoNetworkAddressDefault returns the default network and address for the +// automatically-started gopls remote. See autostart_posix.go for more +// information. +func autoNetworkAddressDefault(goplsPath, id string) (network string, address string) { + if id != "" { + panic("identified remotes are not supported on windows") + } + return "tcp", "localhost:37374" +} + +func verifyRemoteOwnershipDefault(network, address string) (bool, error) { + return true, nil +} |