ctags

package
v0.0.0-...-dc1b23b Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParserToString

func ParserToString(parser CTagsParserType) string

Types

type CTagsParser

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

CTagsParser wraps go-ctags and delegates to the right process (like universal-ctags or scip-ctags). It is only safe for single-threaded use. This wrapper also enforces a timeout on parsing a single document, which is important since documents can occasionally hang universal-ctags. documents which hang universal-ctags.

func NewCTagsParser

func NewCTagsParser(bins ParserBinMap) CTagsParser

func (*CTagsParser) Close

func (lp *CTagsParser) Close()

func (*CTagsParser) Parse

func (lp *CTagsParser) Parse(name string, content []byte, typ CTagsParserType) ([]*Entry, error)

type CTagsParserType

type CTagsParserType uint8
const (
	UnknownCTags CTagsParserType = iota
	NoCTags
	UniversalCTags
	ScipCTags
)

func StringToParser

func StringToParser(str string) CTagsParserType

type Entry

type Entry = goctags.Entry

type LanguageMap

type LanguageMap = map[string]CTagsParserType

type ParserBinMap

type ParserBinMap map[CTagsParserType]string

func NewParserBinMap

func NewParserBinMap(
	ctagsPath string,
	scipCTagsPath string,
	languageMap LanguageMap,
	cTagsMustSucceed bool,
) (ParserBinMap, error)

type SymbolKind

type SymbolKind uint8
const (
	Accessor SymbolKind = iota
	Chapter
	Class
	Constant
	Define
	Enum
	EnumConstant
	Field
	Function
	Interface
	Library
	Local
	Method
	MethodAlias
	MethodSpec
	Module
	Namespace
	Object
	Other
	Package
	Section
	SingletonMethod
	Struct
	Subsection
	Trait
	Type
	TypeAlias
	Union
	Variable
)

func ParseSymbolKind

func ParseSymbolKind(kind string) SymbolKind

ParseSymbolKind maps the output from different ctags implementations into a single set of constants. This is important because universal-ctags and SCIP ctags can return different names for the same kind.

To get a sense for which kinds are detected for which language, you can refer to universal-ctags --list-kinds-full=<language>.

Note that go-ctags uses universal-ctags's interactive mode and thus returns the full name for "kind" and not the one-letter abbreviation.

Jump to

Keyboard shortcuts

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