Skip to content

Commit

Permalink
gopls/integration: save more precise parsing information
Browse files Browse the repository at this point in the history
These are changes to treat errors more like responses. They are
important for the forthcoming log viewer.

Change-Id: Ief8de6ecea716673d4aee417de205842ceab4fc8
Reviewed-on: https://go-review.googlesource.com/c/tools/+/213124
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
  • Loading branch information
pjweinbgo committed Jan 2, 2020
1 parent 27f5d1b commit 81ef4df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gopls/integration/parse/parse.go
Expand Up @@ -89,7 +89,7 @@ func ReadLogs(fname string) ([]*Logmsg, error) {
}
msg.Body = v
case ReportErr:
msg.Body = msg.ID // cause?
msg.Body = msg.Rest // save cause
}
byid[msg.ID]++
msgs = append(msgs, msg)
Expand Down Expand Up @@ -152,6 +152,7 @@ func parselog(first, rest string) (*Logmsg, error) {
msg.Method = both[:idx]
msg.ID = fixid(both[idx+1:])
msg.Rest = strings.Join(flds[6:], " ")
msg.Rest = `"` + msg.Rest + `"`
default:
return nil, fmt.Errorf("surprise, first=%q with %d flds", first, len(flds))
}
Expand Down
1 change: 1 addition & 0 deletions gopls/integration/parse/rlog.go
Expand Up @@ -70,6 +70,7 @@ func ToRlog(fname string) (*Rlog, error) {
ans.ServerNotifs = append(ans.ServerNotifs, l)
case ReportErr:
ans.ServerReply[l.ID] = l
l.Method = ans.ServerCall[l.ID].Method // Method not in log message
default:
log.Fatalf("eh? %s/%s (%s)", l.Type, l.Method, l.ID)
}
Expand Down

0 comments on commit 81ef4df

Please sign in to comment.