AddRoots adds the given roots to the client, replacing any with the same URIs, and notifies any connected servers.
(roots ...*Root)
| 412 | // replacing any with the same URIs, |
| 413 | // and notifies any connected servers. |
| 414 | func (c *Client) AddRoots(roots ...*Root) { |
| 415 | // Only notify if something could change. |
| 416 | if len(roots) == 0 { |
| 417 | return |
| 418 | } |
| 419 | changeAndNotify(c, notificationRootsListChanged, &RootsListChangedParams{}, |
| 420 | func() bool { c.roots.add(roots...); return true }) |
| 421 | } |
| 422 | |
| 423 | // RemoveRoots removes the roots with the given URIs, |
| 424 | // and notifies any connected servers if the list has changed. |