Skip to content

Commit

Permalink
add SourceInfoMap callback to LintResults.PrintErrorTo params
Browse files Browse the repository at this point in the history
Signed-off-by: Talon Bowler <[email protected]>
  • Loading branch information
daghack committed Sep 4, 2024
1 parent 94d3dae commit c075086
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frontend/subrequests/lint/lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func (results *LintResults) PrintTo(w io.Writer, scb SourceInfoMap) error {
return nil
}

func (results *LintResults) PrintErrorTo(w io.Writer) {
func (results *LintResults) PrintErrorTo(w io.Writer, scb SourceInfoMap) {
// This prints out the error in LintResults to the writer in a format that
// is consistent with the warnings for easier downstream consumption.
if results.Error == nil {
Expand All @@ -189,6 +189,9 @@ func (results *LintResults) PrintErrorTo(w io.Writer) {

fmt.Fprintln(w, results.Error.Message)
sourceInfo := results.Sources[results.Error.Location.SourceIndex]
if scb != nil {
sourceInfo = scb(sourceInfo)
}
source := errdefs.Source{
Info: sourceInfo,
Ranges: results.Error.Location.Ranges,
Expand Down

0 comments on commit c075086

Please sign in to comment.