internal/lsp: make Diagnostics.CodeDescription a pointer

This avoid an embedded URI defaulting to ""
(https://github.com/golang/go/issues/42314)

Fixes:Fixes golang/go#42314

Change-Id: I614171d4ec80d139f5511b953d30f8385c2c7d5e
Reviewed-on: https://go-review.googlesource.com/c/tools/+/267106
Run-TryBot: Peter Weinberger <pjw@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
Trust: Peter Weinberger <pjw@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
This commit is contained in:
Peter Weinbergr 2020-11-02 13:52:29 -05:00 committed by Peter Weinberger
parent 3288bc1ea1
commit 3f6de07740
2 changed files with 3 additions and 2 deletions

View File

@ -1137,7 +1137,7 @@ type Diagnostic struct {
*
* @since 3.16.0 - proposed state
*/
CodeDescription CodeDescription `json:"codeDescription,omitempty"`
CodeDescription *CodeDescription `json:"codeDescription,omitempty"`
/**
* A human-readable string describing the source of this
* diagnostic, e.g. 'typescript' or 'super lint'. It usually

View File

@ -509,7 +509,8 @@ function toGo(d: Data, nm: string) {
// these fields need a *
var starred: [string, string][] = [
['TextDocumentContentChangeEvent', 'range'], ['CodeAction', 'command'],
['DidSaveTextDocumentParams', 'text'], ['CompletionItem', 'command']
['DidSaveTextDocumentParams', 'text'], ['CompletionItem', 'command'],
['Diagnostic', 'codeDescription']
];
// generate Go code for an interface