cache

package
v0.0.0-...-c4ba228 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2020 License: BSD-3-Clause Imports: 40 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

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

type DebugSession

type DebugSession struct{ *Session }

func (DebugSession) Cache

func (s DebugSession) Cache() debug.Cache

func (DebugSession) File

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

func (DebugSession) Files

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

func (DebugSession) ID

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