AddExtension adds an extension with the given name and settings. If settings is nil, an empty map is used to ensure valid JSON serialization (the spec requires an object, not null). The settings map should not be modified after the call.
(name string, settings map[string]any)
| 1579 | // (the spec requires an object, not null). |
| 1580 | // The settings map should not be modified after the call. |
| 1581 | func (c *ServerCapabilities) AddExtension(name string, settings map[string]any) { |
| 1582 | if c.Extensions == nil { |
| 1583 | c.Extensions = make(map[string]any) |
| 1584 | } |
| 1585 | if settings == nil { |
| 1586 | settings = map[string]any{} |
| 1587 | } |
| 1588 | c.Extensions[name] = settings |
| 1589 | } |
| 1590 | |
| 1591 | // clone returns a copy of the ServerCapabilities. |
| 1592 | // Values in the Extensions and Experimental maps are shallow-copied. |
no outgoing calls