Skip to content
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.

Commit

Permalink
add dir field to context
Browse files Browse the repository at this point in the history
  • Loading branch information
stamblerre committed Sep 11, 2018
1 parent 72ea77d commit e031868
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/suggest/suggest.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ type PackedContext struct {
//
Env []string

// Dir is the directory in which to run the build system's query tool
// that provides information about the packages.
// If Dir is empty, the tool is run in the current directory.
Dir string

// BuildFlags is a list of command-line flags to be passed through to
// the build system's query tool.
BuildFlags []string
Expand Down Expand Up @@ -98,6 +103,7 @@ func (c *Config) analyzePackage(filename string, data []byte, cursor int) (*toke
cfg := &packages.Config{
Mode: packages.LoadSyntax,
Env: c.Context.Env,
Dir: c.Context.Dir,
BuildFlags: c.Context.BuildFlags,
ParseFile: func(fset *token.FileSet, parseFilename string) (*ast.File, error) {
var src interface{}
Expand Down

0 comments on commit e031868

Please sign in to comment.