symbols

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package symbols provides document symbols.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttributeSymbol

type AttributeSymbol struct {
	AttrName string
	ExprKind lang.SymbolExprKind
	// contains filtered or unexported fields
}

AttributeSymbol is Symbol implementation representing an attribute

func (*AttributeSymbol) Equal

func (as *AttributeSymbol) Equal(other Symbol) bool

func (*AttributeSymbol) Name

func (as *AttributeSymbol) Name() string

func (*AttributeSymbol) NestedSymbols

func (as *AttributeSymbol) NestedSymbols() []Symbol

func (*AttributeSymbol) Path

func (as *AttributeSymbol) Path() lang.Path

func (*AttributeSymbol) Range

func (as *AttributeSymbol) Range() hcl.Range

type BlockSymbol

type BlockSymbol struct {
	Type   string
	Labels []string
	// contains filtered or unexported fields
}

BlockSymbol is Symbol implementation representing a block

func (*BlockSymbol) Equal

func (bs *BlockSymbol) Equal(other Symbol) bool

func (*BlockSymbol) Name

func (bs *BlockSymbol) Name() string

func (*BlockSymbol) NestedSymbols

func (bs *BlockSymbol) NestedSymbols() []Symbol

func (*BlockSymbol) Path

func (bs *BlockSymbol) Path() lang.Path

func (*BlockSymbol) Range

func (bs *BlockSymbol) Range() hcl.Range

type Collector

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

Collector collects symbols from documents.

func NewCollector

func NewCollector(path lang.Path) *Collector

NewCollector returns a collector.

func (*Collector) FileSymbols

func (c *Collector) FileSymbols(ctx decoder.Context, filename string) ([]Symbol, error)

FileSymbols find all symbols in a file as a hierarchical structure.

type ExprSymbol

type ExprSymbol struct {
	ExprName string
	ExprKind lang.SymbolExprKind
	// contains filtered or unexported fields
}

func (*ExprSymbol) Equal

func (as *ExprSymbol) Equal(other Symbol) bool

func (*ExprSymbol) Name

func (as *ExprSymbol) Name() string

func (*ExprSymbol) NestedSymbols

func (as *ExprSymbol) NestedSymbols() []Symbol

func (*ExprSymbol) Path

func (as *ExprSymbol) Path() lang.Path

func (*ExprSymbol) Range

func (as *ExprSymbol) Range() hcl.Range

type Symbol

type Symbol interface {
	Path() lang.Path
	Name() string
	NestedSymbols() []Symbol
	Range() hcl.Range
	// contains filtered or unexported methods
}

Symbol represents any attribute, or block (and its nested blocks or attributes)

func WorkspaceSymbols

func WorkspaceSymbols(provider decoder.ContextProvider, query string) ([]Symbol, error)

WorkspaceSymbols finds all symbols in all modules that are currently open. Note that this is buggy in that it doesn't load symbols from modules that are not being edited.

Jump to

Keyboard shortcuts

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