ctags

package module
v0.0.0-...-4faeee4 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 13 Imported by: 4

README

go-ctags: universal-ctags wrapper for easy access in Go

Note: This library is meant only for Sourcegraph use.

To improve type:symbol results in Sourcegraph, for languages with high quality Tree-sitter grammars, prefer adding support in scip-ctags in the Sourcegraph monorepo over adding support in this repo.

Adding new ctags flags

Add/modify appropriate .ctags files in ctagsdotd and re-run ./gen.sh at the root of the repository.

Testing

Requires: universal-ctags on PATH. For exact version, see the CI workflow.

Run tests: go test ./...

Update snapshots: go test ./... -update

Clean up old snapshots: go test ./... -update -clean

Documentation

Overview

Code generated by gen.sh. DO NOT EDIT.

Package ctags provides a Go wrapper for universal-ctags.

Index

Constants

This section is empty.

Variables

View Source
var SupportedLanguages = [...]string{
	"Basic",
	"C",
	"C#",
	"C++",
	"CSS",
	"CUDA",
	"Clojure",
	"Cobol",
	"D",
	"Elixir",
	"Erlang",
	"Go",
	"GraphQL",
	"Groovy",
	"Java",
	"JavaScript",
	"Jsonnet",
	"Lisp",
	"Lua",
	"Markdown",
	"MatLab",
	"OCaml",
	"ObjectiveC",
	"PHP",
	"Pascal",
	"Perl",
	"Perl6",
	"Powershell",
	"Protobuf",
	"Python",
	"R",
	"Ruby",
	"Rust",
	"Scheme",
	"Sh",
	"SystemVerilog",
	"Tcl",
	"Thrift",
	"VHDL",
	"Verilog",
	"Vim",
	"elm",
	"haskell",
	"kotlin",
	"scala",
	"swift",
	"tsx",
	"typescript",
}

Functions

func ListLanguageMappings

func ListLanguageMappings(ctx context.Context, bin string) (map[string][]string, error)

Types

type Entry

type Entry struct {
	Name       string
	Path       string
	Line       int
	Kind       string
	Language   string
	Parent     string
	ParentKind string
	Pattern    string
	Signature  string

	FileLimited bool
}

type Options

type Options struct {
	// Bin is the command to run. Defaults to "universal-ctags" if empty.
	Bin string

	// PatternLengthLimit is the cutoff length of the patterns output by
	// ctags. (--pattern-length-limit). If 0 defaults to 255.
	//
	// Note: --pattern-length-limit=0 disables this in universal-ctags. We don't
	// allow disabling it.
	PatternLengthLimit int

	// Info if non-nil will log info messages
	Info *log.Logger

	// Debug if non-nil will log debug messages
	Debug *log.Logger
}

type Parser

type Parser interface {
	Parse(path string, content []byte) ([]*Entry, error)
	Close()
}

func New

func New(opts Options) (Parser, error)

Jump to

Keyboard shortcuts

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