initializeMethodInfo handles the workaround for #607: we must set params.Capabilities.RootsV2.
()
| 1383 | // initializeMethodInfo handles the workaround for #607: we must set |
| 1384 | // params.Capabilities.RootsV2. |
| 1385 | func initializeMethodInfo() methodInfo { |
| 1386 | info := newServerMethodInfo(serverSessionMethod((*ServerSession).initialize), 0) |
| 1387 | info.unmarshalParams = func(m json.RawMessage) (Params, error) { |
| 1388 | var params *initializeParamsV2 |
| 1389 | if m != nil { |
| 1390 | if err := internaljson.Unmarshal(m, ¶ms); err != nil { |
| 1391 | return nil, fmt.Errorf("unmarshaling %q into a %T: %w", m, params, err) |
| 1392 | } |
| 1393 | } |
| 1394 | if params == nil { |
| 1395 | return nil, fmt.Errorf(`missing required "params"`) |
| 1396 | } |
| 1397 | return params.toV1(), nil |
| 1398 | } |
| 1399 | return info |
| 1400 | } |
| 1401 | |
| 1402 | func (ss *ServerSession) sendingMethodInfos() map[string]methodInfo { return clientMethodInfos } |
| 1403 |
no test coverage detected
searching dependent graphs…