Documentation ¶
Index ¶
- type File
- type FileSystem
- func (fs *FileSystem) Change(handler *filehandler.VersionedFileHandler, ...) error
- func (fs *FileSystem) Create(fh filehandler.FileHandler, contents []byte) error
- func (fs *FileSystem) Open(name string) (afero.File, error)
- func (fs *FileSystem) ReadFile(name string) ([]byte, error)
- func (fs *FileSystem) Remove(fh *filehandler.FileHandler) error
- func (fs *FileSystem) SetLogger(logger *log.Logger)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct { Handler *filehandler.FileHandler Text []byte Version int }
File is a structure that contains fields and methods that the LSP uses for handling document files.
func FileFromDocumentItem ¶
func FileFromDocumentItem(doc lsp.TextDocumentItem) *File
FileFromDocumentItem will create a File from a given LSP textdocument item.
type FileSystem ¶
FileSystem is a file I/O pool that uses afero to create an in-memory and an OS file system to store the documents in.
func (*FileSystem) Change ¶
func (fs *FileSystem) Change(handler *filehandler.VersionedFileHandler, changes []lsp.TextDocumentContentChangeEvent) error
Change will update a file with the changes provided by the language client.
func (*FileSystem) Create ¶
func (fs *FileSystem) Create(fh filehandler.FileHandler, contents []byte) error
Create will create a file in the file system and add its metadata to the metadata map.
func (*FileSystem) Open ¶
func (fs *FileSystem) Open(name string) (afero.File, error)
Open will open the raw file to perform I/O operations on it.
func (*FileSystem) ReadFile ¶
func (fs *FileSystem) ReadFile(name string) ([]byte, error)
ReadFile will read the contents of a file with a given name.
func (*FileSystem) Remove ¶
func (fs *FileSystem) Remove(fh *filehandler.FileHandler) error
Remove will mark the file as closed and then it will remove the file from the pool.
func (*FileSystem) SetLogger ¶
func (fs *FileSystem) SetLogger(logger *log.Logger)
SetLogger will override the logger of the filesystem instance.