(ctx context.Context, connRequest wshrpc.ConnRequest)
| 629 | } |
| 630 | |
| 631 | func (ws *WshServer) ConnConnectCommand(ctx context.Context, connRequest wshrpc.ConnRequest) error { |
| 632 | if conncontroller.IsLocalConnName(connRequest.Host) { |
| 633 | return nil |
| 634 | } |
| 635 | ctx = genconn.ContextWithConnData(ctx, connRequest.LogBlockId) |
| 636 | ctx = termCtxWithLogBlockId(ctx, connRequest.LogBlockId) |
| 637 | connName := connRequest.Host |
| 638 | if strings.HasPrefix(connName, "wsl://") { |
| 639 | distroName := strings.TrimPrefix(connName, "wsl://") |
| 640 | conn := wslconn.GetWslConn(distroName) |
| 641 | if conn == nil { |
| 642 | return fmt.Errorf("connection not found: %s", connName) |
| 643 | } |
| 644 | return conn.Connect(ctx) |
| 645 | } |
| 646 | connOpts, err := remote.ParseOpts(connName) |
| 647 | if err != nil { |
| 648 | return fmt.Errorf("error parsing connection name: %w", err) |
| 649 | } |
| 650 | conn := conncontroller.GetConn(connOpts) |
| 651 | if conn == nil { |
| 652 | return fmt.Errorf("connection not found: %s", connName) |
| 653 | } |
| 654 | return conn.Connect(ctx, &connRequest.Keywords) |
| 655 | } |
| 656 | |
| 657 | func (ws *WshServer) ConnReinstallWshCommand(ctx context.Context, data wshrpc.ConnExtData) error { |
| 658 | if conncontroller.IsLocalConnName(data.ConnName) { |
nothing calls this directly
no test coverage detected