store

package
v0.2.0-rc7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package store implements a store for HCL documents open in the editor and tracks unsaved changes for each of them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store is the document store.

func New

func New() *Store

New creates an empty store.

func (*Store) Close

func (s *Store) Close(dh document.Handle) error

Close removes the supplied document from the store.

func (*Store) Get

func (s *Store) Get(dh document.Handle) (*document.Document, error)

Get returns the document for the supplied handle or an error if the document could not be found.

func (*Store) HasOpenDocuments

func (s *Store) HasOpenDocuments(dirHandle document.DirHandle) bool

HasOpenDocuments returns true if the supplied directory has any open documents.

func (*Store) IsDocumentOpen

func (s *Store) IsDocumentOpen(dh document.Handle) bool

IsDocumentOpen returns true if it has been opened in the store.

func (*Store) List

func (s *Store) List(dirHandle document.DirHandle) []*document.Document

List returns all documents under the specified directory.

func (*Store) Open

func (s *Store) Open(dh document.Handle, langId string, version int, text []byte) error

Open creates an in-memory representation of the supplied document. The document should not have been already opened.

func (*Store) Update

func (s *Store) Update(dh document.Handle, newText []byte, newVersion int) error

Update modifies the store to update document text.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL