file

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UnknownKind is a file type we don't know about.
	UnknownKind = Kind(iota)

	// Go is a Go source file.
	Go
	// Mod is a go.mod file.
	Mod
	// Sum is a go.sum file.
	Sum
	// Tmpl is a template file.
	Tmpl
	// Work is a go.work file.
	Work
	// CUE is a CUE source file
	CUE
)
View Source
const (
	UnknownAction = Action(iota)
	Open
	Change
	Close
	Save
	Create
	Delete
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action int

An Action is a type of file state change.

func (Action) String

func (a Action) String() string

type Kind

type Kind int

Kind describes the kind of the file in question. It can be one of Go,mod, Sum, or Tmpl.

func KindForLang

func KindForLang(langID string) Kind

KindForLang returns the file kind associated with the given language ID (from protocol.TextDocumentItem.LanguageID), or UnknownKind if the language ID is not recognized.

func (Kind) String

func (k Kind) String() string

type Modification

type Modification struct {
	URI    protocol.DocumentURI
	Action Action

	// OnDisk is true if a watched file is changed on disk. If true,
	// Version will be -1 and Text will be nil.
	OnDisk bool

	// Version should not be used when the modification is an on-disk
	// modification.
	Version int32

	// ContentChanges will be nil when they are not supplied,
	// specifically on textDocument/didClose and for on-disk changes.
	ContentChanges []protocol.TextDocumentContentChangeEvent

	// LanguageID is only sent from the language client on
	// textDocument/didOpen.
	LanguageID string
}

Modification represents a modification to a file.

Jump to

Keyboard shortcuts

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