diff --git a/internal/lsp/protocol/log.go b/internal/lsp/protocol/log.go index 3fdff0638c..431155fe46 100644 --- a/internal/lsp/protocol/log.go +++ b/internal/lsp/protocol/log.go @@ -218,9 +218,13 @@ func logIn(outfd io.Writer, data []byte) { } else { fmt.Fprintf(&buf, "Result: %s%s", string(*v.Result), eor) } - } else if v.ID == nil && v.Method != "" && v.Params != nil { + } else if v.ID == nil && v.Method != "" { + p := "null" + if v.Params != nil { + p = string(*v.Params) + } fmt.Fprintf(&buf, "Sending notification '%s'.\n", v.Method) - fmt.Fprintf(&buf, "Params: %s%s", *v.Params, eor) + fmt.Fprintf(&buf, "Params: %s%s", p, eor) } else { // for completeness, as it should never happen buf = strings.Builder{} // undo common Trace fmt.Fprintf(&buf, "[Error - %s] on read ID?%v method:%q Params:%v Result:%v Error:%v%s",