Documentation ¶
Index ¶
- Constants
- Variables
- type Cache
- type Docs
- type Document
- type DocumentRange
- type File
- func (fb *File) Bytes() []byte
- func (fb *File) Read(b []byte) (int, error)
- func (fb *File) ReadAt(b []byte, offset int64) (int, error)
- func (fb *File) Seek(offset int64, whence int) (int64, error)
- func (fb *File) Truncate(n int64) error
- func (fb *File) Write(b []byte) (int, error)
- func (fb *File) WriteAt(b []byte, offset int64) (int, error)
- type HoverRef
- type Hovers
- type Id
- type Item
- type Line
- type Metadata
- type Next
- type Offset
- type Parser
- type Range
- type Ranges
- type RawData
- type RawItem
- type RawRange
- type RawResult
- type References
- type ReferencesOffset
- type ResultSetRef
- type SerializedRange
- type SerializedReference
- type Source
- type TextReference
Constants ¶
const ( CacheTypeFile = "file" CacheTypeMem = "mem" )
Variables ¶
var CacheType = CacheTypeFile
var Lsif = "lsif"
Functions ¶
This section is empty.
Types ¶
type DocumentRange ¶
type File ¶ added in v0.6.1
type File struct {
// contains filtered or unexported fields
}
File is an in-memory emulation of the I/O operations of os.File. The zero value for File is an empty file ready to use. Comes from: https://github.com/dsnet/golib/blob/master/memfile/file.go
func New ¶ added in v0.6.1
New creates and initializes a new File using b as its initial contents. The new File takes ownership of b.
func (*File) Bytes ¶ added in v0.6.1
Bytes returns the full contents of the File. The result in only valid until the next Write, WriteAt, or Truncate call.
func (*File) Read ¶ added in v0.6.1
Read reads up to len(b) bytes from the File. It returns the number of bytes read and any error encountered. At end of file, Read returns (0, io.EOF).
func (*File) ReadAt ¶ added in v0.6.1
ReadAt reads len(b) bytes from the File starting at byte offset. It returns the number of bytes read and the error, if any. At end of file, that error is io.EOF.
func (*File) Seek ¶ added in v0.6.1
Seek sets the offset for the next Read or Write on file with offset, interpreted according to whence: 0 means relative to the origin of the file, 1 means relative to the current offset, and 2 means relative to the end.
func (*File) Truncate ¶ added in v0.6.1
Truncate changes the size of the file. It does not change the I/O offset.
func (*File) Write ¶ added in v0.6.1
Write writes len(b) bytes to the File. It returns the number of bytes written and an error, if any. If the current file offset is past the io.EOF, then the space in-between are implicitly filled with zero bytes.
type Ranges ¶
type RawResult ¶
type RawResult struct {
Contents json.RawMessage `json:"contents"`
}
type References ¶
func NewReferences ¶
func NewReferences() (*References, error)
func (*References) Close ¶
func (r *References) Close() error
func (*References) For ¶
func (r *References) For(docs map[Id]string, refId Id) []SerializedReference
func (*References) GetItems ¶
func (r *References) GetItems(refId Id) []Item
func (*References) Store ¶
func (r *References) Store(refId Id, references []Item) error
Store is responsible for keeping track of references that will be used when serializing in `For`.
The references are stored in a file to cacheMem them. It is like `map[Id][]Item` (where `Id` is `refId`) but relies on caching the array and its offset in files for storage to reduce RAM usage. The items can be fetched by calling `GetItems`.
type ReferencesOffset ¶
type ResultSetRef ¶
type SerializedRange ¶
type SerializedRange struct { StartLine int32 `json:"start_line"` StartChar int32 `json:"start_char"` DefinitionPath string `json:"definition_path,omitempty"` Hover json.RawMessage `json:"hover"` References []SerializedReference `json:"references,omitempty"` }
type SerializedReference ¶
type SerializedReference struct {
Path string `json:"path"`
}