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 NewDocumentMetadata(dh DocumentHandler, content []byte) *documentMetadata
- func NewFilesystem() *fsystem
- func URIFromPath(path string) string
- type Document
- type DocumentChange
- type DocumentChanges
- type DocumentHandler
- type DocumentNotOpenErr
- type DocumentStorage
- type File
- type Filesystem
- type MetadataAlreadyExistsErr
- type UnknownDocumentErr
- type VersionedDocumentHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDocumentMetadata ¶ added in v0.6.0
func NewDocumentMetadata(dh DocumentHandler, content []byte) *documentMetadata
func NewFilesystem ¶
func NewFilesystem() *fsystem
func URIFromPath ¶ added in v0.2.0
Types ¶
type DocumentChange ¶ added in v0.6.0
type DocumentChange interface {
Text() string
Range() hcl.Range
}
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, []byte) error
CreateAndOpenDocument(DocumentHandler, []byte) error
GetDocument(DocumentHandler) (Document, error)
CloseAndRemoveDocument(DocumentHandler) error
ChangeDocument(VersionedDocumentHandler, DocumentChanges) error
}
type File ¶ added in v0.2.0
File represents an open file in FS See io/fs.File in http://golang.org/s/draft-iofs-design
type Filesystem ¶
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 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.