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 ByteOffsetForPos ¶ added in v0.10.0
func NewDocumentMetadata ¶ added in v0.6.0
func NewDocumentMetadata(dh DocumentHandler, langId string, content []byte) *documentMetadata
func NewFilesystem ¶
func NewFilesystem() *fsystem
Types ¶
type DocumentChange ¶ added in v0.6.0
type DocumentChanges ¶ added in v0.6.0
type DocumentChanges []DocumentChange
type DocumentHandler ¶ added in v0.6.0
type DocumentNotOpenErr ¶ added in v0.6.0
type DocumentNotOpenErr struct {
DocumentHandler DocumentHandler
}
func (*DocumentNotOpenErr) Error ¶ added in v0.6.0
func (e *DocumentNotOpenErr) Error() string
type DocumentStorage ¶ added in v0.6.0
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 ¶ added in v0.10.0
type InvalidPosErr struct {
Pos Pos
}
func (*InvalidPosErr) Error ¶ added in v0.10.0
func (e *InvalidPosErr) Error() string
type MetadataAlreadyExistsErr ¶ added in v0.6.0
type MetadataAlreadyExistsErr struct {
DocumentHandler DocumentHandler
}
func (*MetadataAlreadyExistsErr) Error ¶ added in v0.6.0
func (e *MetadataAlreadyExistsErr) Error() string
type Pos ¶ added in v0.10.0
type Pos struct {
Line, Column int
}
Pos represents LSP-style position (zero-indexed)
type Range ¶ added in v0.10.0
type Range struct {
Start, End Pos
}
Range represents LSP-style range between two positions Positions are zero-indexed
type UnknownDocumentErr ¶ added in v0.6.0
type UnknownDocumentErr struct {
DocumentHandler DocumentHandler
}
func (*UnknownDocumentErr) Error ¶ added in v0.6.0
func (e *UnknownDocumentErr) Error() string
type VersionedDocumentHandler ¶ added in v0.6.0
type VersionedDocumentHandler interface { DocumentHandler Version() int }
Click to show internal directories.
Click to hide internal directories.