| 1 | package lspext |
| 2 | |
| 3 | import "encoding/json" |
| 4 | |
| 5 | // See https://github.com/sourcegraph/language-server-protocol/pull/14 |
| 6 | |
| 7 | // CacheGetParams is the input for 'cache/get'. The response is any or null. |
| 8 | type CacheGetParams struct { |
| 9 | // Key is the cache key. The key namespace is shared for a language |
| 10 | // server, but with other language servers. For example the PHP |
| 11 | // language server on different workspaces share the same key |
| 12 | // namespace, but does not share the namespace with a Go language |
| 13 | // server. |
| 14 | Key string `json:"key"` |
| 15 | } |
| 16 | |
| 17 | // CacheSetParams is the input for the notification 'cache/set'. |
| 18 | type CacheSetParams struct { |
| 19 | // Key is the cache key. The key namespace is shared for a language |
| 20 | // server, but with other language servers. For example the PHP |
| 21 | // language server on different workspaces share the same key |
| 22 | // namespace, but does not share the namespace with a Go language |
| 23 | // server. |
| 24 | Key string `json:"key"` |
| 25 | |
| 26 | // Value is type any. We use json.RawMessage since we expect caching |
| 27 | // implementation to cache the raw bytes, and not bother with |
| 28 | // Unmarshaling/Marshalling. |
| 29 | Value *json.RawMessage `json:"value"` |
| 30 | } |