tools: golang.org/x/tools/internal/lsp/cache Index | Files

package cache

import "golang.org/x/tools/internal/lsp/cache"

Package cache implements the caching layer for gopls.

Index

Package Files

analysis.go cache.go check.go errors.go keys.go load.go mod.go mod_tidy.go parse.go pkg.go session.go snapshot.go view.go

Constants

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

Variables

var (
    KeyCreateSession   = NewSessionKey("create_session", "A new session was added")
    KeyUpdateSession   = NewSessionKey("update_session", "Updated information about a session")
    KeyShutdownSession = NewSessionKey("shutdown_session", "A session was shut down")
)

type Cache Uses

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

func New Uses

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

func (*Cache) FileSet Uses

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

func (*Cache) ID Uses

func (c *Cache) ID() string

func (*Cache) MemStats Uses

func (c *Cache) MemStats() map[reflect.Type]int

func (*Cache) NewSession Uses

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

func (*Cache) PackageStats Uses

func (c *Cache) PackageStats(withNames bool) template.HTML

func (*Cache) ParseGoHandle Uses

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

type Session Uses

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

func (*Session) Cache Uses

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

func (*Session) DidModifyFiles Uses

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

func (*Session) GetFile Uses

func (s *Session) GetFile(ctx context.Context, uri span.URI) (source.FileHandle, error)

func (*Session) ID Uses

func (s *Session) ID() string

func (*Session) NewView Uses

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

func (*Session) Options Uses

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

func (*Session) Overlays Uses

func (s *Session) Overlays() []source.Overlay

func (*Session) SetOptions Uses

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

func (*Session) Shutdown Uses

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

func (*Session) String Uses

func (s *Session) String() string

func (*Session) View Uses

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

View returns the view by name.

func (*Session) ViewOf Uses

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 Uses

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

type SessionKey Uses

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

SessionKey represents an event label key that has a *Session value.

func NewSessionKey Uses

func NewSessionKey(name, description string) *SessionKey

NewSessionKey creates a new Key for *Session values.

func (*SessionKey) Description Uses

func (k *SessionKey) Description() string

func (*SessionKey) Format Uses

func (k *SessionKey) Format(w io.Writer, buf []byte, l label.Label)

func (*SessionKey) From Uses

func (k *SessionKey) From(t label.Label) *Session

From can be used to get the session value from a Label.

func (*SessionKey) Get Uses

func (k *SessionKey) Get(lm label.Map) *Session

Get can be used to get the session for the key from a label.Map.

func (*SessionKey) Name Uses

func (k *SessionKey) Name() string

func (*SessionKey) Of Uses

func (k *SessionKey) Of(v *Session) label.Label

Of creates a new Label with this key and the supplied session.

type View Uses

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

func (*View) BackgroundContext Uses

func (v *View) BackgroundContext() context.Context

func (*View) BuiltinPackage Uses

func (v *View) BuiltinPackage(ctx context.Context) (source.BuiltinPackage, error)

func (*View) Folder Uses

func (v *View) Folder() span.URI

Folder returns the root of this view.

func (*View) ID Uses

func (v *View) ID() string

func (*View) IgnoredFile Uses

func (v *View) IgnoredFile(uri span.URI) bool

func (*View) IsGoPrivatePath Uses

func (v *View) IsGoPrivatePath(target string) bool

func (*View) ModFile Uses

func (v *View) ModFile() span.URI

func (*View) Name Uses

func (v *View) Name() string

Name returns the user visible name of this view.

func (*View) Options Uses

func (v *View) Options() source.Options

func (*View) Rebuild Uses

func (v *View) Rebuild(ctx context.Context) (source.Snapshot, error)

func (*View) RunProcessEnvFunc Uses

func (v *View) RunProcessEnvFunc(ctx context.Context, fn func(*imports.Options) error) error

func (*View) Session Uses

func (v *View) Session() source.Session

func (*View) SetOptions Uses

func (v *View) SetOptions(ctx context.Context, options source.Options) (source.View, error)

func (*View) Shutdown Uses

func (v *View) Shutdown(ctx context.Context)

func (*View) Snapshot Uses

func (v *View) Snapshot() source.Snapshot

func (*View) ValidBuildConfiguration Uses

func (v *View) ValidBuildConfiguration() bool

func (*View) WorkspaceDirectories Uses

func (v *View) WorkspaceDirectories(ctx context.Context) ([]string, error)

func (*View) WriteEnv Uses

func (v *View) WriteEnv(ctx context.Context, w io.Writer) error

Package cache imports 43 packages (graph) and is imported by 9 packages. Updated 2020-07-09. Refresh now. Tools for package owners.