Skip to content

Commit

Permalink
make WithPathContext external
Browse files Browse the repository at this point in the history
  • Loading branch information
jpogran committed Aug 16, 2023
1 parent 8668343 commit 31b75eb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion decoder/code_lens.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (d *Decoder) CodeLensesForFile(ctx context.Context, path lang.Path, file st

pathCtx, err := d.pathReader.PathContext(path)
if err == nil {
ctx = withPathContext(ctx, pathCtx)
ctx = WithPathContext(ctx, pathCtx)
}

ctx = withPathReader(ctx, d.pathReader)
Expand Down
2 changes: 1 addition & 1 deletion decoder/path_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type PathContext struct {

type pathCtxKey struct{}

func withPathContext(ctx context.Context, pathCtx *PathContext) context.Context {
func WithPathContext(ctx context.Context, pathCtx *PathContext) context.Context {
return context.WithValue(ctx, pathCtxKey{}, pathCtx)
}

Expand Down
2 changes: 1 addition & 1 deletion decoder/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (d *PathDecoder) Validate(ctx context.Context) (lang.DiagnosticsMap, error)
})
}

ctx = withPathContext(ctx, d.pathCtx)
ctx = WithPathContext(ctx, d.pathCtx)

// Run validation functions
for _, vFunc := range d.decoderCtx.Validations {
Expand Down

0 comments on commit 31b75eb

Please sign in to comment.