Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

Commit

Permalink
expose transformations mode for v2 requests
Browse files Browse the repository at this point in the history
Signed-off-by: Denys Smirnov <denys@sourced.tech>
  • Loading branch information
Denys Smirnov authored and dennwc committed Aug 10, 2018
1 parent 1fe625c commit a2109b5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions request.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,21 @@ func (r *ParseRequestV2) Filename(filename string) *ParseRequestV2 {
return r
}

// Mode controls the level of transformation applied to UAST.
type Mode = protocol2.Mode

const (
Native = protocol2.Mode_Native
Annotated = protocol2.Mode_Annotated
Semantic = protocol2.Mode_Semantic
)

// Mode controls the level of transformation applied to UAST.
func (r *ParseRequestV2) Mode(mode Mode) *ParseRequestV2 {
r.internal.Mode = mode
return r
}

// Do performs the actual parsing by serializing the request, sending it to
// bblfshd and waiting for the response.
func (r *ParseRequestV2) Do() (*protocol2.ParseResponse, error) {
Expand Down

0 comments on commit a2109b5

Please sign in to comment.