Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DirHandle ¶
type DirHandle struct {
URI string
}
DirHandle represents a directory location
This may be received via LSP from the client (as URI) or constructed from a file path on OS FS.
func DirHandleFromPath ¶
DirHandleFromPath creates a DirHandle from a given path.
dirPath is expected to be a directory path (rather than document). It is however outside the scope of the function to verify this is actually the case or whether the directory exists.
func DirHandleFromURI ¶
DirHandleFromURI creates a DirHandle from a given URI.
dirUri is expected to be a directory URI (rather than document). It is however outside the scope of the function to verify this is actually the case or whether the directory exists.
type Document ¶
type Document struct { Dir DirHandle Filename string ModTime time.Time LanguageID string Version int // Text contains the document body stored as bytes. // It originally comes as string from the client via LSP // but bytes are accepted by HCL and io/fs APIs, hence preferred. Text []byte // Lines contains Text separated into lines to enable byte offset // computation for any position-based operations within HCL, such as // completion, hover, semantic token based highlighting, etc. // and to aid in calculating diff when formatting document. // LSP positions contain just line+column but hcl.Pos requires offset. Lines source.Lines }
type DocumentNotFound ¶
type DocumentNotFound struct {
URI string
}
func (*DocumentNotFound) Error ¶
func (e *DocumentNotFound) Error() string
func (*DocumentNotFound) Is ¶
func (e *DocumentNotFound) Is(err error) bool
type Handle ¶
Handle represents a document location
This may be received via LSP from the client (as URI) or constructed from a file path on OS FS.
func HandleFromPath ¶
HandleFromPath creates a Handle from a given path.
docPath is expected to be a document path (rather than dir). It is however outside the scope of the function to verify this is actually the case or whether the file exists.
func HandleFromURI ¶
HandleFromURI creates a Handle from a given URI.
docURI is expected to be a document URI (rather than dir). It is however outside the scope of the function to verify this is actually the case or whether the file exists.
type InvalidPosErr ¶
type InvalidPosErr struct {
Pos Pos
}
func (*InvalidPosErr) Error ¶
func (e *InvalidPosErr) Error() string