buildctxt

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2020 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package buildctxt provides the go's build.Context and related go build context from current project directory structure.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Buffer

type Buffer struct {
	// BufNr number of current buffer.
	BufNr int
	// WinID id of current window.
	WinID int

	// Dir current directory.
	Dir string
}

Buffer represents a buffer context.

type Build

type Build struct {
	// Tool name of build tool
	Tool string
	// ProjectRoot package directory full path in the case of go project,
	// GB_PROJECT_DIR in the case of gb project.
	ProjectRoot string
}

Build represents a build tool information.

func (*Build) GbJoinPath

func (ctx *Build) GbJoinPath(elem ...string) string

GbJoinPath joins the sequence of path fragments into a single path for build.Default.JoinPath.

type Context

type Context struct {
	// Errlist map the nvim quickfix errors.
	Errlist map[string][]*nvim.QuickfixError

	PrevDir string // for cache

	Buffer
	Build
	// contains filtered or unexported fields
}

Context represents a current nvim instances context.

func NewContext

func NewContext() *Context

NewContext return the Context type with initialize Context.Errlist.

func (*Context) SetContext

func (ctx *Context) SetContext(dir string)

SetContext sets the Tool, ProjectRoot, go/build.Default and $GOPATH to buildContext. This function initializes for functions that use go/build.Default.

Jump to

Keyboard shortcuts

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