gopls

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Rename

func Rename(sym *Symbol, newName string) error

Rename renames a given symbol to a new name. This naming will propagate throughout, including references to the type, the type name itself and any comments that contain the type name in godoc's reference format with '[typename]'.

Types

type Symbol

type Symbol struct {
	Name string
	Type SymbolType

	// Position is a start and end range for a symbol
	// ex: 36:2-36:7
	// (line 36, columns 2 - 7)
	Position string

	File string

	Parent   *Symbol
	Children []*Symbol
}

func SymbolsSlice

func SymbolsSlice(filename string) ([]*Symbol, error)

func (Symbol) StartLine

func (s Symbol) StartLine() (int64, error)

StartLine returns the starting line for this symbol.

type SymbolType

type SymbolType string

SymbolType maps to the second field in the `gopls symbols` output.

const (
	SymbolTypeConstant SymbolType = "Constant"
	SymbolTypeClass    SymbolType = "Class" // (ex: ACSRouterJobStatus, from 'type ACSRouterJobStatus string')
	SymbolTypeStruct   SymbolType = "Struct"
	SymbolTypeField    SymbolType = "Field"
	SymbolTypeFunction SymbolType = "Function"
	SymbolTypeMethod   SymbolType = "Method" // ex: '(*WebBackupOperationCompletedEventData).UnmarshalJSON'
)

Jump to

Keyboard shortcuts

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