Documentation ¶
Overview ¶
Package filesystem implements a virtual filesystem which reflects the needs of both the language server and the HCL parser.
- creates in-memory files based on data received from the language client - allows updating in-memory files via diffs received from the language client - maintains file metadata (e.g. version, or whether it's open by the client)
Index ¶
- func ByteOffsetForPos(lines source.Lines, pos Pos) (int, error)
- func NewDocumentMetadata(dh DocumentHandler, langId string, content []byte) *documentMetadata
- func NewFilesystem() *fsystem
- type Document
- type DocumentChange
- type DocumentChanges
- type DocumentHandler
- type DocumentNotOpenErr
- type DocumentStorage
- type Filesystem
- type InvalidPosErr
- type MetadataAlreadyExistsErr
- type Pos
- type Range
- type UnknownDocumentErr
- type VersionedDocumentHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDocumentMetadata ¶
func NewDocumentMetadata(dh DocumentHandler, langId string, content []byte) *documentMetadata
func NewFilesystem ¶
func NewFilesystem() *fsystem
Types ¶
type DocumentChange ¶
type DocumentChanges ¶
type DocumentChanges []DocumentChange
type DocumentHandler ¶
type DocumentNotOpenErr ¶
type DocumentNotOpenErr struct {
DocumentHandler DocumentHandler
}
func (*DocumentNotOpenErr) Error ¶
func (e *DocumentNotOpenErr) Error() string
type DocumentStorage ¶
type DocumentStorage interface { // LS-specific methods CreateDocument(DocumentHandler, string, []byte) error CreateAndOpenDocument(DocumentHandler, string, []byte) error GetDocument(DocumentHandler) (Document, error) CloseAndRemoveDocument(DocumentHandler) error ChangeDocument(VersionedDocumentHandler, DocumentChanges) error HasOpenFiles(path string) (bool, error) }
type Filesystem ¶
type InvalidPosErr ¶
type InvalidPosErr struct {
Pos Pos
}
func (*InvalidPosErr) Error ¶
func (e *InvalidPosErr) Error() string
type MetadataAlreadyExistsErr ¶
type MetadataAlreadyExistsErr struct {
DocumentHandler DocumentHandler
}
func (*MetadataAlreadyExistsErr) Error ¶
func (e *MetadataAlreadyExistsErr) Error() string
type Range ¶
type Range struct {
Start, End Pos
}
Range represents LSP-style range between two positions Positions are zero-indexed
type UnknownDocumentErr ¶
type UnknownDocumentErr struct {
DocumentHandler DocumentHandler
}
func (*UnknownDocumentErr) Error ¶
func (e *UnknownDocumentErr) Error() string
type VersionedDocumentHandler ¶
type VersionedDocumentHandler interface { DocumentHandler Version() int }
Click to show internal directories.
Click to hide internal directories.