parse

package
v0.0.0-...-afa5e1a Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefinitionStringFromGopls

func DefinitionStringFromGopls(definition string) (string, sitter.Point, error)

DefinitionStringFromGopls accepts the output from a gopls definition command and returns only the file path and line number e.g. "'/Users/osilkin/Programming/playground/go-create-test/example/test.go:8:6-14: defined here as func fortnite() string" becomes "/Users/osilkin/Programming/playground/go-create-test/example/test.go:8:6-14"

func GetFunctionCalls

func GetFunctionCalls(filepath string, functionName string, code []byte) ([]string, error)

GetFunctionCalls takes a given function name and file to look at, then returns the definitions of all of the symbols referred to by that function.

func GetFunctionDefinition

func GetFunctionDefinition(targetFuncName string, code []byte) (string, error)

GetFunctionDefinition Returns the definition of a given function within a given file.

func GetPackageName

func GetPackageName(code []byte) (string, error)

GetPackageName Queries the given file for the package name.

Types

type FunctionCallRef

type FunctionCallRef struct {
	Name     string
	Ref      *sitter.Node
	Filepath string
}

type FunctionDefinition

type FunctionDefinition struct {
	Declaration string
	Comment     string
	Name        string
}

Jump to

Keyboard shortcuts

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