File: cache.go

package info (click to toggle)
golang-github-sourcegraph-go-lsp 0.0~git20200429.219e11d-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 168 kB
  • sloc: makefile: 2
file content (30 lines) | stat: -rw-r--r-- 1,122 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package lspext

import "encoding/json"

// See https://github.com/sourcegraph/language-server-protocol/pull/14

// CacheGetParams is the input for 'cache/get'. The response is any or null.
type CacheGetParams struct {
	// Key is the cache key. The key namespace is shared for a language
	// server, but with other language servers. For example the PHP
	// language server on different workspaces share the same key
	// namespace, but does not share the namespace with a Go language
	// server.
	Key string `json:"key"`
}

// CacheSetParams is the input for the notification 'cache/set'.
type CacheSetParams struct {
	// Key is the cache key. The key namespace is shared for a language
	// server, but with other language servers. For example the PHP
	// language server on different workspaces share the same key
	// namespace, but does not share the namespace with a Go language
	// server.
	Key string `json:"key"`

	// Value is type any. We use json.RawMessage since we expect caching
	// implementation to cache the raw bytes, and not bother with
	// Unmarshaling/Marshalling.
	Value *json.RawMessage `json:"value"`
}