| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
package lsprpc |
| 6 |
|
| 7 |
import ( |
| 8 |
"fmt" |
| 9 |
"os/exec" |
| 10 |
) |
| 11 |
|
| 12 |
var ( |
| 13 |
daemonize = func(*exec.Cmd) {} |
| 14 |
autoNetworkAddress = autoNetworkAddressDefault |
| 15 |
verifyRemoteOwnership = verifyRemoteOwnershipDefault |
| 16 |
) |
| 17 |
|
| 18 |
func runRemote(cmd *exec.Cmd) error { |
| 19 |
daemonize(cmd) |
| 20 |
if err := cmd.Start(); err != nil { |
| 21 |
return fmt.Errorf("starting remote gopls: %w", err) |
| 22 |
} |
| 23 |
return nil |
| 24 |
} |
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
func autoNetworkAddressDefault(goplsPath, id string) (network string, address string) { |
| 30 |
if id != "" { |
| 31 |
panic("identified remotes are not supported on windows") |
| 32 |
} |
| 33 |
return "tcp", "localhost:37374" |
| 34 |
} |
| 35 |
|
| 36 |
func verifyRemoteOwnershipDefault(network, address string) (bool, error) { |
| 37 |
return true, nil |
| 38 |
} |