(ctx context.Context, params *InitializeParams)
| 1461 | } |
| 1462 | |
| 1463 | func (ss *ServerSession) initialize(ctx context.Context, params *InitializeParams) (*InitializeResult, error) { |
| 1464 | if params == nil { |
| 1465 | return nil, fmt.Errorf("%w: \"params\" must be be provided", jsonrpc2.ErrInvalidParams) |
| 1466 | } |
| 1467 | ss.updateState(func(state *ServerSessionState) { |
| 1468 | state.InitializeParams = params |
| 1469 | }) |
| 1470 | |
| 1471 | s := ss.server |
| 1472 | return &InitializeResult{ |
| 1473 | // TODO(rfindley): alter behavior when falling back to an older version: |
| 1474 | // reject unsupported features. |
| 1475 | ProtocolVersion: negotiatedVersion(params.ProtocolVersion), |
| 1476 | Capabilities: s.capabilities(), |
| 1477 | Instructions: s.opts.Instructions, |
| 1478 | ServerInfo: s.impl, |
| 1479 | }, nil |
| 1480 | } |
| 1481 | |
| 1482 | func (ss *ServerSession) ping(context.Context, *PingParams) (*emptyResult, error) { |
| 1483 | return &emptyResult{}, nil |
nothing calls this directly
no test coverage detected