store

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document struct {
	URI     protocol.DocumentURI
	Path    string
	Content string
	Lines   []string
	Pgf     *ParsedGnoFile
}

Document represents an opened Gno file.

func (*Document) ApplyChanges

func (d *Document) ApplyChanges(changes []protocol.TextDocumentContentChangeEvent)

func (*Document) ApplyChangesToAst

func (d *Document) ApplyChangesToAst(path string)

ApplyChangesToAst applies the changes in the Document to the AST.

func (*Document) LookupSymbol added in v0.7.1

func (d *Document) LookupSymbol(name string, offset int) *stdlib.Symbol

func (*Document) PositionToOffset added in v0.7.0

func (d *Document) PositionToOffset(pos protocol.Position) int

func (*Document) SpanToRange

func (d *Document) SpanToRange(start, _ int) protocol.Range

func (*Document) TokenAt

func (d *Document) TokenAt(pos protocol.Position) (*HoveredToken, error)

type DocumentStore

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

DocumentStore holds all opened documents.

func NewDocumentStore

func NewDocumentStore() *DocumentStore

func (*DocumentStore) Close

func (s *DocumentStore) Close(uri protocol.DocumentURI)

func (*DocumentStore) DidOpen

func (*DocumentStore) Get

func (s *DocumentStore) Get(docuri uri.URI) (*Document, bool)

type HoveredToken

type HoveredToken struct {
	Text  string
	Start int
	End   int
}

type ParsedGnoFile

type ParsedGnoFile struct {
	File    *ast.File
	FileSet *token.FileSet
}

A ParsedGnoFile contains the results of parsing a Gno file.

func NewParsedGnoFile

func NewParsedGnoFile(path, content string) (*ParsedGnoFile, error)

NewParsedGnoFile parses the Gno file with the standard parser, including comments.

Jump to

Keyboard shortcuts

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