cache

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2020 License: BSD-3-Clause Imports: 41 Imported by: 0

Documentation

Overview

Package cache implements the caching layer for gopls.

Index

Constants

View Source
const (
	ModTidyError = "go mod tidy"
	SyntaxError  = "syntax"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func New

func New(ctx context.Context, options func(*source.Options)) *Cache

func (*Cache) FileSet

func (c *Cache) FileSet() *token.FileSet

func (*Cache) GetFile

func (c *Cache) GetFile(uri span.URI) source.FileHandle

func (*Cache) ID

func (c *Cache) ID() string

func (*Cache) NewSession

func (c *Cache) NewSession(ctx context.Context) *Session

func (*Cache) ParseGoHandle added in v1.0.0

func (c *Cache) ParseGoHandle(fh source.FileHandle, mode source.ParseMode) source.ParseGoHandle

type DebugSession added in v1.0.0

type DebugSession struct{ *Session }

func (DebugSession) Cache added in v1.0.0

func (s DebugSession) Cache() debug.Cache

func (DebugSession) File added in v1.0.0

func (s DebugSession) File(hash string) *debug.File

func (DebugSession) Files added in v1.0.0

func (s DebugSession) Files() []*debug.File

func (DebugSession) ID added in v1.0.0

func (s DebugSession) ID() string

type Session

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

func (*Session) Cache

func (s *Session) Cache() source.Cache

func (*Session) DidModifyFiles

func (s *Session) DidModifyFiles(ctx context.Context, changes []source.FileModification) ([]source.Snapshot, error)

func (*Session) GetFile

func (s *Session) GetFile(uri span.URI) source.FileHandle

func (*Session) NewView

func (s *Session) NewView(ctx context.Context, name string, folder span.URI, options source.Options) (source.View, source.Snapshot, error)

func (*Session) Options

func (s *Session) Options() source.Options

func (*Session) SetOptions

func (s *Session) SetOptions(options source.Options)

func (*Session) Shutdown

func (s *Session) Shutdown(ctx context.Context)

func (*Session) View

func (s *Session) View(name string) source.View

View returns the view by name.

func (*Session) ViewOf

func (s *Session) ViewOf(uri span.URI) (source.View, error)

ViewOf returns a view corresponding to the given URI. If the file is not already associated with a view, pick one using some heuristics.

func (*Session) Views

func (s *Session) Views() []source.View

Jump to

Keyboard shortcuts

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